From e78e32b5f53b13ac17a2575c479f00cdebc590b4 Mon Sep 17 00:00:00 2001 From: Kelly Hofmann <55991524+k3llymariee@users.noreply.github.com> Date: Mon, 6 May 2024 16:31:29 -0700 Subject: [PATCH] feat: generate remaining resources commands from openapi spec (#244) * gen commands with full api spec * wip: first pass at fixing operation ids * use resource "key" in resourcedata map instead of name * map params to flag names * clean up flag name * refactor some of the helper methods * update output when no items returned * refactor helper fns to utils file * remove more filler words * remove non-generated resource cmds, update tests * fix another test * add support for optional request bodies * pr feedback --- cmd/environments/environments.go | 38 - cmd/environments/get.go | 79 - cmd/environments/get_test.go | 197 - cmd/flags/create.go | 84 - cmd/flags/create_test.go | 180 - cmd/flags/flags.go | 57 - cmd/flags/get.go | 82 - cmd/flags/get_test.go | 191 - cmd/flags/update.go | 153 - cmd/flags/update_test.go | 292 - cmd/members/create.go | 67 - cmd/members/create_test.go | 157 - cmd/members/invite_test.go | 2 + cmd/members/members.go | 6 - cmd/projects/create.go | 74 - cmd/projects/create_test.go | 180 - cmd/projects/list.go | 49 - cmd/projects/list_test.go | 159 - cmd/projects/projects.go | 38 - cmd/resources/gen_resources.go | 2 +- cmd/resources/resource_cmds.go | 5026 ++- cmd/resources/resource_cmds.tmpl | 9 +- cmd/resources/resource_cmds_test.go | 2 +- cmd/resources/resource_utils.go | 125 + cmd/resources/resources.go | 92 +- .../test_data/expected_template_data.json | 19 +- cmd/root.go | 22 +- internal/output/resource_output.go | 3 + ld-openapi.json | 37303 ++++++++++++++++ ld-teams-openapi.json | 1812 - 30 files changed, 42424 insertions(+), 4076 deletions(-) delete mode 100644 cmd/environments/environments.go delete mode 100644 cmd/environments/get.go delete mode 100644 cmd/environments/get_test.go delete mode 100644 cmd/flags/create.go delete mode 100644 cmd/flags/create_test.go delete mode 100644 cmd/flags/flags.go delete mode 100644 cmd/flags/get.go delete mode 100644 cmd/flags/get_test.go delete mode 100644 cmd/flags/update.go delete mode 100644 cmd/flags/update_test.go delete mode 100644 cmd/members/create.go delete mode 100644 cmd/members/create_test.go delete mode 100644 cmd/projects/create.go delete mode 100644 cmd/projects/create_test.go delete mode 100644 cmd/projects/list.go delete mode 100644 cmd/projects/list_test.go delete mode 100644 cmd/projects/projects.go create mode 100644 cmd/resources/resource_utils.go create mode 100644 ld-openapi.json delete mode 100644 ld-teams-openapi.json diff --git a/cmd/environments/environments.go b/cmd/environments/environments.go deleted file mode 100644 index 04833832..00000000 --- a/cmd/environments/environments.go +++ /dev/null @@ -1,38 +0,0 @@ -package environments - -import ( - "github.com/spf13/cobra" - "github.com/spf13/viper" - - cmdAnalytics "ldcli/cmd/analytics" - "ldcli/cmd/cliflags" - "ldcli/internal/analytics" - "ldcli/internal/environments" -) - -func NewEnvironmentsCmd( - analyticsTracker analytics.Tracker, - client environments.Client, -) (*cobra.Command, error) { - cmd := &cobra.Command{ - Use: "environments", - Short: "Make requests (list, create, etc.) on environments", - Long: "Make requests (list, create, etc.) on environments", - PersistentPreRun: func(cmd *cobra.Command, args []string) { - analyticsTracker.SendCommandRunEvent( - viper.GetString(cliflags.AccessTokenFlag), - viper.GetString(cliflags.BaseURIFlag), - viper.GetBool(cliflags.AnalyticsOptOut), - cmdAnalytics.CmdRunEventProperties(cmd, "environments"), - ) - }, - } - - getCmd, err := NewGetCmd(client) - if err != nil { - return nil, err - } - cmd.AddCommand(getCmd) - - return cmd, nil -} diff --git a/cmd/environments/get.go b/cmd/environments/get.go deleted file mode 100644 index 18e8cf2d..00000000 --- a/cmd/environments/get.go +++ /dev/null @@ -1,79 +0,0 @@ -package environments - -import ( - "context" - "fmt" - - "github.com/spf13/cobra" - "github.com/spf13/viper" - - "ldcli/cmd/cliflags" - "ldcli/cmd/validators" - "ldcli/internal/environments" - "ldcli/internal/errors" - "ldcli/internal/output" -) - -func NewGetCmd( - client environments.Client, -) (*cobra.Command, error) { - cmd := &cobra.Command{ - Args: validators.Validate(), - Long: "Return an environment", - RunE: runGet(client), - Short: "Return an environment", - Use: "get", - } - - cmd.Flags().StringP(cliflags.EnvironmentFlag, "e", "", "Environment key") - err := cmd.MarkFlagRequired(cliflags.EnvironmentFlag) - if err != nil { - return nil, err - } - - err = viper.BindPFlag(cliflags.EnvironmentFlag, cmd.Flags().Lookup(cliflags.EnvironmentFlag)) - if err != nil { - return nil, err - } - - cmd.Flags().StringP(cliflags.ProjectFlag, "p", "", "Project key") - err = cmd.MarkFlagRequired(cliflags.ProjectFlag) - if err != nil { - return nil, err - } - err = viper.BindPFlag(cliflags.ProjectFlag, cmd.Flags().Lookup(cliflags.ProjectFlag)) - if err != nil { - return nil, err - } - - return cmd, nil -} - -func runGet( - client environments.Client, -) func(*cobra.Command, []string) error { - return func(cmd *cobra.Command, args []string) error { - _ = viper.BindPFlag(cliflags.EnvironmentFlag, cmd.Flags().Lookup(cliflags.EnvironmentFlag)) - _ = viper.BindPFlag(cliflags.ProjectFlag, cmd.Flags().Lookup(cliflags.ProjectFlag)) - - response, err := client.Get( - context.Background(), - viper.GetString(cliflags.AccessTokenFlag), - viper.GetString(cliflags.BaseURIFlag), - viper.GetString(cliflags.EnvironmentFlag), - viper.GetString(cliflags.ProjectFlag), - ) - if err != nil { - return errors.NewError(output.CmdOutputError(viper.GetString(cliflags.OutputFlag), err)) - } - - output, err := output.CmdOutput("get", viper.GetString(cliflags.OutputFlag), response) - if err != nil { - return errors.NewError(err.Error()) - } - - fmt.Fprintf(cmd.OutOrStdout(), output+"\n") - - return nil - } -} diff --git a/cmd/environments/get_test.go b/cmd/environments/get_test.go deleted file mode 100644 index b7645465..00000000 --- a/cmd/environments/get_test.go +++ /dev/null @@ -1,197 +0,0 @@ -package environments_test - -import ( - "ldcli/cmd" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "ldcli/internal/analytics" - "ldcli/internal/environments" - "ldcli/internal/errors" -) - -func TestGet(t *testing.T) { - errorHelp := ". See `ldcli environments get --help` for supported flags and usage." - mockArgs := []interface{}{ - "testAccessToken", - "http://test.com", - "test-env", - "test-proj", - } - stubbedResponse := `{"key": "test-key", "name": "test-name"}` - - t.Run("with valid flags calls API", func(t *testing.T) { - client := environments.MockClient{} - client. - On("Get", mockArgs...). - Return([]byte(stubbedResponse), nil) - clients := cmd.APIClients{ - EnvironmentsClient: &client, - } - args := []string{ - "environments", "get", - "--access-token", "testAccessToken", - "--base-uri", "http://test.com", - "--output", "json", - "--environment", "test-env", - "--project", "test-proj", - } - - output, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - require.NoError(t, err) - assert.JSONEq(t, stubbedResponse, string(output)) - }) - - t.Run("with valid flags from environment variables calls API", func(t *testing.T) { - teardownTest := cmd.SetupTestEnvVars(t) - defer teardownTest(t) - client := environments.MockClient{} - client. - On("Get", mockArgs...). - Return([]byte(stubbedResponse), nil) - clients := cmd.APIClients{ - EnvironmentsClient: &client, - } - args := []string{ - "environments", "get", - "--output", "json", - "--environment", "test-env", - "--project", "test-proj", - } - - output, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - require.NoError(t, err) - assert.JSONEq(t, stubbedResponse, string(output)) - }) - - t.Run("with an error response is an error", func(t *testing.T) { - client := environments.MockClient{} - client. - On("Get", mockArgs...). - Return([]byte(`{}`), errors.NewError(`{"message": "An error"}`)) - clients := cmd.APIClients{ - EnvironmentsClient: &client, - } - args := []string{ - "environments", "get", - "--access-token", "testAccessToken", - "--base-uri", "http://test.com", - "--environment", "test-env", - "--project", "test-proj", - } - - _, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - require.EqualError(t, err, "An error") - }) - - t.Run("with missing required environments is an error", func(t *testing.T) { - clients := cmd.APIClients{ - EnvironmentsClient: &environments.MockClient{}, - } - args := []string{ - "environments", "get", - } - - _, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - assert.EqualError(t, err, `required flag(s) "access-token", "environment", "project" not set`+cmd.ExtraErrorHelp("environments", "get")) - }) - - t.Run("with missing short flag value is an error", func(t *testing.T) { - clients := cmd.APIClients{ - EnvironmentsClient: &environments.MockClient{}, - } - args := []string{ - "environments", "get", - "-e", - } - - _, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - assert.EqualError(t, err, `flag needs an argument: 'e' in -e`) - }) - - t.Run("with missing long flag value is an error", func(t *testing.T) { - clients := cmd.APIClients{ - EnvironmentsClient: &environments.MockClient{}, - } - args := []string{ - "environments", "get", - "--environment", - } - - _, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - assert.EqualError(t, err, `flag needs an argument: --environment`) - }) - - t.Run("with invalid base-uri is an error", func(t *testing.T) { - clients := cmd.APIClients{ - EnvironmentsClient: &environments.MockClient{}, - } - args := []string{ - "environments", "get", - "--access-token", "testAccessToken", - "--base-uri", "invalid", - "--environment", "test-env", - "--project", "test-proj", - } - - _, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - assert.EqualError(t, err, "base-uri is invalid"+errorHelp) - }) - - t.Run("with invalid output is an error", func(t *testing.T) { - clients := cmd.APIClients{ - EnvironmentsClient: &environments.MockClient{}, - } - args := []string{ - "environments", "get", - "--access-token", "testAccessToken", - "--output", "invalid", - "--environment", "test-env", - "--project", "test-proj", - } - - _, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - assert.EqualError(t, err, "output is invalid"+errorHelp) - }) - - t.Run("will track analytics for CLI Command Run event", func(t *testing.T) { - tracker := analytics.MockedTracker( - "environments", - "get", - []string{ - "access-token", - "base-uri", - "environment", - "project", - }, analytics.SUCCESS) - client := environments.MockClient{} - client. - On("Get", mockArgs...). - Return([]byte(cmd.StubbedSuccessResponse), nil) - clients := cmd.APIClients{ - EnvironmentsClient: &client, - } - - args := []string{ - "environments", "get", - "--access-token", "testAccessToken", - "--base-uri", "http://test.com", - "--environment", "test-env", - "--project", "test-proj", - } - - _, err := cmd.CallCmd(t, clients, tracker, args) - - require.NoError(t, err) - }) -} diff --git a/cmd/flags/create.go b/cmd/flags/create.go deleted file mode 100644 index 6074a3ce..00000000 --- a/cmd/flags/create.go +++ /dev/null @@ -1,84 +0,0 @@ -package flags - -import ( - "context" - "encoding/json" - "fmt" - - "github.com/spf13/cobra" - "github.com/spf13/viper" - - "ldcli/cmd/cliflags" - "ldcli/cmd/validators" - "ldcli/internal/errors" - "ldcli/internal/flags" - "ldcli/internal/output" -) - -func NewCreateCmd(client flags.Client) (*cobra.Command, error) { - cmd := &cobra.Command{ - Args: validators.Validate(), - Long: "Create a new flag", - RunE: runCreate(client), - Short: "Create a new flag", - Use: "create", - } - - cmd.Flags().StringP(cliflags.DataFlag, "d", "", "Input data in JSON") - err := cmd.MarkFlagRequired(cliflags.DataFlag) - if err != nil { - return nil, err - } - err = viper.BindPFlag(cliflags.DataFlag, cmd.Flags().Lookup(cliflags.DataFlag)) - if err != nil { - return nil, err - } - - cmd.Flags().String(cliflags.ProjectFlag, "", "Project key") - err = cmd.MarkFlagRequired(cliflags.ProjectFlag) - if err != nil { - return nil, err - } - err = viper.BindPFlag(cliflags.ProjectFlag, cmd.Flags().Lookup(cliflags.ProjectFlag)) - if err != nil { - return nil, err - } - - return cmd, nil -} - -type inputData struct { - Name string `json:"name"` - Key string `json:"key"` -} - -func runCreate(client flags.Client) func(*cobra.Command, []string) error { - return func(cmd *cobra.Command, args []string) error { - var data inputData - err := json.Unmarshal([]byte(viper.GetString(cliflags.DataFlag)), &data) - if err != nil { - return errors.NewError(output.CmdOutputError(viper.GetString(cliflags.OutputFlag), err)) - } - - response, err := client.Create( - context.Background(), - viper.GetString(cliflags.AccessTokenFlag), - viper.GetString(cliflags.BaseURIFlag), - data.Name, - data.Key, - viper.GetString(cliflags.ProjectFlag), - ) - if err != nil { - return errors.NewError(output.CmdOutputError(viper.GetString(cliflags.OutputFlag), err)) - } - - output, err := output.CmdOutput("create", viper.GetString(cliflags.OutputFlag), response) - if err != nil { - return errors.NewError(err.Error()) - } - - fmt.Fprintf(cmd.OutOrStdout(), output+"\n") - - return nil - } -} diff --git a/cmd/flags/create_test.go b/cmd/flags/create_test.go deleted file mode 100644 index 6ad10c87..00000000 --- a/cmd/flags/create_test.go +++ /dev/null @@ -1,180 +0,0 @@ -package flags_test - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "ldcli/cmd" - "ldcli/internal/analytics" - "ldcli/internal/errors" - "ldcli/internal/flags" -) - -func TestCreate(t *testing.T) { - errorHelp := ". See `ldcli flags create --help` for supported flags and usage." - mockArgs := []interface{}{ - "testAccessToken", - "http://test.com", - "test-name", - "test-key", - "test-proj-key", - } - - t.Run("with valid flags calls API", func(t *testing.T) { - client := flags.MockClient{} - client. - On("Create", mockArgs...). - Return([]byte(cmd.StubbedSuccessResponse), nil) - clients := cmd.APIClients{ - FlagsClient: &client, - } - args := []string{ - "flags", "create", - "--access-token", "testAccessToken", - "--base-uri", "http://test.com", - "--output", "json", - "-d", `{"key": "test-key", "name": "test-name"}`, - "--project", "test-proj-key", - } - - output, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - require.NoError(t, err) - assert.JSONEq(t, cmd.StubbedSuccessResponse, string(output)) - }) - - t.Run("with valid flags from environment variables calls API", func(t *testing.T) { - teardownTest := cmd.SetupTestEnvVars(t) - defer teardownTest(t) - client := flags.MockClient{} - client. - On("Create", mockArgs...). - Return([]byte(cmd.StubbedSuccessResponse), nil) - clients := cmd.APIClients{ - FlagsClient: &client, - } - args := []string{ - "flags", "create", - "--output", "json", - "-d", `{"key": "test-key", "name": "test-name"}`, - "--project", "test-proj-key", - } - - output, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - require.NoError(t, err) - assert.JSONEq(t, cmd.StubbedSuccessResponse, string(output)) - }) - - t.Run("with an error response is an error", func(t *testing.T) { - client := flags.MockClient{} - client. - On("Create", mockArgs...). - Return([]byte(`{}`), errors.NewError(`{"message": "An error"}`)) - clients := cmd.APIClients{ - FlagsClient: &client, - } - args := []string{ - "flags", "create", - "--access-token", "testAccessToken", - "--base-uri", "http://test.com", - "-d", `{"key": "test-key", "name": "test-name"}`, - "--project", "test-proj-key", - } - - _, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - require.EqualError(t, err, "An error") - }) - - t.Run("with missing required flags is an error", func(t *testing.T) { - clients := cmd.APIClients{ - FlagsClient: &flags.MockClient{}, - } - args := []string{ - "flags", "create", - } - - _, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - assert.EqualError(t, err, `required flag(s) "access-token", "data", "project" not set`+cmd.ExtraErrorHelp("flags", "create")) - }) - - t.Run("with missing short flag value is an error", func(t *testing.T) { - clients := cmd.APIClients{ - FlagsClient: &flags.MockClient{}, - } - args := []string{ - "flags", "create", - "-d", - } - - _, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - assert.EqualError(t, err, `flag needs an argument: 'd' in -d`) - }) - - t.Run("with missing long flag value is an error", func(t *testing.T) { - clients := cmd.APIClients{ - FlagsClient: &flags.MockClient{}, - } - args := []string{ - "flags", "create", - "--data", - } - - _, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - assert.EqualError(t, err, `flag needs an argument: --data`) - }) - - t.Run("with invalid base-uri is an error", func(t *testing.T) { - clients := cmd.APIClients{ - FlagsClient: &flags.MockClient{}, - } - args := []string{ - "flags", "create", - "--access-token", "testAccessToken", - "--base-uri", "invalid", - "-d", `{"key": "test-key", "name": "test-name"}`, - "--project", "test-proj-key", - } - - _, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - assert.EqualError(t, err, "base-uri is invalid"+errorHelp) - }) - - t.Run("will track analytics for CLI Command Run event", func(t *testing.T) { - tracker := analytics.MockedTracker( - "flags", - "create", - []string{ - "access-token", - "base-uri", - "data", - "project", - }, analytics.SUCCESS) - - client := flags.MockClient{} - client. - On("Create", mockArgs...). - Return([]byte(cmd.StubbedSuccessResponse), nil) - clients := cmd.APIClients{ - FlagsClient: &client, - } - - args := []string{ - "flags", "create", - "--access-token", "testAccessToken", - "--base-uri", "http://test.com", - "-d", `{"key": "test-key", "name": "test-name"}`, - "--project", "test-proj-key", - } - - _, err := cmd.CallCmd(t, clients, tracker, args) - require.NoError(t, err) - }) -} diff --git a/cmd/flags/flags.go b/cmd/flags/flags.go deleted file mode 100644 index b50c56ce..00000000 --- a/cmd/flags/flags.go +++ /dev/null @@ -1,57 +0,0 @@ -package flags - -import ( - "github.com/spf13/cobra" - "github.com/spf13/viper" - - cmdAnalytics "ldcli/cmd/analytics" - "ldcli/cmd/cliflags" - "ldcli/internal/analytics" - "ldcli/internal/flags" -) - -func NewFlagsCmd(analyticsTracker analytics.Tracker, client flags.Client) (*cobra.Command, error) { - cmd := &cobra.Command{ - Use: "flags", - Short: "Make requests (list, create, etc.) on flags", - Long: "Make requests (list, create, etc.) on flags", - PersistentPreRun: func(cmd *cobra.Command, args []string) { - analyticsTracker.SendCommandRunEvent( - viper.GetString(cliflags.AccessTokenFlag), - viper.GetString(cliflags.BaseURIFlag), - viper.GetBool(cliflags.AnalyticsOptOut), - cmdAnalytics.CmdRunEventProperties(cmd, "flags"), - ) - }, - } - - createCmd, err := NewCreateCmd(client) - if err != nil { - return nil, err - } - getCmd, err := NewGetCmd(client) - if err != nil { - return nil, err - } - updateCmd, err := NewUpdateCmd(client) - if err != nil { - return nil, err - } - - toggleOnUpdateCmd, err := NewToggleOnUpdateCmd(client) - if err != nil { - return nil, err - } - toggleOffUpdateCmd, err := NewToggleOffUpdateCmd(client) - if err != nil { - return nil, err - } - - cmd.AddCommand(createCmd) - cmd.AddCommand(getCmd) - cmd.AddCommand(updateCmd) - cmd.AddCommand(toggleOnUpdateCmd) - cmd.AddCommand(toggleOffUpdateCmd) - - return cmd, nil -} diff --git a/cmd/flags/get.go b/cmd/flags/get.go deleted file mode 100644 index 12319b31..00000000 --- a/cmd/flags/get.go +++ /dev/null @@ -1,82 +0,0 @@ -package flags - -import ( - "context" - "fmt" - - "github.com/spf13/cobra" - "github.com/spf13/viper" - - "ldcli/cmd/cliflags" - "ldcli/cmd/validators" - "ldcli/internal/errors" - "ldcli/internal/flags" - "ldcli/internal/output" -) - -func NewGetCmd(client flags.Client) (*cobra.Command, error) { - cmd := &cobra.Command{ - Args: validators.Validate(), - Long: "Get a flag to check its details", - RunE: runGet(client), - Short: "Get a flag", - Use: "get", - } - - cmd.Flags().String(cliflags.FlagFlag, "", "Flag key") - err := cmd.MarkFlagRequired(cliflags.FlagFlag) - if err != nil { - return nil, err - } - err = viper.BindPFlag(cliflags.FlagFlag, cmd.Flags().Lookup(cliflags.FlagFlag)) - if err != nil { - return nil, err - } - - cmd.Flags().String(cliflags.ProjectFlag, "", "Project key") - err = cmd.MarkFlagRequired(cliflags.ProjectFlag) - if err != nil { - return nil, err - } - err = viper.BindPFlag(cliflags.ProjectFlag, cmd.Flags().Lookup(cliflags.ProjectFlag)) - if err != nil { - return nil, err - } - - cmd.Flags().String(cliflags.EnvironmentFlag, "", "Environment key") - err = cmd.MarkFlagRequired(cliflags.EnvironmentFlag) - if err != nil { - return nil, err - } - err = viper.BindPFlag(cliflags.EnvironmentFlag, cmd.Flags().Lookup(cliflags.EnvironmentFlag)) - if err != nil { - return nil, err - } - - return cmd, nil -} - -func runGet(client flags.Client) func(*cobra.Command, []string) error { - return func(cmd *cobra.Command, args []string) error { - response, err := client.Get( - context.Background(), - viper.GetString(cliflags.AccessTokenFlag), - viper.GetString(cliflags.BaseURIFlag), - viper.GetString(cliflags.FlagFlag), - viper.GetString(cliflags.ProjectFlag), - viper.GetString(cliflags.EnvironmentFlag), - ) - if err != nil { - return errors.NewError(output.CmdOutputError(viper.GetString(cliflags.OutputFlag), err)) - } - - output, err := output.CmdOutput("get", viper.GetString(cliflags.OutputFlag), response) - if err != nil { - return errors.NewError(err.Error()) - } - - fmt.Fprintf(cmd.OutOrStdout(), output+"\n") - - return nil - } -} diff --git a/cmd/flags/get_test.go b/cmd/flags/get_test.go deleted file mode 100644 index 3ccd5bae..00000000 --- a/cmd/flags/get_test.go +++ /dev/null @@ -1,191 +0,0 @@ -package flags_test - -import ( - "ldcli/cmd" - "ldcli/internal/analytics" - "ldcli/internal/errors" - "ldcli/internal/flags" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestGet(t *testing.T) { - errorHelp := ". See `ldcli flags get --help` for supported flags and usage." - mockArgs := []interface{}{ - "testAccessToken", - "http://test.com", - "test-key", - "test-proj-key", - "test-env-key", - } - - t.Run("with valid flags calls API", func(t *testing.T) { - client := flags.MockClient{} - client. - On("Get", mockArgs...). - Return([]byte(cmd.StubbedSuccessResponse), nil) - clients := cmd.APIClients{ - FlagsClient: &client, - } - args := []string{ - "flags", "get", - "--access-token", "testAccessToken", - "--base-uri", "http://test.com", - "--output", "json", - "--flag", "test-key", - "--project", "test-proj-key", - "--environment", "test-env-key", - } - - output, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - require.NoError(t, err) - assert.JSONEq(t, cmd.StubbedSuccessResponse, string(output)) - }) - - t.Run("with valid flags from environment variables calls API", func(t *testing.T) { - teardownTest := cmd.SetupTestEnvVars(t) - defer teardownTest(t) - client := flags.MockClient{} - client. - On("Get", mockArgs...). - Return([]byte(cmd.StubbedSuccessResponse), nil) - clients := cmd.APIClients{ - FlagsClient: &client, - } - args := []string{ - "flags", "get", - "--flag", "test-key", - "--output", "json", - "--project", "test-proj-key", - "--environment", "test-env-key", - } - - output, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - require.NoError(t, err) - assert.JSONEq(t, cmd.StubbedSuccessResponse, string(output)) - }) - - t.Run("with an error response is an error", func(t *testing.T) { - client := flags.MockClient{} - client. - On("Get", mockArgs...). - Return([]byte(`{}`), errors.NewError(`{"message": "An error"}`)) - clients := cmd.APIClients{ - FlagsClient: &client, - } - args := []string{ - "flags", "get", - "--access-token", "testAccessToken", - "--base-uri", "http://test.com", - "--flag", "test-key", - "--project", "test-proj-key", - "--environment", "test-env-key", - } - - _, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - require.EqualError(t, err, "An error") - }) - - t.Run("with missing required flags is an error", func(t *testing.T) { - clients := cmd.APIClients{ - FlagsClient: &flags.MockClient{}, - } - args := []string{ - "flags", "get", - } - - _, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - assert.EqualError(t, err, `required flag(s) "access-token", "environment", "flag", "project" not set`+cmd.ExtraErrorHelp("flags", "get")) - }) - - t.Run("with invalid base-uri is an error", func(t *testing.T) { - clients := cmd.APIClients{ - FlagsClient: &flags.MockClient{}, - } - args := []string{ - "flags", "get", - "--access-token", "testAccessToken", - "--base-uri", "invalid", - "--flag", "test-key", - "--project", "test-proj-key", - "--environment", "test-env-key", - } - - _, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - assert.EqualError(t, err, "base-uri is invalid"+errorHelp) - }) - - t.Run("will track analytics for CLI Command Run event", func(t *testing.T) { - tracker := analytics.MockedTracker( - "flags", - "get", - []string{ - "access-token", - "base-uri", - "environment", - "flag", - "output", - "project", - }, analytics.SUCCESS) - - client := flags.MockClient{} - client. - On("Get", mockArgs...). - Return([]byte(cmd.StubbedSuccessResponse), nil) - clients := cmd.APIClients{ - FlagsClient: &client, - } - - args := []string{ - "flags", "get", - "--access-token", "testAccessToken", - "--base-uri", "http://test.com", - "--output", "json", - "--flag", "test-key", - "--project", "test-proj-key", - "--environment", "test-env-key", - } - - _, err := cmd.CallCmd(t, clients, tracker, args) - require.NoError(t, err) - }) - - t.Run("will track analytics for api error", func(t *testing.T) { - tracker := analytics.MockedTracker( - "flags", - "get", - []string{ - "access-token", - "base-uri", - "environment", - "flag", - "project", - }, analytics.ERROR) - client := flags.MockClient{} - client. - On("Get", mockArgs...). - Return([]byte(`{}`), errors.NewError(`{"message": "An error"}`)) - clients := cmd.APIClients{ - FlagsClient: &client, - } - - args := []string{ - "flags", "get", - "--access-token", "testAccessToken", - "--base-uri", "http://test.com", - "--flag", "test-key", - "--project", "test-proj-key", - "--environment", "test-env-key", - } - - _, err := cmd.CallCmd(t, clients, tracker, args) - require.EqualError(t, err, "An error") - }) -} diff --git a/cmd/flags/update.go b/cmd/flags/update.go deleted file mode 100644 index c0444b7b..00000000 --- a/cmd/flags/update.go +++ /dev/null @@ -1,153 +0,0 @@ -package flags - -import ( - "context" - "encoding/json" - "fmt" - - "github.com/spf13/cobra" - "github.com/spf13/viper" - - "ldcli/cmd/cliflags" - "ldcli/cmd/validators" - "ldcli/internal/errors" - "ldcli/internal/flags" - "ldcli/internal/output" -) - -func NewUpdateCmd(client flags.Client) (*cobra.Command, error) { - cmd := &cobra.Command{ - Args: validators.Validate(), - Long: "Update a flag", - RunE: runUpdate(client), - Short: "Update a flag", - Use: "update", - } - - cmd.Flags().StringP(cliflags.DataFlag, "d", "", "Input data in JSON") - err := cmd.MarkFlagRequired(cliflags.DataFlag) - if err != nil { - return nil, err - } - err = viper.BindPFlag(cliflags.DataFlag, cmd.Flags().Lookup(cliflags.DataFlag)) - if err != nil { - return nil, err - } - - cmd.Flags().String(cliflags.FlagFlag, "", "Flag key") - err = cmd.MarkFlagRequired(cliflags.FlagFlag) - if err != nil { - return nil, err - } - err = viper.BindPFlag(cliflags.FlagFlag, cmd.Flags().Lookup(cliflags.FlagFlag)) - if err != nil { - return nil, err - } - - cmd.Flags().String(cliflags.ProjectFlag, "", "Project key") - err = cmd.MarkFlagRequired(cliflags.ProjectFlag) - if err != nil { - return nil, err - } - err = viper.BindPFlag(cliflags.ProjectFlag, cmd.Flags().Lookup(cliflags.ProjectFlag)) - if err != nil { - return nil, err - } - - return cmd, nil -} - -func NewToggleOnUpdateCmd(client flags.Client) (*cobra.Command, error) { - cmd := &cobra.Command{ - Args: validators.Validate(), - Long: "Turn a flag on", - RunE: runUpdate(client), - Short: "Turn a flag on", - Use: "toggle-on", - } - - return setToggleCommandFlags(cmd) -} - -func NewToggleOffUpdateCmd(client flags.Client) (*cobra.Command, error) { - cmd := &cobra.Command{ - Args: validators.Validate(), - Long: "Turn a flag off", - RunE: runUpdate(client), - Short: "Turn a flag off", - Use: "toggle-off", - } - - return setToggleCommandFlags(cmd) -} - -func setToggleCommandFlags(cmd *cobra.Command) (*cobra.Command, error) { - cmd.Flags().StringP(cliflags.EnvironmentFlag, "e", "", "Environment key") - err := cmd.MarkFlagRequired(cliflags.EnvironmentFlag) - if err != nil { - return nil, err - } - err = viper.BindPFlag(cliflags.EnvironmentFlag, cmd.Flags().Lookup(cliflags.EnvironmentFlag)) - if err != nil { - return nil, err - } - - cmd.Flags().String(cliflags.FlagFlag, "", "Flag key") - err = cmd.MarkFlagRequired(cliflags.FlagFlag) - if err != nil { - return nil, err - } - err = viper.BindPFlag(cliflags.FlagFlag, cmd.Flags().Lookup(cliflags.FlagFlag)) - if err != nil { - return nil, err - } - - cmd.Flags().String(cliflags.ProjectFlag, "", "Project key") - err = cmd.MarkFlagRequired(cliflags.ProjectFlag) - if err != nil { - return nil, err - } - err = viper.BindPFlag(cliflags.ProjectFlag, cmd.Flags().Lookup(cliflags.ProjectFlag)) - if err != nil { - return nil, err - } - - return cmd, nil -} - -func runUpdate(client flags.Client) func(*cobra.Command, []string) error { - return func(cmd *cobra.Command, args []string) error { - var patch []flags.UpdateInput - if cmd.CalledAs() == "toggle-on" || cmd.CalledAs() == "toggle-off" { - _ = viper.BindPFlag(cliflags.EnvironmentFlag, cmd.Flags().Lookup(cliflags.EnvironmentFlag)) - envKey := viper.GetString(cliflags.EnvironmentFlag) - patch = flags.BuildToggleFlagPatch(envKey, cmd.CalledAs() == "toggle-on") - } else { - err := json.Unmarshal([]byte(viper.GetString(cliflags.DataFlag)), &patch) - if err != nil { - return errors.NewError(output.CmdOutputError(viper.GetString(cliflags.OutputFlag), err)) - } - } - - response, err := client.Update( - context.Background(), - viper.GetString(cliflags.AccessTokenFlag), - viper.GetString(cliflags.BaseURIFlag), - viper.GetString(cliflags.FlagFlag), - viper.GetString(cliflags.ProjectFlag), - patch, - ) - if err != nil { - return errors.NewError(output.CmdOutputError(viper.GetString(cliflags.OutputFlag), err)) - } - - output, err := output.CmdOutput("update", viper.GetString(cliflags.OutputFlag), response) - if err != nil { - return errors.NewError(err.Error()) - } - - fmt.Fprintf(cmd.OutOrStdout(), output+"\n") - - return nil - } -} diff --git a/cmd/flags/update_test.go b/cmd/flags/update_test.go deleted file mode 100644 index 3b6ef128..00000000 --- a/cmd/flags/update_test.go +++ /dev/null @@ -1,292 +0,0 @@ -package flags_test - -import ( - "ldcli/cmd" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "ldcli/internal/analytics" - "ldcli/internal/errors" - "ldcli/internal/flags" -) - -func TestUpdate(t *testing.T) { - errorHelp := ". See `ldcli flags update --help` for supported flags and usage." - mockArgs := []interface{}{ - "testAccessToken", - "http://test.com", - "test-proj-key", - "test-key", - []flags.UpdateInput{ - { - Op: "replace", - Path: "/name", - Value: "new-name", - }, - }, - } - - t.Run("with valid flags calls API", func(t *testing.T) { - client := flags.MockClient{} - client. - On("Update", mockArgs...). - Return([]byte(cmd.StubbedSuccessResponse), nil) - clients := cmd.APIClients{ - FlagsClient: &client, - } - args := []string{ - "flags", "update", - "--access-token", "testAccessToken", - "--base-uri", "http://test.com", - "--output", "json", - "-d", `[{"op": "replace", "path": "/name", "value": "new-name"}]`, - "--flag", "test-key", - "--project", "test-proj-key", - } - - output, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - require.NoError(t, err) - assert.JSONEq(t, cmd.StubbedSuccessResponse, string(output)) - }) - - t.Run("with valid flags from environment variables calls API", func(t *testing.T) { - teardownTest := cmd.SetupTestEnvVars(t) - defer teardownTest(t) - client := flags.MockClient{} - client. - On("Update", mockArgs...). - Return([]byte(cmd.StubbedSuccessResponse), nil) - clients := cmd.APIClients{ - FlagsClient: &client, - } - args := []string{ - "flags", "update", - "--output", "json", - "-d", `[{"op": "replace", "path": "/name", "value": "new-name"}]`, - "--flag", "test-key", - "--project", "test-proj-key", - } - - output, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - require.NoError(t, err) - assert.JSONEq(t, cmd.StubbedSuccessResponse, string(output)) - }) - - t.Run("with an error response is an error", func(t *testing.T) { - client := flags.MockClient{} - client. - On("Update", mockArgs...). - Return([]byte(`{}`), errors.NewError(`{"message": "An error"}`)) - clients := cmd.APIClients{ - FlagsClient: &client, - } - args := []string{ - "flags", "update", - "--access-token", "testAccessToken", - "--base-uri", "http://test.com", - "-d", `[{"op": "replace", "path": "/name", "value": "new-name"}]`, - "--flag", "test-key", - "--project", "test-proj-key", - } - - _, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - require.EqualError(t, err, "An error") - }) - - t.Run("with missing required flags is an error", func(t *testing.T) { - clients := cmd.APIClients{ - FlagsClient: &flags.MockClient{}, - } - args := []string{ - "flags", "update", - } - - _, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - assert.EqualError(t, err, `required flag(s) "access-token", "data", "flag", "project" not set`+cmd.ExtraErrorHelp("flags", "update")) - }) - - t.Run("with invalid base-uri is an error", func(t *testing.T) { - clients := cmd.APIClients{ - FlagsClient: &flags.MockClient{}, - } - args := []string{ - "flags", "update", - "--access-token", "testAccessToken", - "--base-uri", "invalid", - "-d", `{"key": "test-key", "name": "test-name"}`, - "--project", "test-proj-key", - } - - _, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - assert.EqualError(t, err, "base-uri is invalid"+errorHelp) - }) - - t.Run("will track analytics for CLI Command Run event", func(t *testing.T) { - tracker := analytics.MockedTracker( - "flags", - "update", - []string{ - "access-token", - "base-uri", - "data", - "flag", - "output", - "project", - }, analytics.SUCCESS) - - client := flags.MockClient{} - client. - On("Update", mockArgs...). - Return([]byte(cmd.StubbedSuccessResponse), nil) - clients := cmd.APIClients{ - FlagsClient: &client, - } - args := []string{ - "flags", "update", - "--access-token", "testAccessToken", - "--base-uri", "http://test.com", - "--output", "json", - "-d", `[{"op": "replace", "path": "/name", "value": "new-name"}]`, - "--flag", "test-key", - "--project", "test-proj-key", - } - - _, err := cmd.CallCmd(t, clients, tracker, args) - require.NoError(t, err) - }) -} - -func TestToggle(t *testing.T) { - errorHelp := ". See `ldcli flags toggle-on --help` for supported flags and usage." - mockArgs := []interface{}{ - "testAccessToken", - "http://test.com", - "test-proj-key", - "test-flag-key", - []flags.UpdateInput{ - { - Op: "replace", - Path: "/environments/test-env-key/on", - Value: true, - }, - }, - } - - t.Run("with valid flags calls API", func(t *testing.T) { - client := flags.MockClient{} - client. - On("Update", mockArgs...). - Return([]byte(cmd.StubbedSuccessResponse), nil) - clients := cmd.APIClients{ - FlagsClient: &client, - } - args := []string{ - "flags", "toggle-on", - "--access-token", "testAccessToken", - "--base-uri", "http://test.com", - "--output", "json", - "--flag", "test-flag-key", - "--project", "test-proj-key", - "--environment", "test-env-key", - } - - output, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - require.NoError(t, err) - assert.JSONEq(t, cmd.StubbedSuccessResponse, string(output)) - }) - - t.Run("with an error response is an error", func(t *testing.T) { - client := flags.MockClient{} - client. - On("Update", mockArgs...). - Return([]byte(`{}`), errors.NewError(`{"message": "An error"}`)) - clients := cmd.APIClients{ - FlagsClient: &client, - } - args := []string{ - "flags", "toggle-on", - "--access-token", "testAccessToken", - "--base-uri", "http://test.com", - "--flag", "test-flag-key", - "--project", "test-proj-key", - "--environment", "test-env-key", - } - - _, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - require.EqualError(t, err, "An error") - }) - - t.Run("with missing required flags is an error", func(t *testing.T) { - clients := cmd.APIClients{ - FlagsClient: &flags.MockClient{}, - } - args := []string{ - "flags", "toggle-on", - } - - _, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - assert.EqualError(t, err, `required flag(s) "access-token", "environment", "flag", "project" not set`+cmd.ExtraErrorHelp("flags", "toggle-on")) - }) - - t.Run("with invalid base-uri is an error", func(t *testing.T) { - clients := cmd.APIClients{ - FlagsClient: &flags.MockClient{}, - } - args := []string{ - "flags", "toggle-on", - "--access-token", "testAccessToken", - "--base-uri", "invalid", - "--flag", "test-flag-key", - "--project", "test-proj-key", - "--environment", "test-env-key", - } - - _, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - assert.EqualError(t, err, "base-uri is invalid"+errorHelp) - }) - - t.Run("will track analytics for CLI Command Run event", func(t *testing.T) { - tracker := analytics.MockedTracker( - "flags", - "toggle-on", - []string{ - "access-token", - "base-uri", - "environment", - "flag", - "output", - "project", - }, analytics.SUCCESS) - - client := flags.MockClient{} - client. - On("Update", mockArgs...). - Return([]byte(cmd.StubbedSuccessResponse), nil) - clients := cmd.APIClients{ - FlagsClient: &client, - } - args := []string{ - "flags", "toggle-on", - "--access-token", "testAccessToken", - "--base-uri", "http://test.com", - "--output", "json", - "--flag", "test-flag-key", - "--project", "test-proj-key", - "--environment", "test-env-key", - } - - _, err := cmd.CallCmd(t, clients, tracker, args) - require.NoError(t, err) - }) -} diff --git a/cmd/members/create.go b/cmd/members/create.go deleted file mode 100644 index 87e224ed..00000000 --- a/cmd/members/create.go +++ /dev/null @@ -1,67 +0,0 @@ -package members - -import ( - "context" - "encoding/json" - "fmt" - - "github.com/spf13/cobra" - "github.com/spf13/viper" - - "ldcli/cmd/cliflags" - "ldcli/cmd/validators" - "ldcli/internal/errors" - "ldcli/internal/members" - "ldcli/internal/output" -) - -func NewCreateCmd(client members.Client) (*cobra.Command, error) { - cmd := &cobra.Command{ - Args: validators.Validate(), - Long: "Create new members and send them an invitation email", - RunE: runCreate(client), - Short: "Create new members", - Use: "create", - } - - cmd.Flags().StringP(cliflags.DataFlag, "d", "", "Input data in JSON") - err := cmd.MarkFlagRequired(cliflags.DataFlag) - if err != nil { - return nil, err - } - err = viper.BindPFlag(cliflags.DataFlag, cmd.Flags().Lookup(cliflags.DataFlag)) - if err != nil { - return nil, err - } - - return cmd, nil -} - -func runCreate(client members.Client) func(*cobra.Command, []string) error { - return func(cmd *cobra.Command, args []string) error { - var data []members.MemberInput - err := json.Unmarshal([]byte(viper.GetString(cliflags.DataFlag)), &data) - if err != nil { - return errors.NewError(output.CmdOutputError(viper.GetString(cliflags.OutputFlag), err)) - } - - response, err := client.Create( - context.Background(), - viper.GetString(cliflags.AccessTokenFlag), - viper.GetString(cliflags.BaseURIFlag), - data, - ) - if err != nil { - return errors.NewError(output.CmdOutputError(viper.GetString(cliflags.OutputFlag), err)) - } - - output, err := output.CmdOutput("create", viper.GetString(cliflags.OutputFlag), response) - if err != nil { - return errors.NewError(err.Error()) - } - - fmt.Fprintf(cmd.OutOrStdout(), output+"\n") - - return nil - } -} diff --git a/cmd/members/create_test.go b/cmd/members/create_test.go deleted file mode 100644 index 21cdd174..00000000 --- a/cmd/members/create_test.go +++ /dev/null @@ -1,157 +0,0 @@ -package members_test - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "ldcli/cmd" - "ldcli/internal/analytics" - "ldcli/internal/errors" - "ldcli/internal/members" -) - -func TestCreate(t *testing.T) { - errorHelp := ". See `ldcli members create --help` for supported flags and usage." - role := "writer" - mockArgs := []interface{}{ - "testAccessToken", - "http://test.com", - []members.MemberInput{{Email: "testemail@test.com", Role: role}}, - } - - t.Run("with valid flags calls members API", func(t *testing.T) { - client := members.MockClient{} - client. - On("Create", mockArgs...). - Return([]byte(cmd.StubbedSuccessResponse), nil) - clients := cmd.APIClients{ - MembersClient: &client, - } - args := []string{ - "members", - "create", - "--access-token", "testAccessToken", - "--base-uri", "http://test.com", - "--output", "json", - "-d", - `[{"email": "testemail@test.com", "role": "writer"}]`, - } - - output, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - require.NoError(t, err) - assert.JSONEq(t, cmd.StubbedSuccessResponse, string(output)) - }) - - t.Run("with valid flags from environment variables calls API", func(t *testing.T) { - teardownTest := cmd.SetupTestEnvVars(t) - defer teardownTest(t) - client := members.MockClient{} - client. - On("Update", mockArgs...). - Return([]byte(cmd.StubbedSuccessResponse), nil) - client. - On("Create", mockArgs...). - Return([]byte(cmd.StubbedSuccessResponse), nil) - clients := cmd.APIClients{ - MembersClient: &client, - } - args := []string{ - "members", - "create", - "--output", "json", - "-d", - `[{"email": "testemail@test.com", "role": "writer"}]`, - } - - output, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - require.NoError(t, err) - assert.JSONEq(t, cmd.StubbedSuccessResponse, string(output)) - }) - - t.Run("with an error response is an error", func(t *testing.T) { - client := members.MockClient{} - client. - On("Create", mockArgs...). - Return([]byte(`{}`), errors.NewError(`{"message": "An error"}`)) - clients := cmd.APIClients{ - MembersClient: &client, - } - args := []string{ - "members", - "create", - "--access-token", "testAccessToken", - "--base-uri", "http://test.com", - "-d", - `[{"email": "testemail@test.com", "role": "writer"}]`, - } - - _, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - require.EqualError(t, err, "An error") - }) - - t.Run("with missing required flags is an error", func(t *testing.T) { - clients := cmd.APIClients{ - MembersClient: &members.MockClient{}, - } - args := []string{ - "members", - "create", - } - - _, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - assert.EqualError(t, err, `required flag(s) "access-token", "data" not set`+cmd.ExtraErrorHelp("members", "create")) - }) - - t.Run("with invalid base-uri is an error", func(t *testing.T) { - clients := cmd.APIClients{ - MembersClient: &members.MockClient{}, - } - args := []string{ - "members", - "create", - "--base-uri", "invalid", - } - - _, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - assert.EqualError(t, err, "base-uri is invalid"+errorHelp) - }) - - t.Run("will track analytics for CLI Command Run event", func(t *testing.T) { - tracker := analytics.MockedTracker( - "members", - "create", - []string{ - "access-token", - "base-uri", - "data", - "output", - }, analytics.SUCCESS) - - client := members.MockClient{} - client. - On("Create", mockArgs...). - Return([]byte(cmd.StubbedSuccessResponse), nil) - clients := cmd.APIClients{ - MembersClient: &client, - } - args := []string{ - "members", - "create", - "--access-token", "testAccessToken", - "--base-uri", "http://test.com", - "--output", "json", - "-d", - `[{"email": "testemail@test.com", "role": "writer"}]`, - } - - _, err := cmd.CallCmd(t, clients, tracker, args) - require.NoError(t, err) - }) -} diff --git a/cmd/members/invite_test.go b/cmd/members/invite_test.go index 9ee704d8..9c85f382 100644 --- a/cmd/members/invite_test.go +++ b/cmd/members/invite_test.go @@ -13,6 +13,7 @@ import ( ) func TestInvite(t *testing.T) { + t.Skip("to be replaced with generated cmds tests") errorHelp := ". See `ldcli members invite --help` for supported flags and usage." readerRole := "reader" mockArgs := []interface{}{ @@ -157,6 +158,7 @@ func TestInvite(t *testing.T) { } func TestInviteWithOptionalRole(t *testing.T) { + t.Skip("to be replaced with generated cmds tests") writerRole := "writer" mockArgs := []interface{}{ "testAccessToken", diff --git a/cmd/members/members.go b/cmd/members/members.go index c8cbcdce..a9af2466 100644 --- a/cmd/members/members.go +++ b/cmd/members/members.go @@ -25,17 +25,11 @@ func NewMembersCmd(analyticsTracker analytics.Tracker, client members.Client) (* }, } - createCmd, err := NewCreateCmd(client) - if err != nil { - return nil, err - } - inviteCmd, err := NewInviteCmd(client) if err != nil { return nil, err } - cmd.AddCommand(createCmd) cmd.AddCommand(inviteCmd) return cmd, nil diff --git a/cmd/projects/create.go b/cmd/projects/create.go deleted file mode 100644 index 428e8004..00000000 --- a/cmd/projects/create.go +++ /dev/null @@ -1,74 +0,0 @@ -package projects - -import ( - "context" - "encoding/json" - "fmt" - - "github.com/spf13/cobra" - "github.com/spf13/viper" - - "ldcli/cmd/cliflags" - "ldcli/cmd/validators" - "ldcli/internal/errors" - "ldcli/internal/output" - "ldcli/internal/projects" -) - -func NewCreateCmd(client projects.Client) (*cobra.Command, error) { - cmd := &cobra.Command{ - Args: validators.Validate(), - Long: "Create a new project", - RunE: runCreate(client), - Short: "Create a new project", - Use: "create", - } - - cmd.Flags().StringP(cliflags.DataFlag, "d", "", "Input data in JSON") - err := cmd.MarkFlagRequired(cliflags.DataFlag) - if err != nil { - return nil, err - } - err = viper.BindPFlag(cliflags.DataFlag, cmd.Flags().Lookup(cliflags.DataFlag)) - if err != nil { - return nil, err - } - - return cmd, nil -} - -type inputData struct { - Name string `json:"name"` - Key string `json:"key"` -} - -func runCreate(client projects.Client) func(*cobra.Command, []string) error { - return func(cmd *cobra.Command, args []string) error { - var data inputData - // TODO: why does viper.GetString(cliflags.DataFlag) not work? - err := json.Unmarshal([]byte(cmd.Flags().Lookup(cliflags.DataFlag).Value.String()), &data) - if err != nil { - return errors.NewError(output.CmdOutputError(viper.GetString(cliflags.OutputFlag), err)) - } - - response, err := client.Create( - context.Background(), - viper.GetString(cliflags.AccessTokenFlag), - viper.GetString(cliflags.BaseURIFlag), - data.Name, - data.Key, - ) - if err != nil { - return errors.NewError(output.CmdOutputError(viper.GetString(cliflags.OutputFlag), err)) - } - - output, err := output.CmdOutput("create", viper.GetString(cliflags.OutputFlag), response) - if err != nil { - return errors.NewError(err.Error()) - } - - fmt.Fprintf(cmd.OutOrStdout(), output+"\n") - - return nil - } -} diff --git a/cmd/projects/create_test.go b/cmd/projects/create_test.go deleted file mode 100644 index ba22ac5a..00000000 --- a/cmd/projects/create_test.go +++ /dev/null @@ -1,180 +0,0 @@ -package projects_test - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "ldcli/cmd" - "ldcli/internal/analytics" - "ldcli/internal/errors" - "ldcli/internal/projects" -) - -func TestCreate(t *testing.T) { - errorHelp := ". See `ldcli projects create --help` for supported flags and usage." - mockArgs := []interface{}{ - "testAccessToken", - "http://test.com", - "test-name", - "test-key", - } - stubbedSuccessResponse := `{ - "key": "test-key", - "name": "test-name" - }` - - t.Run("with valid flags calls API", func(t *testing.T) { - client := projects.MockClient{} - client. - On("Create", mockArgs...). - Return([]byte(stubbedSuccessResponse), nil) - clients := cmd.APIClients{ - ProjectsClient: &client, - } - args := []string{ - "projects", - "create", - "--access-token", "testAccessToken", - "--base-uri", "http://test.com", - "--output", "json", - "-d", - `{"key": "test-key", "name": "test-name"}`, - } - - output, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - require.NoError(t, err) - assert.JSONEq(t, stubbedSuccessResponse, string(output)) - }) - - t.Run("with valid flags from environment variables calls API", func(t *testing.T) { - teardownTest := cmd.SetupTestEnvVars(t) - defer teardownTest(t) - client := projects.MockClient{} - client. - On("Create", mockArgs...). - Return([]byte(stubbedSuccessResponse), nil) - clients := cmd.APIClients{ - ProjectsClient: &client, - } - args := []string{ - "projects", - "create", - "--output", "json", - "-d", - `{"key": "test-key", "name": "test-name"}`, - } - - output, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - require.NoError(t, err) - assert.JSONEq(t, stubbedSuccessResponse, string(output)) - }) - - t.Run("with an error response is an error", func(t *testing.T) { - client := projects.MockClient{} - client. - On("Create", mockArgs...). - Return([]byte(`{}`), errors.NewError(`{"message": "An error"}`)) - clients := cmd.APIClients{ - ProjectsClient: &client, - } - args := []string{ - "projects", "create", - "--access-token", "testAccessToken", - "--base-uri", "http://test.com", - "-d", `{"key": "test-key", "name": "test-name"}`, - } - - _, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - require.EqualError(t, err, "An error") - }) - - t.Run("with missing required flags is an error", func(t *testing.T) { - clients := cmd.APIClients{ - ProjectsClient: &projects.MockClient{}, - } - args := []string{ - "projects", - "create", - } - - _, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - assert.EqualError(t, err, `required flag(s) "access-token", "data" not set`+cmd.ExtraErrorHelp("projects", "create")) - }) - - t.Run("with missing short flag value is an error", func(t *testing.T) { - clients := cmd.APIClients{ - ProjectsClient: &projects.MockClient{}, - } - args := []string{ - "projects", "create", - "-d", - } - - _, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - assert.EqualError(t, err, `flag needs an argument: 'd' in -d`) - }) - - t.Run("with missing long flag value is an error", func(t *testing.T) { - clients := cmd.APIClients{ - ProjectsClient: &projects.MockClient{}, - } - args := []string{ - "projects", "create", - "--data", - } - - _, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - assert.EqualError(t, err, `flag needs an argument: --data`) - }) - - t.Run("with invalid base-uri is an error", func(t *testing.T) { - clients := cmd.APIClients{ - ProjectsClient: &projects.MockClient{}, - } - args := []string{ - "projects", - "create", - "--base-uri", "invalid", - } - - _, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - assert.EqualError(t, err, "base-uri is invalid"+errorHelp) - }) - - t.Run("will track analytics for CLI Command Run event", func(t *testing.T) { - tracker := analytics.MockedTracker( - "projects", - "create", - []string{ - "access-token", - "base-uri", - "data", - }, analytics.SUCCESS) - - client := projects.MockClient{} - client. - On("Create", mockArgs...). - Return([]byte(cmd.StubbedSuccessResponse), nil) - clients := cmd.APIClients{ - ProjectsClient: &client, - } - args := []string{ - "projects", "create", - "--access-token", "testAccessToken", - "--base-uri", "http://test.com", - "-d", `{"key": "test-key", "name": "test-name"}`, - } - - _, err := cmd.CallCmd(t, clients, tracker, args) - require.NoError(t, err) - }) -} diff --git a/cmd/projects/list.go b/cmd/projects/list.go deleted file mode 100644 index da717f17..00000000 --- a/cmd/projects/list.go +++ /dev/null @@ -1,49 +0,0 @@ -package projects - -import ( - "context" - "fmt" - - "github.com/spf13/cobra" - "github.com/spf13/viper" - - "ldcli/cmd/cliflags" - "ldcli/cmd/validators" - "ldcli/internal/errors" - "ldcli/internal/output" - "ldcli/internal/projects" -) - -func NewListCmd(client projects.Client) *cobra.Command { - cmd := &cobra.Command{ - Args: validators.Validate(), - Long: "Return a list of projects", - RunE: runList(client), - Short: "Return a list of projects", - Use: "list", - } - - return cmd -} - -func runList(client projects.Client) func(*cobra.Command, []string) error { - return func(cmd *cobra.Command, args []string) error { - response, err := client.List( - context.Background(), - viper.GetString(cliflags.AccessTokenFlag), - viper.GetString(cliflags.BaseURIFlag), - ) - if err != nil { - return errors.NewError(output.CmdOutputError(viper.GetString(cliflags.OutputFlag), err)) - } - - output, err := output.CmdOutput("list", viper.GetString(cliflags.OutputFlag), response) - if err != nil { - return errors.NewError(err.Error()) - } - - fmt.Fprintf(cmd.OutOrStdout(), output+"\n") - - return nil - } -} diff --git a/cmd/projects/list_test.go b/cmd/projects/list_test.go deleted file mode 100644 index 64236aa4..00000000 --- a/cmd/projects/list_test.go +++ /dev/null @@ -1,159 +0,0 @@ -package projects_test - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "ldcli/cmd" - "ldcli/internal/analytics" - "ldcli/internal/errors" - "ldcli/internal/projects" -) - -func TestList(t *testing.T) { - errorHelp := ". See `ldcli projects list --help` for supported flags and usage." - mockArgs := []interface{}{ - "testAccessToken", - "http://test.com", - } - stubbedResponse := `{ - "items": [ - { - "key": "test-key", - "name": "test-name" - } - ] - }` - - t.Run("with valid flags calls API", func(t *testing.T) { - client := projects.MockClient{} - client. - On("List", mockArgs...). - Return([]byte(stubbedResponse), nil) - clients := cmd.APIClients{ - ProjectsClient: &client, - } - args := []string{ - "projects", "list", - "--access-token", "testAccessToken", - "--base-uri", "http://test.com", - "--output", "json", - } - - output, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - require.NoError(t, err) - assert.JSONEq(t, stubbedResponse, string(output)) - }) - - t.Run("with valid flags from environment variables calls API", func(t *testing.T) { - teardownTest := cmd.SetupTestEnvVars(t) - defer teardownTest(t) - client := projects.MockClient{} - client. - On("List", mockArgs...). - Return([]byte(stubbedResponse), nil) - clients := cmd.APIClients{ - ProjectsClient: &client, - } - args := []string{ - "projects", - "list", - "--output", "json", - } - - output, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - require.NoError(t, err) - assert.JSONEq(t, stubbedResponse, string(output)) - }) - - t.Run("with an error response is an error", func(t *testing.T) { - client := projects.MockClient{} - client. - On("List", mockArgs...). - Return([]byte(`{}`), errors.NewError(`{"message": "An error"}`)) - clients := cmd.APIClients{ - ProjectsClient: &client, - } - args := []string{ - "projects", "list", - "--access-token", "testAccessToken", - "--base-uri", "http://test.com", - } - - _, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - require.EqualError(t, err, "An error") - }) - - t.Run("with missing required flags is an error", func(t *testing.T) { - clients := cmd.APIClients{ - ProjectsClient: &projects.MockClient{}, - } - args := []string{ - "projects", "list", - } - - _, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - assert.EqualError(t, err, `required flag(s) "access-token" not set`+cmd.ExtraErrorHelp("projects", "list")) - }) - - t.Run("with missing long flag value is an error", func(t *testing.T) { - clients := cmd.APIClients{ - ProjectsClient: &projects.MockClient{}, - } - args := []string{ - "projects", "list", - "--access-token", - } - - _, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - assert.EqualError(t, err, `flag needs an argument: --access-token`) - }) - - t.Run("with invalid base-uri is an error", func(t *testing.T) { - clients := cmd.APIClients{ - ProjectsClient: &projects.MockClient{}, - } - args := []string{ - "projects", "list", - "--access-token", "testAccessToken", - "--base-uri", "invalid", - } - - _, err := cmd.CallCmd(t, clients, &analytics.NoopClient{}, args) - - assert.EqualError(t, err, "base-uri is invalid"+errorHelp) - }) - - t.Run("will track analytics for CLI Command Run event", func(t *testing.T) { - tracker := analytics.MockedTracker( - "projects", - "list", - []string{ - "access-token", - "base-uri", - }, analytics.SUCCESS) - - client := projects.MockClient{} - client. - On("List", mockArgs...). - Return([]byte(cmd.StubbedSuccessResponse), nil) - clients := cmd.APIClients{ - ProjectsClient: &client, - } - args := []string{ - "projects", "list", - "--access-token", "testAccessToken", - "--base-uri", "http://test.com", - } - - _, err := cmd.CallCmd(t, clients, tracker, args) - require.NoError(t, err) - }) -} diff --git a/cmd/projects/projects.go b/cmd/projects/projects.go deleted file mode 100644 index d2df0757..00000000 --- a/cmd/projects/projects.go +++ /dev/null @@ -1,38 +0,0 @@ -package projects - -import ( - "github.com/spf13/cobra" - "github.com/spf13/viper" - - cmdAnalytics "ldcli/cmd/analytics" - "ldcli/cmd/cliflags" - "ldcli/internal/analytics" - "ldcli/internal/projects" -) - -func NewProjectsCmd(analyticsTracker analytics.Tracker, client projects.Client) (*cobra.Command, error) { - cmd := &cobra.Command{ - Use: "projects", - Short: "Make requests (list, create, etc.) on projects", - Long: "Make requests (list, create, etc.) on projects", - PersistentPreRun: func(cmd *cobra.Command, args []string) { - analyticsTracker.SendCommandRunEvent( - viper.GetString(cliflags.AccessTokenFlag), - viper.GetString(cliflags.BaseURIFlag), - viper.GetBool(cliflags.AnalyticsOptOut), - cmdAnalytics.CmdRunEventProperties(cmd, "projects"), - ) - }, - } - - createCmd, err := NewCreateCmd(client) - if err != nil { - return nil, err - } - listCmd := NewListCmd(client) - - cmd.AddCommand(createCmd) - cmd.AddCommand(listCmd) - - return cmd, nil -} diff --git a/cmd/resources/gen_resources.go b/cmd/resources/gen_resources.go index d3385c57..a46f71ba 100644 --- a/cmd/resources/gen_resources.go +++ b/cmd/resources/gen_resources.go @@ -14,7 +14,7 @@ import ( ) const ( - pathSpecFile = "../ld-teams-openapi.json" + pathSpecFile = "../ld-openapi.json" pathTemplate = "resources/resource_cmds.tmpl" templateName = "resource_cmds.tmpl" pathOutput = "resources/resource_cmds.go" diff --git a/cmd/resources/resource_cmds.go b/cmd/resources/resource_cmds.go index 112ca4be..bd6579f3 100644 --- a/cmd/resources/resource_cmds.go +++ b/cmd/resources/resource_cmds.go @@ -12,6 +12,174 @@ import ( func AddAllResourceCmds(rootCmd *cobra.Command, client resources.Client, analyticsTracker analytics.Tracker) { // Resource commands + gen_ApprovalRequestsResourceCmd := NewResourceCmd( + rootCmd, + analyticsTracker, + "approval-requests", + "Make requests (list, create, etc.) on approval requests", + "You can create an approval request that prevents a flag change from being applied without approval from a team member. Select up to ten members as reviewers. Reviewers receive an email notification, but anyone with sufficient permissions can review a pending approval request. A change needs at least one approval before you can apply it. To learn more, read [Approvals](https://docs.launchdarkly.com/home/feature-workflows/approvals).\n\nChanges that conflict will fail if approved and applied, and the flag will not be updated.\n\nSeveral of the endpoints in the approvals API require a flag approval request ID. The flag approval request ID is returned as part of the [Create approval request](/tag/Approvals#operation/postApprovalRequest) and [List approval requests for a flag](/tag/Approvals#operation/getApprovalsForFlag) responses. It is the `_id` field, or the `_id` field of each element in the `items` array. If you created the approval request as part of a [workflow](/tag/Workflows), you can also use a workflow ID as the approval request ID. The workflow ID is returned as part of the [Create workflow](/tag/Workflows#operation/postWorkflow) and [Get workflows](/tag/Workflows#operation/getWorkflows) responses. It is the `_id` field, or the `_id` field of each element in the `items` array.\n", + ) + + gen_AuditLogResourceCmd := NewResourceCmd( + rootCmd, + analyticsTracker, + "audit-log", + "Make requests (list, create, etc.) on audit log", + "The audit log contains a record of all the changes made to any resource in the system. You can filter the audit log by timestamps, or use a custom policy to select which entries to receive.\n\nSeveral of the endpoints in the audit log API require an audit log entry ID. The audit log entry ID is returned as part of the [List audit log entries](/tag/Audit-log#operation/getAuditLogEntries) response. It is the `_id` field of each element in the `items` array.\n\nTo learn more, read [The audit log and history tabs](https://docs.launchdarkly.com/home/code/audit-log-history/).\n", + ) + + gen_CodeRefsResourceCmd := NewResourceCmd( + rootCmd, + analyticsTracker, + "code-refs", + "Make requests (list, create, etc.) on code refs", + "\u003e ### Code references is an Enterprise feature\n\u003e\n\u003e Code references is available to customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\n\u003e ### Use ld-find-code-refs\n\u003e\n\u003e LaunchDarkly provides the [ld-find-code-refs utility](https://github.com/launchdarkly/ld-find-code-refs) that creates repository connections, generates code reference data, and creates calls to the code references API. Most customers do not need to call this API directly.\n\nThe code references API provides access to all resources related to each connected repository, and associated feature flag code reference data for all branches. To learn more, read [Code references](https://docs.launchdarkly.com/home/code/code-references).\n", + ) + + gen_ContextSettingsResourceCmd := NewResourceCmd( + rootCmd, + analyticsTracker, + "context-settings", + "Make requests (list, create, etc.) on context settings", + "You can use the context settings API to assign a context to a specific variation for any feature flag. To learn more, read [Viewing and managing contexts](https://docs.launchdarkly.com/home/contexts/attributes#viewing-and-managing-contexts).\n", + ) + + gen_ContextsResourceCmd := NewResourceCmd( + rootCmd, + analyticsTracker, + "contexts", + "Make requests (list, create, etc.) on contexts", + "\nContexts are people, services, machines, or other resources that encounter feature flags in your product. Contexts are identified by their `kind`, which describes the type of resources encountering flags, and by their `key`. Each unique combination of one or more contexts that have encountered a feature flag in your product is called a context instance.\n\nWhen you use the LaunchDarkly SDK to evaluate a flag, you provide a context to that call. LaunchDarkly records the key and attributes of each context instance. You can view these in the LaunchDarkly user interface from the **Contexts** list, or use the Context APIs. To learn more, read [Contexts](https://docs.launchdarkly.com/home/contexts).\n\nLaunchDarkly provides APIs for you to:\n\n* retrieve contexts, context instances, and context attribute names and values\n* search for contexts or context instances\n* delete context instances\n* fetch context kinds\n* create and update context kinds\n\nTo learn more about context kinds, read [Context kinds](https://docs.launchdarkly.com/home/contexts/context-kinds).\n\nContexts are always scoped within a project and an environment. Each environment has its own set of context instance records.\n\nSeveral of the endpoints in the contexts API require a context instance ID or application ID. Both of these IDs are returned as part of the [Search for context instances](/tag/Contexts#operation/searchContextInstances) response. The context instance ID is the `id` field of each element in the `items` array. The application ID is the `applicationId` field of each element in the `items` array. By default, the application ID is set to the SDK you are using. In the LaunchDarkly UI, the application ID and application version appear on the context details page in the \"From source\" field. You can change the application ID as part of your SDK configuration. To learn more, read [Application metadata configuration](https://docs.launchdarkly.com/sdk/features/app-config).\n\n### Filtering contexts and context instances\n\nWhen you [search for contexts](/tag/Contexts#operation/searchContexts) or [context instances](/tag/Contexts#operation/searchContextInstances), you can filter on certain fields using the `filter` parameter either as a query parameter or as a request body parameter.\n\nThe `filter` parameter supports the following operators: `after`, `anyOf`, `before`, `contains`, `equals`, `exists`, `notEquals`, `startsWith`.\n\n\u003cdetails\u003e\n\u003csummary\u003eExpand for details on operators and syntax\u003c/summary\u003e\n\n#### after\n\nReturns contexts or context instances if any of the values in a field, which should be dates, are after the provided time. For example:\n\n* `myField after \"2022-09-21T19:03:15+00:00\"`\n\n#### anyOf\n\nReturns contexts or context instances if any of the values in a field match any of the values in the match value. For example:\n\n* `myField anyOf [44]`\n* `myField anyOf [\"phone\",\"tablet\"]`\n* `myField anyOf [true]\"`\n\n#### before\n\nReturns contexts or context instances if any of the values in a field, which should be dates, are before the provided time. For example:\n\n* `myField before \"2022-09-21T19:03:15+00:00\"`\n\n#### contains\n\nReturns contexts or context instances if all the match values are found in the list of values in this field. For example:\n\n* `myListField contains 44`\n* `myListField contains [\"phone\",\"tablet\"]`\n* `myListField contains true`\n\n#### equals\n\nReturns contexts or context instances if there is an exact match on the entire field. For example:\n\n* `myField equals 44`\n* `myField equals \"device\"`\n* `myField equals true`\n* `myField equals [1,2,3,4]`\n* `myField equals [\"hello\",\"goodbye\"]`\n\n#### exists\n\nReturns contexts or context instances if the field matches the specified existence. For example:\n\n* `myField exists true`\n* `myField exists false`\n* `*.name exists true`\n\n#### notEquals\n\nReturns contexts or context instances if there is not an exact match on the entire field. For example:\n\n* `myField notEquals 44`\n* `myField notEquals \"device\"`\n* `myField notEquals true`\n* `myField notEquals [1,2,3,4]`\n* `myField notEquals [\"hello\",\"goodbye\"]`\n\n#### startsWith\n\nReturns contexts or context instances if the value in a field, which should be a singular string, begins with the provided substring. For example:\n\n* `myField startsWith \"do\"`\n\n\u003c/details\u003e\n\nYou can also combine filters in the following ways:\n\n* Use a comma (`,`) as an AND operator\n* Use a vertical bar (`|`) as an OR operator\n* Use parentheses `()` to group filters\n\nFor example:\n\n* `myField notEquals 0, myField notEquals 1` returns contexts or context instances where `myField` is not 0 and is not 1\n* `myFirstField equals \"device\",(mySecondField equals \"iPhone\"|mySecondField equals \"iPad\")` returns contexts or context instances where `myFirstField` is equal to \"device\" and `mySecondField` is equal to either \"iPhone\" or \"iPad\"\n\n#### Supported fields and operators\n\nYou can only filter certain fields in contexts and context instances when using the `filter` parameter. Additionally, you can only filter some fields with certain operators.\n\nWhen you search for [contexts]((/tag/Contexts#operation/searchContexts)), the `filter` parameter supports the following fields and operators:\n\n|\u003cdiv style=\"width:120px\"\u003eField\u003c/div\u003e |Description |Supported operators |\n|---|---|---|\n|`applicationId` |An identifier representing the application where the LaunchDarkly SDK is running. |`equals`, `notEquals`, `anyOf` |\n|`id` |Unique identifier for the context. |`equals`, `notEquals`, `anyOf` |\n|`key` |The context key. |`equals`, `notEquals`, `anyOf`, `startsWith` |\n|`kind` |The context kind. |`equals`, `notEquals`, `anyOf` |\n|`kinds` |A list of all kinds found in the context. Supply a list of strings to the operator. |`equals`, `anyOf`, `contains` |\n|`kindKey` |The kind and key for the context. They are joined with `:`, for example, `user:user-key-abc123`. |`equals`, `notEquals`, `anyOf` |\n|`kindKeys` |A list of all kinds and keys found in the context. The kind and key are joined with `:`, for example, `user:user-key-abc123`. Supply a list of strings to the operator. |`equals`, `anyOf`, `contains` |\n|`q` |A \"fuzzy\" search across context attribute values and the context key. Supply a string or list of strings to the operator. |`equals` |\n|`name` |The name for the context. |`equals`, `notEquals`, `exists`, `anyOf`, `startsWith` |\n|`\u003ca kind\u003e.\u003can attribute name\u003e` |A kind and the name of any attribute that appears in a context of that kind, for example, `user.email`. To filter all kinds, use `*` in place of the kind, for example, `*.email`. You can use either a literal attribute name or a JSON path to specify the attribute. If you use a JSON path, then you must escape the `/` character, using `~1`, and the `~` character, using `~0`. For example, use `user.job/title` or `user./job~1title` to filter the `/job/title` field in a user context kind. If the field or value includes whitespace, it should be enclosed in double quotes. |`equals`, `notEquals`, `exists`, `startsWith`, `before`, `after`.|\n\nWhen searching for [context instances](/tag/Contexts#operation/searchContextInstances), the `filter` parameter supports the following fields and operators\n\n|\u003cdiv style=\"width:120px\"\u003eField\u003c/div\u003e |Description |Supported operators |\n|---|---|---|\n|`applicationId` |An identifier representing the application where the LaunchDarkly SDK is running. |`equals`, `notEquals`, `anyOf` |\n|`id` |Unique identifier for the context instance. |`equals`, `notEquals`, `anyOf` |\n|`kinds` |A list of all kinds found in the context instance. Supply a list of strings to the operator. |`equals`, `anyOf`, `contains` |\n|`kindKeys` |A list of all kinds and keys found in the context instance. The kind and key are joined with `:`, for example, `user:user-key-abc123`. Supply a list of strings to the operator. |`equals`, `anyOf`, `contains` |\n", + ) + + gen_CustomRolesResourceCmd := NewResourceCmd( + rootCmd, + analyticsTracker, + "custom-roles", + "Make requests (list, create, etc.) on custom roles", + "\u003e ### Custom roles is an Enterprise feature\n\u003e\n\u003e Custom roles is available to customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\nCustom roles allow you to create flexible policies providing fine-grained access control to everything in LaunchDarkly, from feature flags to goals, environments and teams. With custom roles, it's possible to enforce access policies that meet your exact workflow needs.\n\nThe custom roles API allows you to create, update and delete custom roles. You can also use the API to list all of your custom roles or get a custom role by ID.\n\nFor more information about custom roles and the syntax for custom role policies, read the product documentation for [Custom roles](https://docs.launchdarkly.com/home/members/custom-roles).\n", + ) + + gen_DataExportDestinationsResourceCmd := NewResourceCmd( + rootCmd, + analyticsTracker, + "data-export-destinations", + "Make requests (list, create, etc.) on data export destinations", + "\u003e ### Data Export is an add-on feature\n\u003e\n\u003e Data Export is available as an add-on for customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\nData Export provides a real-time export of raw analytics data, including feature flag requests, analytics events, custom events, and more.\n\nData Export destinations are locations that receive exported data. The Data Export destinations API allows you to configure destinations so that your data can be exported.\n\nSeveral of the endpoints in the Data Export destinations API require a Data Export destination ID. The Data Export destination ID is returned as part of the [Create a Data Export destination](/tag/Data-Export-destinations#operation/postDestination) and [List destinations](/tag/Data-Export-destinations#operation/getDestinations) responses. It is the `_id` field, or the `_id` field of each element in the `items` array.\n\nTo learn more, read [Data Export](https://docs.launchdarkly.com/home/data-export).\n", + ) + + gen_EnvironmentsResourceCmd := NewResourceCmd( + rootCmd, + analyticsTracker, + "environments", + "Make requests (list, create, etc.) on environments", + "Environments allow you to maintain separate rollout rules in different contexts, from local development to QA, staging, and production. With the LaunchDarkly Environments API, you can programmatically create, delete, and update environments. To learn more, read [Environments](https://docs.launchdarkly.com/home/organize/environments).\n", + ) + + gen_FlagTriggersResourceCmd := NewResourceCmd( + rootCmd, + analyticsTracker, + "flag-triggers", + "Make requests (list, create, etc.) on flag triggers", + "\u003e ### Flag triggers is an Enterprise feature\n\u003e\n\u003e Flag triggers is available to customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\nFlag triggers let you initiate flag changes remotely using a unique webhook URL. For example, you can integrate triggers with your existing tools to enable or disable flags when you hit specific operational health thresholds or receive certain alerts. To learn more, read [Flag triggers](https://docs.launchdarkly.com/home/feature-workflows/triggers).\n\nWith the flag triggers API, you can create, delete, and manage triggers.\n\nSeveral of the endpoints in the flag triggers API require a flag trigger ID. The flag trigger ID is returned as part of the [Create flag trigger](/tag/Flag-triggers#operation/createTriggerWorkflow) and [List flag triggers](/tag/Flag-triggers#operation/getTriggerWorkflows) responses. It is the `_id` field, or the `_id` field of each element in the `items` array.\n", + ) + + gen_FeatureFlagsResourceCmd := NewResourceCmd( + rootCmd, + analyticsTracker, + "flags", + "Make requests (list, create, etc.) on feature flags", + "The feature flags API allows you to list, create, modify, and delete feature flags, their statuses, and their expiring targets programmatically. For example, you can control percentage rollouts, target specific contexts, or even toggle off a feature flag programmatically.\n\n## Sample feature flag representation\n\nEvery feature flag has a set of top-level attributes, as well as an `environments` map containing the flag rollout and targeting rules specific to each environment. To learn more, read [Using feature flags](https://docs.launchdarkly.com/home/creating-flags).\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand an example of a \u003cstrong\u003ecomplete feature flag representation\u003c/strong\u003e\u003c/summary\u003e\n\n```json\n{\n \"name\": \"Alternate product page\",\n \"kind\": \"boolean\",\n \"description\": \"This is a description\",\n \"key\": \"alternate.page\",\n \"_version\": 2,\n \"creationDate\": 1418684722483,\n \"includeInSnippet\": true,\n \"clientSideAvailability\" {\n \"usingMobileKey\": false,\n \"usingEnvironmentId\": true,\n },\n \"variations\": [\n {\n \"value\": true,\n \"name\": \"true\",\n \"_id\": \"86208e6e-468f-4425-b334-7f318397f95c\"\n },\n {\n \"value\": false,\n \"name\": \"false\",\n \"_id\": \"7b32de80-f346-4276-bb77-28dfa7ddc2d8\"\n }\n ],\n \"variationJsonSchema\": null,\n \"defaults\": {\n \"onVariation\": 0,\n \"offVariation\": 1\n },\n \"temporary\": false,\n \"tags\": [\"ops\", \"experiments\"],\n \"_links\": {\n \"parent\": {\n \"href\": \"/api/v2/flags/default\",\n \"type\": \"application/json\"\n },\n \"self\": {\n \"href\": \"/api/v2/flags/default/alternate.page\",\n \"type\": \"application/json\"\n }\n },\n \"maintainerId\": \"548f6741c1efad40031b18ae\",\n \"_maintainer\": {\n \"_links\": {\n \"self\": {\n \"href\": \"/api/v2/members/548f6741c1efad40031b18ae\",\n \"type\": \"application/json\"\n }\n },\n \"_id\": \"548f6741c1efad40031b18ae\",\n \"firstName\": \"Ariel\",\n \"lastName\": \"Flores\",\n \"role\": \"reader\",\n \"email\": \"ariel@acme.com\"\n },\n \"goalIds\": [],\n \"experiments\": {\n \"baselineIdx\": 0,\n \"items\": []\n },\n \"environments\": {\n \"production\": {\n \"on\": true,\n \"archived\": false,\n \"salt\": \"YWx0ZXJuYXRlLnBhZ2U=\",\n \"sel\": \"45501b9314dc4641841af774cb038b96\",\n \"lastModified\": 1469326565348,\n \"version\": 61,\n \"targets\": [{\n \"values\": [\"user-key-123abc\"],\n \"variation\": 0,\n \"contextKind\": \"user\"\n }],\n \"contextTargets\": [{\n \"values\": [],\n \"variation\": 0,\n \"contextKind\": \"user\"\n }, {\n \"values\": [\"org-key-123abc\"],\n \"variation\": 0,\n \"contextKind\": \"organization\"\n }],\n \"rules\": [\n {\n \"_id\": \"f3ea72d0-e473-4e8b-b942-565b790ffe18\",\n \"variation\": 0,\n \"clauses\": [\n {\n \"_id\": \"6b81968e-3744-4416-9d64-74547eb0a7d1\",\n \"attribute\": \"groups\",\n \"op\": \"in\",\n \"values\": [\"Top Customers\"],\n \"contextKind\": \"user\",\n \"negate\": false\n },\n {\n \"_id\": \"9d60165d-82b8-4b9a-9136-f23407ba1718\",\n \"attribute\": \"email\",\n \"op\": \"endsWith\",\n \"values\": [\"gmail.com\"],\n \"contextKind\": \"user\",\n \"negate\": false\n }\n ],\n \"trackEvents\": false,\n \"ref\": \"73257308-472b-4d9c-a556-10aa7adbf857\"\n }\n ],\n \"fallthrough\": {\n \"rollout\": {\n \"variations\": [\n {\n \"variation\": 0,\n \"weight\": 60000\n },\n {\n \"variation\": 1,\n \"weight\": 40000\n }\n ],\n \"contextKind\": \"user\"\n }\n },\n \"offVariation\": 1,\n \"prerequisites\": [],\n \"_site\": {\n \"href\": \"/default/production/features/alternate.page\",\n \"type\": \"text/html\"\n },\n \"_environmentName\": \"Production\",\n \"trackEvents\": false,\n \"trackEventsFallthrough\": false,\n \"_summary\": {\n \"variations\": {\n \"0\": {\n \"rules\": 1,\n \"nullRules\": 0,\n \"targets\": 2,\n \"rollout\": 60000\n },\n \"1\": {\n \"rules\": 0,\n \"nullRules\": 0,\n \"targets\": 0,\n \"isOff\": true,\n \"rollout\": 40000\n }\n },\n \"prerequisites\": 0\n }\n }\n}\n```\n\n\u003c/details\u003e\n\n## Anatomy of a feature flag\n\nThis section describes the sample feature flag representation in more detail.\n\n### Top-level attributes\n\nMost of the top-level attributes have a straightforward interpretation, for example `name` and `description`.\n\nThe `variations` array represents the different variation values that a feature flag has. For a boolean flag, there are two variations: `true` and `false`. Multivariate flags have more variation values, and those values could be any JSON type: numbers, strings, objects, or arrays. In targeting rules, the variations are referred to by their index into this array.\n\nTo update these attributes, read [Update feature flag](#operation/patchFeatureFlag), especially the instructions for **updating flag settings**.\n\n### Per-environment configurations\n\nEach entry in the `environments` map contains a JSON object that represents the environment-specific flag configuration data available in the flag's Targeting tab. To learn more, read [Targeting with flags](https://docs.launchdarkly.com/home/targeting-flags).\n\nTo update per-environment information for a flag, read [Update feature flag](#operation/patchFeatureFlag), especially the instructions for **turning flags on and off** and **working with targeting and variations**.\n\n### Individual context targets\n\nThe `targets` and `contextTargets` arrays in the per-environment configuration data correspond to the individual context targeting on the Targeting tab. To learn more, read [Individual targeting](https://docs.launchdarkly.com/home/targeting-flags/individual-targeting).\n\nEach object in the `targets` and `contextTargets` arrays represents a list of context keys assigned to a particular variation. The `targets` array includes contexts with `contextKind` of \"user\" and the `contextTargets` array includes contexts with context kinds other than \"user.\"\n\nFor example:\n\n```json\n{\n ...\n \"environments\" : {\n \"production\" : {\n ...\n \"targets\": [\n {\n \"values\": [\"user-key-123abc\"],\n \"variation\": 0,\n \"contextKind\": \"user\"\n }\n ],\n \"contextTargets\": [\n {\n \"values\": [\"org-key-123abc\"],\n \"variation\": 0,\n \"contextKind\": \"organization\"\n }\n ]\n }\n }\n}\n```\n\nThe `targets` array means that any user context instance with the key `user-key-123abc` receives the first variation listed in the `variations` array. The `contextTargets` array means that any organization context with the key `org-key-123abc` receives the first variation listed in the `variations` array. Recall that the variations are stored at the top level of the flag JSON in an array, and the per-environment configuration rules point to indexes into this array. If this is a boolean flag, both contexts are receiving the `true` variation.\n\n### Targeting rules\n\nThe `rules` array corresponds to the rules section of the Targeting tab. This is where you can express complex rules on attributes with conditions and operators. For example, you might create a rule that specifies \"roll out the `true` variation to 80% of contexts whose email address ends with `gmail.com`\". To learn more, read [Creating targeting rules](https://docs.launchdarkly.com/home/targeting-flags/targeting-rules#creating-targeting-rules).\n\n### The fallthrough rule\n\nThe `fallthrough` object is a special rule that contains no conditions. It is the rollout strategy that is applied when none of the individual or custom targeting rules match. In the LaunchDarkly UI, it is called the \"Default rule.\"\n\n### The off variation\n\nThe off variation represents the variation to serve if the feature flag targeting is turned off, meaning the `on` attribute is `false`. For boolean flags, this is usually `false`. For multivariate flags, set the off variation to whatever variation represents the control or baseline behavior for your application. If you don't set the off variation, LaunchDarkly will serve the fallback value defined in your code.\n\n### Percentage rollouts\n\nWhen you work with targeting rules and with the default rule, you can specify either a single variation or a percentage rollout. The `weight` attribute defines the percentage rollout for each variation. Weights range from 0 (a 0% rollout) to 100000 (a 100% rollout). The weights are scaled by a factor of 1000 so that fractions of a percent can be represented without using floating-point. For example, a weight of `60000` means that 60% of contexts will receive that variation. The sum of weights across all variations should be 100%.\n", + ) + + gen_FollowFlagsResourceCmd := NewResourceCmd( + rootCmd, + analyticsTracker, + "follow-flags", + "Make requests (list, create, etc.) on follow flags", + "Follow flags to receive email updates about targeting changes to a flag in a project and environment.\n\nSeveral of the endpoints in the follow flags API require a member ID. The member ID is returned as part of the [Invite new members](/tag/Account-members#operation/postMembers) and [List account members](/tag/Account-members#operation/getMembers) responses. It is the `_id` field of each element in the `items` array.\n", + ) + + gen_IntegrationAuditLogSubscriptionsResourceCmd := NewResourceCmd( + rootCmd, + analyticsTracker, + "integration-audit-log-subscriptions", + "Make requests (list, create, etc.) on integration audit log subscriptions", + "Audit log integration subscriptions allow you to send audit log events hooks to one of dozens of external tools. For example, you can send flag change event webhooks to external third party software. To learn more, read [Building your own integrations](https://docs.launchdarkly.com/integrations/building-integrations#building-your-own-integrations).\n\nYou can use the integration subscriptions API to create, delete, and manage your integration audit log subscriptions.\n\nEach of these operations requires an `integrationKey` that refers to the type of integration. The required `config` fields to create a subscription vary depending on the `integrationKey`. You can find a full list of the fields for each integration below.\n\nSeveral of these operations require a subscription ID. The subscription ID is returned as part of the [Create audit log subscription](/tag/Integration-audit-log-subscriptions#operation/createSubscription) and [Get audit log subscriptions by integration](/tag/Integration-audit-log-subscriptions#operation/getSubscriptions) responses. It is the `_id` field, or the `_id` field of each element in the `items` array.\n\n### Configuration bodies by integrationKey\n\n#### datadog\n\n`apiKey` is a sensitive value.\n\n`hostURL` must evaluate to either `\"https://api.datadoghq.com\"` or `\"https://api.datadoghq.eu\"` and will default to the former if not explicitly defined.\n\n```\n\"config\": {\n \"apiKey\": \u003cstring, optional\u003e, # sensitive value\n \"hostURL\": \u003cstring, optional\u003e\n}\n```\n\n#### dynatrace\n\n`apiToken` is a sensitive value.\n\n`entity` must evaluate to one of the following fields and will default to `\"APPLICATION\"` if not explicitly defined:\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand list of fields\u003c/summary\u003e\n\u003cbr\u003e\n\"APPLICATION\"\u003cbr\u003e\n\"APPLICATION_METHOD\"\u003cbr\u003e\n\"APPLICATION_METHOD_GROUP\"\u003cbr\u003e\n\"AUTO_SCALING_GROUP\"\u003cbr\u003e\n\"AUXILIARY_SYNTHETIC_TEST\"\u003cbr\u003e\n\"AWS_APPLICATION_LOAD_BALANCER\"\u003cbr\u003e\n\"AWS_AVAILABILITY_ZONE\"\u003cbr\u003e\n\"AWS_CREDENTIALS\"\u003cbr\u003e\n\"AWS_LAMBDA_FUNCTION\"\u003cbr\u003e\n\"AWS_NETWORK_LOAD_BALANCER\"\u003cbr\u003e\n\"AZURE_API_MANAGEMENT_SERVICE\"\u003cbr\u003e\n\"AZURE_APPLICATION_GATEWAY\"\u003cbr\u003e\n\"AZURE_COSMOS_DB\"\u003cbr\u003e\n\"AZURE_CREDENTIALS\"\u003cbr\u003e\n\"AZURE_EVENT_HUB\"\u003cbr\u003e\n\"AZURE_EVENT_HUB_NAMESPACE\"\u003cbr\u003e\n\"AZURE_FUNCTION_APP\"\u003cbr\u003e\n\"AZURE_IOT_HUB\"\u003cbr\u003e\n\"AZURE_LOAD_BALANCER\"\u003cbr\u003e\n\"AZURE_MGMT_GROUP\"\u003cbr\u003e\n\"AZURE_REDIS_CACHE\"\u003cbr\u003e\n\"AZURE_REGION\"\u003cbr\u003e\n\"AZURE_SERVICE_BUS_NAMESPACE\"\u003cbr\u003e\n\"AZURE_SERVICE_BUS_QUEUE\"\u003cbr\u003e\n\"AZURE_SERVICE_BUS_TOPIC\"\u003cbr\u003e\n\"AZURE_SQL_DATABASE\"\u003cbr\u003e\n\"AZURE_SQL_ELASTIC_POOL\"\u003cbr\u003e\n\"AZURE_SQL_SERVER\"\u003cbr\u003e\n\"AZURE_STORAGE_ACCOUNT\"\u003cbr\u003e\n\"AZURE_SUBSCRIPTION\"\u003cbr\u003e\n\"AZURE_TENANT\"\u003cbr\u003e\n\"AZURE_VM\"\u003cbr\u003e\n\"AZURE_VM_SCALE_SET\"\u003cbr\u003e\n\"AZURE_WEB_APP\"\u003cbr\u003e\n\"CF_APPLICATION\"\u003cbr\u003e\n\"CF_FOUNDATION\"\u003cbr\u003e\n\"CINDER_VOLUME\"\u003cbr\u003e\n\"CLOUD_APPLICATION\"\u003cbr\u003e\n\"CLOUD_APPLICATION_INSTANCE\"\u003cbr\u003e\n\"CLOUD_APPLICATION_NAMESPACE\"\u003cbr\u003e\n\"CONTAINER_GROUP\"\u003cbr\u003e\n\"CONTAINER_GROUP_INSTANCE\"\u003cbr\u003e\n\"CUSTOM_APPLICATION\"\u003cbr\u003e\n\"CUSTOM_DEVICE\"\u003cbr\u003e\n\"CUSTOM_DEVICE_GROUP\"\u003cbr\u003e\n\"DCRUM_APPLICATION\"\u003cbr\u003e\n\"DCRUM_SERVICE\"\u003cbr\u003e\n\"DCRUM_SERVICE_INSTANCE\"\u003cbr\u003e\n\"DEVICE_APPLICATION_METHOD\"\u003cbr\u003e\n\"DISK\"\u003cbr\u003e\n\"DOCKER_CONTAINER_GROUP_INSTANCE\"\u003cbr\u003e\n\"DYNAMO_DB_TABLE\"\u003cbr\u003e\n\"EBS_VOLUME\"\u003cbr\u003e\n\"EC2_INSTANCE\"\u003cbr\u003e\n\"ELASTIC_LOAD_BALANCER\"\u003cbr\u003e\n\"ENVIRONMENT\"\u003cbr\u003e\n\"EXTERNAL_SYNTHETIC_TEST_STEP\"\u003cbr\u003e\n\"GCP_ZONE\"\u003cbr\u003e\n\"GEOLOCATION\"\u003cbr\u003e\n\"GEOLOC_SITE\"\u003cbr\u003e\n\"GOOGLE_COMPUTE_ENGINE\"\u003cbr\u003e\n\"HOST\"\u003cbr\u003e\n\"HOST_GROUP\"\u003cbr\u003e\n\"HTTP_CHECK\"\u003cbr\u003e\n\"HTTP_CHECK_STEP\"\u003cbr\u003e\n\"HYPERVISOR\"\u003cbr\u003e\n\"KUBERNETES_CLUSTER\"\u003cbr\u003e\n\"KUBERNETES_NODE\"\u003cbr\u003e\n\"MOBILE_APPLICATION\"\u003cbr\u003e\n\"NETWORK_INTERFACE\"\u003cbr\u003e\n\"NEUTRON_SUBNET\"\u003cbr\u003e\n\"OPENSTACK_PROJECT\"\u003cbr\u003e\n\"OPENSTACK_REGION\"\u003cbr\u003e\n\"OPENSTACK_VM\"\u003cbr\u003e\n\"OS\"\u003cbr\u003e\n\"PROCESS_GROUP\"\u003cbr\u003e\n\"PROCESS_GROUP_INSTANCE\"\u003cbr\u003e\n\"RELATIONAL_DATABASE_SERVICE\"\u003cbr\u003e\n\"SERVICE\"\u003cbr\u003e\n\"SERVICE_INSTANCE\"\u003cbr\u003e\n\"SERVICE_METHOD\"\u003cbr\u003e\n\"SERVICE_METHOD_GROUP\"\u003cbr\u003e\n\"SWIFT_CONTAINER\"\u003cbr\u003e\n\"SYNTHETIC_LOCATION\"\u003cbr\u003e\n\"SYNTHETIC_TEST\"\u003cbr\u003e\n\"SYNTHETIC_TEST_STEP\"\u003cbr\u003e\n\"VIRTUALMACHINE\"\u003cbr\u003e\n\"VMWARE_DATACENTER\"\n\u003c/details\u003e\n\n```\n\"config\": {\n \"apiToken\": \u003cstring, required\u003e,\n \"url\": \u003cstring, required\u003e,\n \"entity\": \u003cstring, optional\u003e\n}\n```\n\n#### elastic\n\n`token` is a sensitive field.\n\n```\n\"config\": {\n \"url\": \u003cstring, required\u003e,\n \"token\": \u003cstring, required\u003e,\n \"index\": \u003cstring, required\u003e\n}\n```\n\n#### honeycomb\n\n`apiKey` is a sensitive field.\n\n```\n\"config\": {\n \"datasetName\": \u003cstring, required\u003e,\n \"apiKey\": \u003cstring, required\u003e\n}\n```\n\n#### logdna\n\n`ingestionKey` is a sensitive field.\n\n```\n\"config\": {\n \"ingestionKey\": \u003cstring, required\u003e,\n \"level\": \u003cstring, optional\u003e\n}\n```\n\n#### msteams\n\n```\n\"config\": {\n \"url\": \u003cstring, required\u003e\n}\n```\n\n#### new-relic-apm\n\n`apiKey` is a sensitive field.\n\n`domain` must evaluate to either `\"api.newrelic.com\"` or `\"api.eu.newrelic.com\"` and will default to the former if not explicitly defined.\n\n```\n\"config\": {\n \"apiKey\": \u003cstring, required\u003e,\n \"applicationId\": \u003cstring, required\u003e,\n \"domain\": \u003cstring, optional\u003e\n}\n```\n\n#### signalfx\n\n`accessToken` is a sensitive field.\n\n```\n\"config\": {\n \"accessToken\": \u003cstring, required\u003e,\n \"realm\": \u003cstring, required\u003e\n}\n```\n\n#### splunk\n\n`token` is a sensitive field.\n\n```\n\"config\": {\n \"base-url\": \u003cstring, required\u003e,\n \"token\": \u003cstring, required\u003e,\n \"skip-ca-verificiation\": \u003cboolean, required\u003e\n}\n```\n", + ) + + gen_MembersResourceCmd := NewResourceCmd( + rootCmd, + analyticsTracker, + "members", + "Make requests (list, create, etc.) on members", + "The account members API allows you to invite new members to an account by making a `POST` request to `/api/v2/members`. When you invite a new member to an account, an invitation is sent to the email you provided. Members with \"admin\" or \"owner\" roles may create new members, as well as anyone with a \"createMember\" permission for \"member/\\*\". To learn more, read [LaunchDarkly account members](https://docs.launchdarkly.com/home/members/managing).\n\nAny member may request the complete list of account members with a `GET` to `/api/v2/members`.\n\nValid built-in role names that you can provide for the `role` field include `reader`, `writer`, `admin`, `owner/admin`, and `no_access`. To learn more about built-in roles, read [LaunchDarkly's built-in roles](https://docs.launchdarkly.com/home/members/built-in-roles).\n\nSeveral of the endpoints in the account members API require a member ID. The member ID is returned as part of the [Invite new members](/tag/Account-members#operation/postMembers) and [List account members](/tag/Account-members#operation/getMembers) responses. It is the `_id` field of each element in the `items` array.\n", + ) + + gen_MetricsResourceCmd := NewResourceCmd( + rootCmd, + analyticsTracker, + "metrics", + "Make requests (list, create, etc.) on metrics", + "\u003e ### Available for Pro and Enterprise plans\n\u003e\n\u003e Metrics is available to customers on a Pro or Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To add metrics to your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\nMetrics track flag behavior over time when an experiment is running. The data generated from experiments gives you more insight into the impact of a particular flag. To learn more, read [Metrics](https://docs.launchdarkly.com/home/metrics).\n\nUsing the metrics API, you can create, delete, and manage metrics.\n\n\u003e ### Are you importing metric events?\n\u003e\n\u003e If you want to import metric events into LaunchDarkly from an existing data source, use the metric import API. To learn more, read [Importing metric events](/home/metrics/import-metric-events).\n\n\u003e ### Metric keys and event keys are different\n\u003e\n\u003e LaunchDarkly automatically generates a metric key when you create a metric. You can use the metric key to identify the metric in API calls.\n\u003e\n\u003e Custom conversion/binary and custom numeric metrics also require an event key. You can set the event key to anything you want. Adding this event key to your codebase lets your SDK track actions customers take in your app as events. To learn more, read [Sending custom events](https://docs.launchdarkly.com/sdk/features/events).\n", + ) + + gen_Oauth2ClientsResourceCmd := NewResourceCmd( + rootCmd, + analyticsTracker, + "oauth-2-clients", + "Make requests (list, create, etc.) on oauth2 clients", + "The OAuth2 client API allows you to register a LaunchDarkly OAuth client for use in your own custom integrations. Registering a LaunchDarkly OAuth client allows you to use LaunchDarkly as an identity provider so that account members can log into your application with their LaunchDarkly account.\n\nYou can create and manage LaunchDarkly OAuth clients using the LaunchDarkly OAuth client API. This API acknowledges creation of your client with a response containing a one-time, unique `_clientSecret`. If you lose your client secret, you will have to register a new client. LaunchDarkly does not store client secrets in plain text.\n\nSeveral of the endpoints in the OAuth2 client API require an OAuth client ID. The OAuth client ID is returned as part of the [Create a LaunchDarkly OAuth 2.0 client](/tag/OAuth2-Clients#operation/createOAuth2Client) and [Get clients](/tag/OAuth2-Clients#operation/getOAuthClients) responses. It is the `_clientId` field, or the `_clientId` field of each element in the `items` array.\n\nYou must have _Admin_ privileges or an access token created by a member with _Admin_ privileges in order to be able to use this feature.\n\nPlease note that `redirectUri`s must be absolute URIs that conform to the https URI scheme. If you wish to register a client with a different URI scheme, please contact LaunchDarkly Support.\n", + ) + + gen_OtherResourceCmd := NewResourceCmd( + rootCmd, + analyticsTracker, + "other", + "Make requests (list, create, etc.) on other", + "Other requests available in the LaunchDarkly API. \n", + ) + + gen_ProjectsResourceCmd := NewResourceCmd( + rootCmd, + analyticsTracker, + "projects", + "Make requests (list, create, etc.) on projects", + "Projects allow you to manage multiple different software projects under one LaunchDarkly account. Each project has its own unique set of environments and feature flags. To learn more, read [Projects](https://docs.launchdarkly.com/home/organize/projects).\n\nUsing the projects API, you can create, destroy, and manage projects.\n", + ) + + gen_RelayProxyConfigurationsResourceCmd := NewResourceCmd( + rootCmd, + analyticsTracker, + "relay-proxy-configurations", + "Make requests (list, create, etc.) on relay proxy configurations", + "\n\u003e ### Relay Proxy automatic configuration is an Enterprise feature\n\u003e\n\u003e Relay Proxy automatic configuration is available to customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\nThe Relay Proxy automatic configuration API provides access to all resources related to relay tokens. To learn more, read [Automatic configuration](https://docs.launchdarkly.com/home/relay-proxy/automatic-configuration).\n\nSeveral of the endpoints in the Relay Proxy automatic configuration API require a configuration ID. The Relay Proxy configuration ID is returned as part of the [Create a new Relay Proxy config](/tag/Relay-Proxy-configurations#operation/postRelayAutoConfig) and [List Relay Proxy configs](/tag/Relay-Proxy-configurations#operation/getRelayProxyConfigs) responses. It is the `_id` field, or the `_id` field of each element in the `items` array.\n", + ) + + gen_ScheduledChangesResourceCmd := NewResourceCmd( + rootCmd, + analyticsTracker, + "scheduled-changes", + "Make requests (list, create, etc.) on scheduled changes", + "\u003e ### Scheduled flag changes is an Enterprise feature\n\u003e\n\u003e Scheduled flag changes is available to customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\nSchedule the specified flag targeting changes to take effect at the selected time. You may schedule multiple changes for a flag each with a different `ExecutionDate`. To learn more, read [Scheduled flag changes](https://docs.launchdarkly.com/home/feature-workflows/scheduled-changes).\n\nSeveral of the endpoints in the scheduled changes API require a scheduled change ID. The scheduled change ID is returned as part of the [Create scheduled changes workflow](/tag/Scheduled-changes#operation/postFlagConfigScheduledChanges) and [List scheduled changes](/tag/Scheduled-changes#operation/getFlagConfigScheduledChanges) responses. It is the `_id` field, or the `_id` field of each element in the `items` array.\n", + ) + + gen_SegmentsResourceCmd := NewResourceCmd( + rootCmd, + analyticsTracker, + "segments", + "Make requests (list, create, etc.) on segments", + "\n\u003e ### Synced segments and larger list-based segments are an Enterprise feature\n\u003e\n\u003e This section documents endpoints for rule-based, list-based, and synced segments.\n\u003e\n\u003e A \"big segment\" is a segment that is either a synced segment, or a list-based segment with more than 15,000 entries that includes only one targeted context kind. LaunchDarkly uses different implementations for different types of segments so that all of your segments have good performance.\n\u003e\n\u003e In the segments API, a big segment is indicated by the `unbounded` field being set to `true`.\n\u003e\n\u003e These segments are available to customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\nSegments are groups of contexts that you can use to manage flag targeting behavior in bulk. LaunchDarkly supports:\n\n* rule-based segments, which let you target groups of contexts individually or by attribute,\n* list-based segments, which let you target individual contexts or uploaded lists of contexts, and\n* synced segments, which let you target groups of contexts backed by an external data store.\n\nTo learn more, read [Segments](https://docs.launchdarkly.com/home/segments).\n\nThe segments API allows you to list, create, modify, and delete segments programmatically.\n\nYou can find other APIs for working with big segments under [Segments (beta)](/tag/Segments-(beta)) and [Integrations (beta)](/tag/Integrations-(beta)).\n", + ) + + gen_TagsResourceCmd := NewResourceCmd( + rootCmd, + analyticsTracker, + "tags", + "Make requests (list, create, etc.) on tags", + "Tags are simple strings that you can attach to most resources in LaunchDarkly. Tags are useful for grouping resources into a set that you can name in a resource specifier. To learn more, read [Custom role concepts](https://docs.launchdarkly.com/home/members/role-concepts#tags).\n\nUsing the tags API, you can list existing tags for resources.\n", + ) + gen_TeamsResourceCmd := NewResourceCmd( rootCmd, analyticsTracker, @@ -20,203 +188,4875 @@ func AddAllResourceCmds(rootCmd *cobra.Command, client resources.Client, analyti "\u003e ### Teams is an Enterprise feature\n\u003e\n\u003e Teams is available to customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\nA team is a group of members in your LaunchDarkly account. A team can have maintainers who are able to add and remove team members. It also can have custom roles assigned to it that allows shared access to those roles for all team members. To learn more, read [Teams](https://docs.launchdarkly.com/home/teams).\n\nThe Teams API allows you to create, read, update, and delete a team.\n\nSeveral of the endpoints in the Teams API require one or more member IDs. The member ID is returned as part of the [List account members](/tag/Account-members#operation/getMembers) response. It is the `_id` field of each element in the `items` array.\n", ) + gen_TokensResourceCmd := NewResourceCmd( + rootCmd, + analyticsTracker, + "tokens", + "Make requests (list, create, etc.) on tokens", + "The access tokens API allows you to list, create, modify, and delete access tokens programmatically. \n\nWhen using access tokens to manage access tokens, the following restrictions apply:\n- Personal tokens can see all service tokens and other personal tokens created by the same team member. If the personal token has the \"Admin\" role, it may also see other member's personal tokens. To learn more, read [Personal tokens](https://docs.launchdarkly.com/home/account-security/api-access-tokens#personal-tokens).\n- Service tokens can see all service tokens. If the token has the \"Admin\" role, it may also see all personal tokens. To learn more, read [Service tokens](https://docs.launchdarkly.com/home/account-security/api-access-tokens#service-tokens).\n- Tokens can only manage other tokens, including themselves, if they have \"Admin\" role or explicit permission via a custom role. To learn more, read [Personal access token actions](https://docs.launchdarkly.com/home/team/role-actions#personal-access-token-actions).\n\nSeveral of the endpoints in the access tokens API require an access token ID. The access token ID is returned as part of the [Create access token](/tag/Access-tokens#operation/resetToken) and [List access tokens](/tag/Access-tokens#operation/getTokens) responses. It is the `_id` field, or the `_id` field of each element in the `items` array. \n\nTo learn more about access tokens, read [API access tokens](https://docs.launchdarkly.com/home/account-security/api-access-tokens).\n", + ) + + gen_UserFlagSettingsResourceCmd := NewResourceCmd( + rootCmd, + analyticsTracker, + "user-flag-settings", + "Make requests (list, create, etc.) on user flag settings", + "\u003e ### Contexts are now available\n\u003e\n\u003e After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use [Contexts](/tag/Contexts) instead of the user settings API. To learn more, read [Contexts](https://docs.launchdarkly.com/home/contexts).\n\nLaunchDarkly's user settings API provides a picture of all feature flags and their current values for a specific user. This gives you instant visibility into how a particular user experiences your site or application. To learn more, read [Viewing and managing users](https://docs.launchdarkly.com/home/users/attributes#viewing-and-managing-users).\n\nYou can also use the user settings API to assign a user to a specific variation for any feature flag.\n", + ) + + gen_UsersResourceCmd := NewResourceCmd( + rootCmd, + analyticsTracker, + "users", + "Make requests (list, create, etc.) on users", + "\u003e ### Contexts are now available\n\u003e\n\u003e After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use [Contexts](/tag/Contexts) instead of these endpoints. To learn more, read [Contexts](https://docs.launchdarkly.com/home/contexts).\n\n\nLaunchDarkly creates a record for each user passed in to `variation` calls. This record powers the autocomplete functionality on the feature flag dashboard, as well as the Users page. To learn more, read [Users and user segments](https://docs.launchdarkly.com/home/users).\n\nLaunchDarkly also offers an API that lets you tap into this data. You can use the users API to see what user data is available to LaunchDarkly, as well as determine which flag values a user will receive. You can also explicitly set which flag value a user will receive via this API.\n\nUsers are always scoped within a project and environment. In other words, each environment has its own set of user records.\n", + ) + + gen_WebhooksResourceCmd := NewResourceCmd( + rootCmd, + analyticsTracker, + "webhooks", + "Make requests (list, create, etc.) on webhooks", + "The webhooks API lets you build your own integrations that subscribe to activities in LaunchDarkly. When you generate an activity in LaunchDarkly, such as when you change a flag or you create a project, LaunchDarkly sends an HTTP POST payload to the webhook's URL. Use webhooks to update external issue trackers, update support tickets, notify customers of new feature rollouts, and more.\n\nSeveral of the endpoints in the webhooks API require a webhook ID. The webhook ID is returned as part of the [Creates a webhook](/tag/Webhooks#operation/postWebhook) and [List webhooks](/tag/Webhooks#operation/getAllWebhooks) responses. It is the `_id` field, or the `_id` field of each element in the `items` array.\n\n## Designating the payload\n\nThe webhook payload is identical to an audit log entry. To learn more, read [Get audit log entry](/tag/Audit-log#operation/getAuditLogEntry).\n\nHere's a sample payload:\n\n\u003e ### Webhook delivery order\n\u003e\n\u003e Webhooks may not be delivered in chronological order. We recommend using the payload's \"date\" field as a timestamp to reorder webhooks as they are received.\n\n```json\n{\n \"_links\": {\n \"canonical\": {\n \"href\": \"/api/v2/projects/alexis/environments/test\",\n \"type\": \"application/json\"\n },\n \"parent\": {\n \"href\": \"/api/v2/auditlog\",\n \"type\": \"application/json\"\n },\n \"self\": {\n \"href\": \"/api/v2/auditlog/57c0a8e29969090743529965\",\n \"type\": \"application/json\"\n },\n \"site\": {\n \"href\": \"/settings#/projects\",\n \"type\": \"text/html\"\n }\n },\n \"_id\": \"57c0a8e29969090743529965\",\n \"date\": 1472243938774,\n \"accesses\": [\n {\n \"action\": \"updateName\",\n \"resource\": \"proj/alexis:env/test\"\n }\n ],\n \"kind\": \"environment\",\n \"name\": \"Testing\",\n \"description\": \"- Changed the name from ~~Test~~ to *Testing*\",\n \"member\": {\n \"_links\": {\n \"parent\": {\n \"href\": \"/internal/account/members\",\n \"type\": \"application/json\"\n },\n \"self\": {\n \"href\": \"/internal/account/members/548f6741c1efad40031b18ae\",\n \"type\": \"application/json\"\n }\n },\n \"_id\": \"548f6741c1efad40031b18ae\",\n \"email\": \"ariel@acme.com\",\n \"firstName\": \"Ariel\",\n \"lastName\": \"Flores\"\n },\n \"titleVerb\": \"changed the name of\",\n \"title\": \"[Ariel Flores](mailto:ariel@acme.com) changed the name of [Testing](https://app.launchdarkly.com/settings#/projects)\",\n \"target\": {\n \"_links\": {\n \"canonical\": {\n \"href\": \"/api/v2/projects/alexis/environments/test\",\n \"type\": \"application/json\"\n },\n \"site\": {\n \"href\": \"/settings#/projects\",\n \"type\": \"text/html\"\n }\n },\n \"name\": \"Testing\",\n \"resources\": [\"proj/alexis:env/test\"]\n }\n}\n```\n\n## Signing the webhook\n\nOptionally, you can define a `secret` when you create a webhook. If you define the secret, the webhook `POST` request will include an `X-LD-Signature header`, whose value will contain an HMAC SHA256 hex digest of the webhook payload, using the `secret` as the key.\n\nCompute the signature of the payload using the same shared secret in your code to verify that the webhook was triggered by LaunchDarkly.\n\n## Understanding connection retries\n\nIf LaunchDarkly receives a non-`2xx` response to a webhook `POST`, it will retry the delivery one time. Webhook delivery is not guaranteed. If you build an integration on webhooks, make sure it is tolerant of delivery failures.\n", + ) + + gen_WorkflowTemplatesResourceCmd := NewResourceCmd( + rootCmd, + analyticsTracker, + "workflow-templates", + "Make requests (list, create, etc.) on workflow templates", + "\u003e ### Workflow templates is an Enterprise feature\n\u003e\n\u003e Workflow templates are available to customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\nWorkflow templates allow you to define a set of workflow stages that you can use as a starting point for new workflows. You can create these workflows for any flag in any environment and any project, and you can create as many workflows as you like from a given template.\n\nYou can create workflow templates in two ways:\n* by specifying the desired stages, using the `stages` property of the request body\n* by specifying an existing workflow to save as a template, using the `workflowId` property of the request body\n\nYou can use templates to create a workflow in any project, environment, or flag. However, when you create a template, you must specify a particular project, environment, and flag. This means that when you create a template using the `stages` property, you must also include `projectKey`, `environmentKey`, and `flagKey` properties in the request body. When you create a template from an existing workflow, it will use the project, environment, and flag of the existing workflow, so those properties can be omitted from the request body.\n\nTo learn more, read [Workflows documentation](https://docs.launchdarkly.com/home/feature-workflows/workflows) and [Workflows API documentation](https://apidocs.launchdarkly.com/tag/Workflows).\n", + ) + + gen_WorkflowsResourceCmd := NewResourceCmd( + rootCmd, + analyticsTracker, + "workflows", + "Make requests (list, create, etc.) on workflows", + "\u003e ### Workflows is an Enterprise feature\n\u003e\n\u003e Workflows is available to customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\nA workflow is a set of actions that you can schedule in advance to make changes to a feature flag at a future date and time. You can also include approval requests at different stages of a workflow. To learn more, read [Workflows](https://docs.launchdarkly.com/home/feature-workflows/workflows).\n\nThe actions supported are as follows:\n\n- Turning targeting `ON` or `OFF`\n- Setting the default variation\n- Adding targets to a given variation\n- Creating a rule to target by segment\n- Modifying the rollout percentage for rules\n\nYou can create multiple stages of a flag release workflow. Unique stages are defined by their conditions: either approvals and/or scheduled changes.\n\nSeveral of the endpoints in the workflows API require a workflow ID or one or more member IDs. The workflow ID is returned as part of the [Create workflow](/tag/Workflows#operation/postWorkflow) and [Get workflows](/tag/Workflows#operation/getWorkflows) responses. It is the `_id` field, or the `_id` field of each element in the `items` array. The member ID is returned as part of the [List account members](/tag/Account-members#operation/getMembers) response. It is the `_id` field of each element in the `items` array.\n", + ) + // Operation commands - NewOperationCmd(gen_TeamsResourceCmd, client, OperationData{ - Short: "Delete team", - Long: "Delete a team by key. To learn more, read [Deleting a team](https://docs.launchdarkly.com/home/teams/managing#deleting-a-team).", - Use: "delete-team", + NewOperationCmd(gen_ApprovalRequestsResourceCmd, client, OperationData{ + Short: "Delete approval request", + Long: "Delete an approval request.", + Use: "delete", Params: []Param{ { - Name: "team-key", + Name: "id", In: "path", - Description: "The team key", + Description: "The approval request ID", Type: "string", }, }, HTTPMethod: "DELETE", + HasBody: false, RequiresBody: false, - Path: "/api/v2/teams/{teamKey}", + Path: "/api/v2/approval-requests/{id}", SupportsSemanticPatch: false, }) - NewOperationCmd(gen_TeamsResourceCmd, client, OperationData{ - Short: "Get team", - Long: "Fetch a team by key.\n\n### Expanding the teams response\nLaunchDarkly supports four fields for expanding the \"Get team\" response. By default, these fields are **not** included in the response.\n\nTo expand the response, append the `expand` query parameter and add a comma-separated list with any of the following fields:\n\n* `members` includes the total count of members that belong to the team.\n* `roles` includes a paginated list of the custom roles that you have assigned to the team.\n* `projects` includes a paginated list of the projects that the team has any write access to.\n* `maintainers` includes a paginated list of the maintainers that you have assigned to the team.\n\nFor example, `expand=members,roles` includes the `members` and `roles` fields in the response.\n", - Use: "get-team", + NewOperationCmd(gen_ApprovalRequestsResourceCmd, client, OperationData{ + Short: "Delete approval request for a flag", + Long: "Delete an approval request for a feature flag.", + Use: "delete-for-flag", Params: []Param{ { - Name: "team-key", + Name: "project-key", In: "path", - Description: "The team key.", + Description: "The project key", Type: "string", }, { - Name: "expand", - In: "query", - Description: "A comma-separated list of properties that can reveal additional information in the response.", + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "id", + In: "path", + Description: "The feature flag approval request ID", Type: "string", }, }, - HTTPMethod: "GET", + HTTPMethod: "DELETE", + HasBody: false, RequiresBody: false, - Path: "/api/v2/teams/{teamKey}", + Path: "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{id}", SupportsSemanticPatch: false, }) - NewOperationCmd(gen_TeamsResourceCmd, client, OperationData{ - Short: "Get team maintainers", - Long: "Fetch the maintainers that have been assigned to the team. To learn more, read [Managing team maintainers](https://docs.launchdarkly.com/home/teams/managing#managing-team-maintainers).", - Use: "get-team-maintainers", + NewOperationCmd(gen_ApprovalRequestsResourceCmd, client, OperationData{ + Short: "Get approval request for a flag", + Long: "Get a single approval request for a feature flag.", + Use: "get-approval-for-flag", Params: []Param{ { - Name: "team-key", + Name: "project-key", In: "path", - Description: "The team key", + Description: "The project key", Type: "string", }, { - Name: "limit", - In: "query", - Description: "The number of maintainers to return in the response. Defaults to 20.", - Type: "integer", + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", }, { - Name: "offset", - In: "query", - Description: "Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.", - Type: "integer", + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "id", + In: "path", + Description: "The feature flag approval request ID", + Type: "string", }, }, HTTPMethod: "GET", + HasBody: false, RequiresBody: false, - Path: "/api/v2/teams/{teamKey}/maintainers", + Path: "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{id}", SupportsSemanticPatch: false, }) - NewOperationCmd(gen_TeamsResourceCmd, client, OperationData{ - Short: "Get team custom roles", - Long: "Fetch the custom roles that have been assigned to the team. To learn more, read [Managing team permissions](https://docs.launchdarkly.com/home/teams/managing#managing-team-permissions).", - Use: "get-team-roles", + NewOperationCmd(gen_ApprovalRequestsResourceCmd, client, OperationData{ + Short: "Get approval request", + Long: "Get an approval request by approval request ID.\n\n### Expanding approval response\n\nLaunchDarkly supports the `expand` query param to include additional fields in the response, with the following fields:\n\n- `flag` includes the flag the approval request belongs to\n- `project` includes the project the approval request belongs to\n- `environments` includes the environments the approval request relates to\n\nFor example, `expand=project,flag` includes the `project` and `flag` fields in the response.\n", + Use: "get", Params: []Param{ { - Name: "team-key", + Name: "id", In: "path", - Description: "The team key", + Description: "The approval request ID", Type: "string", }, { - Name: "limit", - In: "query", - Description: "The number of roles to return in the response. Defaults to 20.", - Type: "integer", - }, - { - Name: "offset", + Name: "expand", In: "query", - Description: "Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.", - Type: "integer", + Description: "A comma-separated list of fields to expand in the response. Supported fields are explained above.", + Type: "string", }, }, HTTPMethod: "GET", + HasBody: false, RequiresBody: false, - Path: "/api/v2/teams/{teamKey}/roles", + Path: "/api/v2/approval-requests/{id}", SupportsSemanticPatch: false, }) - NewOperationCmd(gen_TeamsResourceCmd, client, OperationData{ - Short: "List teams", - Long: "Return a list of teams.\n\nBy default, this returns the first 20 teams. Page through this list with the `limit` parameter and by following the `first`, `prev`, `next`, and `last` links in the `_links` field that returns. If those links do not appear, the pages they refer to don't exist. For example, the `first` and `prev` links will be missing from the response on the first page, because there is no previous page and you cannot return to the first page when you are already on the first page.\n\n### Filtering teams\n\nLaunchDarkly supports the following fields for filters:\n\n- `query` is a string that matches against the teams' names and keys. It is not case-sensitive.\n - A request with `query:abc` returns teams with the string `abc` in their name or key.\n- `nomembers` is a boolean that filters the list of teams who have 0 members\n - A request with `nomembers:true` returns teams that have 0 members\n - A request with `nomembers:false` returns teams that have 1 or more members\n\n### Expanding the teams response\nLaunchDarkly supports four fields for expanding the \"List teams\" response. By default, these fields are **not** included in the response.\n\nTo expand the response, append the `expand` query parameter and add a comma-separated list with any of the following fields:\n\n* `members` includes the total count of members that belong to the team.\n* `roles` includes a paginated list of the custom roles that you have assigned to the team.\n* `projects` includes a paginated list of the projects that the team has any write access to.\n* `maintainers` includes a paginated list of the maintainers that you have assigned to the team.\n\nFor example, `expand=members,roles` includes the `members` and `roles` fields in the response.\n", - Use: "get-teams", + NewOperationCmd(gen_ApprovalRequestsResourceCmd, client, OperationData{ + Short: "List approval requests", + Long: "Get all approval requests.\n\n### Filtering approvals\n\nLaunchDarkly supports the `filter` query param for filtering, with the following fields:\n\n- `notifyMemberIds` filters for only approvals that are assigned to a member in the specified list. For example: `filter=notifyMemberIds anyOf [\"memberId1\", \"memberId2\"]`.\n- `requestorId` filters for only approvals that correspond to the ID of the member who requested the approval. For example: `filter=requestorId equals 457034721476302714390214`.\n- `resourceId` filters for only approvals that correspond to the the specified resource identifier. For example: `filter=resourceId equals proj/my-project:env/my-environment:flag/my-flag`.\n- `reviewStatus` filters for only approvals which correspond to the review status in the specified list. The possible values are `approved`, `declined`, and `pending`. For example: `filter=reviewStatus anyOf [\"pending\", \"approved\"]`.\n- `status` filters for only approvals which correspond to the status in the specified list. The possible values are `pending`, `scheduled`, `failed`, and `completed`. For example: `filter=status anyOf [\"pending\", \"scheduled\"]`.\n\nYou can also apply multiple filters at once. For example, setting `filter=projectKey equals my-project, reviewStatus anyOf [\"pending\",\"approved\"]` matches approval requests which correspond to the `my-project` project key, and a review status of either `pending` or `approved`.\n\n### Expanding approval response\n\nLaunchDarkly supports the `expand` query param to include additional fields in the response, with the following fields:\n\n- `flag` includes the flag the approval request belongs to\n- `project` includes the project the approval request belongs to\n- `environments` includes the environments the approval request relates to\n\nFor example, `expand=project,flag` includes the `project` and `flag` fields in the response.\n", + Use: "list", Params: []Param{ { - Name: "limit", + Name: "filter", In: "query", - Description: "The number of teams to return in the response. Defaults to 20.", - Type: "integer", + Description: "A comma-separated list of filters. Each filter is of the form `field operator value`. Supported fields are explained above.", + Type: "string", }, { - Name: "offset", + Name: "expand", In: "query", - Description: "Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and returns the next `limit` items.", - Type: "integer", + Description: "A comma-separated list of fields to expand in the response. Supported fields are explained above.", + Type: "string", }, { - Name: "filter", + Name: "limit", In: "query", - Description: "A comma-separated list of filters. Each filter is constructed as `field:value`.", - Type: "string", + Description: "The number of approvals to return. Defaults to 20. Maximum limit is 200.", + Type: "integer", }, { - Name: "expand", + Name: "offset", In: "query", - Description: "A comma-separated list of properties that can reveal additional information in the response.", - Type: "string", + Description: "Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.", + Type: "integer", }, }, HTTPMethod: "GET", + HasBody: false, RequiresBody: false, - Path: "/api/v2/teams", + Path: "/api/v2/approval-requests", SupportsSemanticPatch: false, }) - NewOperationCmd(gen_TeamsResourceCmd, client, OperationData{ - Short: "Update team", - Long: "Perform a partial update to a team. Updating a team uses the semantic patch format.\n\nTo make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch).\n\n### Instructions\n\nSemantic patch requests support the following `kind` instructions for updating teams.\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand instructions for \u003cstrong\u003eupdating teams\u003c/strong\u003e\u003c/summary\u003e\n\n#### addCustomRoles\n\nAdds custom roles to the team. Team members will have these custom roles granted to them.\n\n##### Parameters\n\n- `values`: List of custom role keys.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"addCustomRoles\",\n \"values\": [ \"example-custom-role\" ]\n }]\n}\n```\n\n#### removeCustomRoles\n\nRemoves custom roles from the team. The app will no longer grant these custom roles to the team members.\n\n##### Parameters\n\n- `values`: List of custom role keys.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"removeCustomRoles\",\n \"values\": [ \"example-custom-role\" ]\n }]\n}\n```\n\n#### addMembers\n\nAdds members to the team.\n\n##### Parameters\n\n- `values`: List of member IDs to add.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"addMembers\",\n \"values\": [ \"1234a56b7c89d012345e678f\", \"507f1f77bcf86cd799439011\" ]\n }]\n}\n```\n\n#### removeMembers\n\nRemoves members from the team.\n\n##### Parameters\n\n- `values`: List of member IDs to remove.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"removeMembers\",\n \"values\": [ \"1234a56b7c89d012345e678f\", \"507f1f77bcf86cd799439011\" ]\n }]\n}\n```\n\n#### replaceMembers\n\nReplaces the existing members of the team with the new members.\n\n##### Parameters\n\n- `values`: List of member IDs of the new members.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"replaceMembers\",\n \"values\": [ \"1234a56b7c89d012345e678f\", \"507f1f77bcf86cd799439011\" ]\n }]\n}\n```\n\n#### addPermissionGrants\n\nAdds permission grants to members for the team. For example, a permission grant could allow a member to act as a team maintainer. A permission grant may have either an `actionSet` or a list of `actions` but not both at the same time. The members do not have to be team members to have a permission grant for the team.\n\n##### Parameters\n\n- `actionSet`: Name of the action set.\n- `actions`: List of actions.\n- `memberIDs`: List of member IDs.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"addPermissionGrants\",\n \"actions\": [ \"updateTeamName\", \"updateTeamDescription\" ],\n \"memberIDs\": [ \"1234a56b7c89d012345e678f\", \"507f1f77bcf86cd799439011\" ]\n }]\n}\n```\n\n#### removePermissionGrants\n\nRemoves permission grants from members for the team. A permission grant may have either an `actionSet` or a list of `actions` but not both at the same time. The `actionSet` and `actions` must match an existing permission grant.\n\n##### Parameters\n\n- `actionSet`: Name of the action set.\n- `actions`: List of actions.\n- `memberIDs`: List of member IDs.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"removePermissionGrants\",\n \"actions\": [ \"updateTeamName\", \"updateTeamDescription\" ],\n \"memberIDs\": [ \"1234a56b7c89d012345e678f\", \"507f1f77bcf86cd799439011\" ]\n }]\n}\n```\n\n#### updateDescription\n\nUpdates the description of the team.\n\n##### Parameters\n\n- `value`: The new description.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"updateDescription\",\n \"value\": \"Updated team description\"\n }]\n}\n```\n\n#### updateName\n\nUpdates the name of the team.\n\n##### Parameters\n\n- `value`: The new name.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"updateName\",\n \"value\": \"Updated team name\"\n }]\n}\n```\n\n\u003c/details\u003e\n\n### Expanding the teams response\nLaunchDarkly supports four fields for expanding the \"Update team\" response. By default, these fields are **not** included in the response.\n\nTo expand the response, append the `expand` query parameter and add a comma-separated list with any of the following fields:\n\n* `members` includes the total count of members that belong to the team.\n* `roles` includes a paginated list of the custom roles that you have assigned to the team.\n* `projects` includes a paginated list of the projects that the team has any write access to.\n* `maintainers` includes a paginated list of the maintainers that you have assigned to the team.\n\nFor example, `expand=members,roles` includes the `members` and `roles` fields in the response.\n", - Use: "patch-team", + NewOperationCmd(gen_ApprovalRequestsResourceCmd, client, OperationData{ + Short: "List approval requests for a flag", + Long: "Get all approval requests for a feature flag.", + Use: "list-approvals-for-flag", Params: []Param{ { - Name: "team-key", + Name: "project-key", In: "path", - Description: "The team key", + Description: "The project key", Type: "string", }, { - Name: "expand", - In: "query", - Description: "A comma-separated list of properties that can reveal additional information in the response. Supported fields are explained above.", + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", Type: "string", }, }, - HTTPMethod: "PATCH", + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_ApprovalRequestsResourceCmd, client, OperationData{ + Short: "Create approval request", + Long: "Create an approval request.\n\nThis endpoint currently supports creating an approval request for a flag across all environments with the following instructions:\n\n- `addVariation`\n- `removeVariation`\n- `updateVariation`\n- `updateDefaultVariation`\n\nFor details on using these instructions, read [Update feature flag](/tag/Feature-flags#operation/patchFeatureFlag).\n\nTo create an approval for a flag specific to an environment, use [Create approval request for a flag](/tag/Approvals#operation/postApprovalRequestForFlag).\n", + Use: "create", + Params: []Param{}, + HTTPMethod: "POST", + HasBody: true, RequiresBody: true, - Path: "/api/v2/teams/{teamKey}", - SupportsSemanticPatch: true, + Path: "/api/v2/approval-requests", + SupportsSemanticPatch: false, }) - NewOperationCmd(gen_TeamsResourceCmd, client, OperationData{ - Short: "Create team", - Long: "Create a team. To learn more, read [Creating a team](https://docs.launchdarkly.com/home/teams/creating).\n\n### Expanding the teams response\nLaunchDarkly supports four fields for expanding the \"Create team\" response. By default, these fields are **not** included in the response.\n\nTo expand the response, append the `expand` query parameter and add a comma-separated list with any of the following fields:\n\n* `members` includes the total count of members that belong to the team.\n* `roles` includes a paginated list of the custom roles that you have assigned to the team.\n* `projects` includes a paginated list of the projects that the team has any write access to.\n* `maintainers` includes a paginated list of the maintainers that you have assigned to the team.\n\nFor example, `expand=members,roles` includes the `members` and `roles` fields in the response.\n", - Use: "post-team", + NewOperationCmd(gen_ApprovalRequestsResourceCmd, client, OperationData{ + Short: "Apply approval request", + Long: "Apply an approval request that has been approved.", + Use: "create-apply", Params: []Param{ { - Name: "expand", - In: "query", - Description: "A comma-separated list of properties that can reveal additional information in the response. Supported fields are explained above.", + Name: "id", + In: "path", + Description: "The feature flag approval request ID", Type: "string", }, }, HTTPMethod: "POST", + HasBody: true, RequiresBody: true, - Path: "/api/v2/teams", + Path: "/api/v2/approval-requests/{id}/apply", SupportsSemanticPatch: false, }) - NewOperationCmd(gen_TeamsResourceCmd, client, OperationData{ - Short: "Add multiple members to team", - Long: "Add multiple members to an existing team by uploading a CSV file of member email addresses. Your CSV file must include email addresses in the first column. You can include data in additional columns, but LaunchDarkly ignores all data outside the first column. Headers are optional. To learn more, read [Managing team members](https://docs.launchdarkly.com/home/teams/managing#managing-team-members).\n\n**Members are only added on a `201` response.** A `207` indicates the CSV file contains a combination of valid and invalid entries. A `207` results in no members being added to the team.\n\nOn a `207` response, if an entry contains bad input, the `message` field contains the row number as well as the reason for the error. The `message` field is omitted if the entry is valid.\n\nExample `207` response:\n```json\n{\n \"items\": [\n {\n \"status\": \"success\",\n \"value\": \"new-team-member@acme.com\"\n },\n {\n \"message\": \"Line 2: empty row\",\n \"status\": \"error\",\n \"value\": \"\"\n },\n {\n \"message\": \"Line 3: email already exists in the specified team\",\n \"status\": \"error\",\n \"value\": \"existing-team-member@acme.com\"\n },\n {\n \"message\": \"Line 4: invalid email formatting\",\n \"status\": \"error\",\n \"value\": \"invalid email format\"\n }\n ]\n}\n```\n\nMessage | Resolution\n--- | ---\nEmpty row | This line is blank. Add an email address and try again.\nDuplicate entry | This email address appears in the file twice. Remove the email from the file and try again.\nEmail already exists in the specified team | This member is already on your team. Remove the email from the file and try again.\nInvalid formatting | This email address is not formatted correctly. Fix the formatting and try again.\nEmail does not belong to a LaunchDarkly member | The email address doesn't belong to a LaunchDarkly account member. Invite them to LaunchDarkly, then re-add them to the team.\n\nOn a `400` response, the `message` field may contain errors specific to this endpoint.\n\nExample `400` response:\n```json\n{\n \"code\": \"invalid_request\",\n \"message\": \"Unable to process file\"\n}\n```\n\nMessage | Resolution\n--- | ---\nUnable to process file | LaunchDarkly could not process the file for an unspecified reason. Review your file for errors and try again.\nFile exceeds 25mb | Break up your file into multiple files of less than 25mbs each.\nAll emails have invalid formatting | None of the email addresses in the file are in the correct format. Fix the formatting and try again.\nAll emails belong to existing team members | All listed members are already on this team. Populate the file with member emails that do not belong to the team and try again.\nFile is empty | The CSV file does not contain any email addresses. Populate the file and try again.\nNo emails belong to members of your LaunchDarkly organization | None of the email addresses belong to members of your LaunchDarkly account. Invite these members to LaunchDarkly, then re-add them to the team.\n", - Use: "post-team-members", + NewOperationCmd(gen_ApprovalRequestsResourceCmd, client, OperationData{ + Short: "Apply approval request for a flag", + Long: "Apply an approval request that has been approved.", + Use: "create-apply-for-flag", Params: []Param{ { - Name: "team-key", + Name: "project-key", In: "path", - Description: "The team key", + Description: "The project key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "id", + In: "path", + Description: "The feature flag approval request ID", Type: "string", }, }, HTTPMethod: "POST", + HasBody: true, RequiresBody: true, - Path: "/api/v2/teams/{teamKey}/members", + Path: "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{id}/apply", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_ApprovalRequestsResourceCmd, client, OperationData{ + Short: "Create approval request for a flag", + Long: "Create an approval request for a feature flag.", + Use: "create-for-flag", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + }, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_ApprovalRequestsResourceCmd, client, OperationData{ + Short: "Review approval request", + Long: "Review an approval request by approving or denying changes.", + Use: "create-review", + Params: []Param{ + { + Name: "id", + In: "path", + Description: "The approval request ID", + Type: "string", + }, + }, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/approval-requests/{id}/reviews", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_ApprovalRequestsResourceCmd, client, OperationData{ + Short: "Review approval request for a flag", + Long: "Review an approval request by approving or denying changes.", + Use: "create-review-for-flag", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "id", + In: "path", + Description: "The feature flag approval request ID", + Type: "string", + }, + }, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{id}/reviews", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_ApprovalRequestsResourceCmd, client, OperationData{ + Short: "Create approval request to copy flag configurations across environments", + Long: "Create an approval request to copy a feature flag's configuration across environments.", + Use: "create-flag-copy-config", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key for the target environment", + Type: "string", + }, + }, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests-flag-copy", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_AuditLogResourceCmd, client, OperationData{ + Short: "List audit log entries", + Long: "Get a list of all audit log entries. The query parameters let you restrict the results that return by date ranges, resource specifiers, or a full-text search query.\n\nLaunchDarkly uses a resource specifier syntax to name resources or collections of resources. To learn more, read [Understanding the resource specifier syntax](https://docs.launchdarkly.com/home/members/role-resources#understanding-the-resource-specifier-syntax).\n", + Use: "list-entries", + Params: []Param{ + { + Name: "before", + In: "query", + Description: "A timestamp filter, expressed as a Unix epoch time in milliseconds. All entries this returns occurred before the timestamp.", + Type: "integer", + }, + { + Name: "after", + In: "query", + Description: "A timestamp filter, expressed as a Unix epoch time in milliseconds. All entries this returns occurred after the timestamp.", + Type: "integer", + }, + { + Name: "q", + In: "query", + Description: "Text to search for. You can search for the full or partial name of the resource.", + Type: "string", + }, + { + Name: "limit", + In: "query", + Description: "A limit on the number of audit log entries that return. Set between 1 and 20. The default is 10.", + Type: "integer", + }, + { + Name: "spec", + In: "query", + Description: "A resource specifier that lets you filter audit log listings by resource", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/auditlog", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_AuditLogResourceCmd, client, OperationData{ + Short: "Get audit log entry", + Long: "Fetch a detailed audit log entry representation. The detailed representation includes several fields that are not present in the summary representation, including:\n\n- `delta`: the JSON patch body that was used in the request to update the entity\n- `previousVersion`: a JSON representation of the previous version of the entity\n- `currentVersion`: a JSON representation of the current version of the entity\n", + Use: "get-entry", + Params: []Param{ + { + Name: "id", + In: "path", + Description: "The ID of the audit log entry", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/auditlog/{id}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_CodeRefsResourceCmd, client, OperationData{ + Short: "Delete branches", + Long: "Asynchronously delete a number of branches.", + Use: "delete-branches", + Params: []Param{ + { + Name: "repo", + In: "path", + Description: "The repository name to delete branches for.", + Type: "string", + }, + }, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/code-refs/repositories/{repo}/branch-delete-tasks", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_CodeRefsResourceCmd, client, OperationData{ + Short: "Delete repository", + Long: "Delete a repository with the specified name.", + Use: "delete-repository", + Params: []Param{ + { + Name: "repo", + In: "path", + Description: "The repository name", + Type: "string", + }, + }, + HTTPMethod: "DELETE", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/code-refs/repositories/{repo}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_CodeRefsResourceCmd, client, OperationData{ + Short: "Get branch", + Long: "Get a specific branch in a repository.", + Use: "get-branch", + Params: []Param{ + { + Name: "repo", + In: "path", + Description: "The repository name", + Type: "string", + }, + { + Name: "branch", + In: "path", + Description: "The url-encoded branch name", + Type: "string", + }, + { + Name: "proj-key", + In: "query", + Description: "Filter results to a specific project", + Type: "string", + }, + { + Name: "flag-key", + In: "query", + Description: "Filter results to a specific flag key", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/code-refs/repositories/{repo}/branches/{branch}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_CodeRefsResourceCmd, client, OperationData{ + Short: "List branches", + Long: "Get a list of branches.", + Use: "list-branches", + Params: []Param{ + { + Name: "repo", + In: "path", + Description: "The repository name", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/code-refs/repositories/{repo}/branches", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_CodeRefsResourceCmd, client, OperationData{ + Short: "List extinctions", + Long: "Get a list of all extinctions. LaunchDarkly creates an extinction event after you remove all code references to a flag. To learn more, read [Understanding extinction events](https://docs.launchdarkly.com/home/code/code-references#understanding-extinction-events).", + Use: "list-extinctions", + Params: []Param{ + { + Name: "repo-name", + In: "query", + Description: "Filter results to a specific repository", + Type: "string", + }, + { + Name: "branch-name", + In: "query", + Description: "Filter results to a specific branch. By default, only the default branch will be queried for extinctions.", + Type: "string", + }, + { + Name: "proj-key", + In: "query", + Description: "Filter results to a specific project", + Type: "string", + }, + { + Name: "flag-key", + In: "query", + Description: "Filter results to a specific flag key", + Type: "string", + }, + { + Name: "from", + In: "query", + Description: "Filter results to a specific timeframe based on commit time, expressed as a Unix epoch time in milliseconds. Must be used with `to`.", + Type: "integer", + }, + { + Name: "to", + In: "query", + Description: "Filter results to a specific timeframe based on commit time, expressed as a Unix epoch time in milliseconds. Must be used with `from`.", + Type: "integer", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/code-refs/extinctions", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_CodeRefsResourceCmd, client, OperationData{ + Short: "List repositories", + Long: "Get a list of connected repositories. Optionally, you can include branch metadata with the `withBranches` query parameter. Embed references for the default branch with `ReferencesForDefaultBranch`. You can also filter the list of code references by project key and flag key.", + Use: "list-repositories", + Params: []Param{ + { + Name: "with-branches", + In: "query", + Description: "If set to any value, the endpoint returns repositories with associated branch data", + Type: "string", + }, + { + Name: "with-references-for-default-branch", + In: "query", + Description: "If set to any value, the endpoint returns repositories with associated branch data, as well as code references for the default git branch", + Type: "string", + }, + { + Name: "proj-key", + In: "query", + Description: "A LaunchDarkly project key. If provided, this filters code reference results to the specified project.", + Type: "string", + }, + { + Name: "flag-key", + In: "query", + Description: "If set to any value, the endpoint returns repositories with associated branch data, as well as code references for the default git branch", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/code-refs/repositories", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_CodeRefsResourceCmd, client, OperationData{ + Short: "Get repository", + Long: "Get a single repository by name.", + Use: "get-repository", + Params: []Param{ + { + Name: "repo", + In: "path", + Description: "The repository name", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/code-refs/repositories/{repo}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_CodeRefsResourceCmd, client, OperationData{ + Short: "Get links to code reference repositories for each project", + Long: "Get links for all projects that have code references.", + Use: "get-root-statistic", + Params: []Param{}, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/code-refs/statistics", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_CodeRefsResourceCmd, client, OperationData{ + Short: "Get code references statistics for flags", + Long: "Get statistics about all the code references across repositories for all flags in your project that have code references in the default branch, for example, `main`. Optionally, you can include the `flagKey` query parameter to limit your request to statistics about code references for a single flag. This endpoint returns the number of references to your flag keys in your repositories, as well as a link to each repository.", + Use: "get-statistics", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "flag-key", + In: "query", + Description: "Filter results to a specific flag key", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/code-refs/statistics/{projectKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_CodeRefsResourceCmd, client, OperationData{ + Short: "Update repository", + Long: "Update a repository's settings. Updating repository settings 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](/#section/Overview/Updates).", + Use: "update-repository", + Params: []Param{ + { + Name: "repo", + In: "path", + Description: "The repository name", + Type: "string", + }, + }, + HTTPMethod: "PATCH", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/code-refs/repositories/{repo}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_CodeRefsResourceCmd, client, OperationData{ + Short: "Create extinction", + Long: "Create a new extinction.", + Use: "create-extinction", + Params: []Param{ + { + Name: "repo", + In: "path", + Description: "The repository name", + Type: "string", + }, + { + Name: "branch", + In: "path", + Description: "The URL-encoded branch name", + Type: "string", + }, + }, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/code-refs/repositories/{repo}/branches/{branch}/extinction-events", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_CodeRefsResourceCmd, client, OperationData{ + Short: "Create repository", + Long: "Create a repository with the specified name.", + Use: "create-repository", + Params: []Param{}, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/code-refs/repositories", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_CodeRefsResourceCmd, client, OperationData{ + Short: "Upsert branch", + Long: "Create a new branch if it doesn't exist, or update the branch if it already exists.", + Use: "replace-branch", + Params: []Param{ + { + Name: "repo", + In: "path", + Description: "The repository name", + Type: "string", + }, + { + Name: "branch", + In: "path", + Description: "The URL-encoded branch name", + Type: "string", + }, + }, + HTTPMethod: "PUT", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/code-refs/repositories/{repo}/branches/{branch}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_ContextSettingsResourceCmd, client, OperationData{ + Short: "Update flag settings for context", + Long: "\nEnable or disable a feature flag for a context based on its context kind and key.\n\nOmitting the `setting` attribute from the request body, or including a `setting` of `null`, erases the current setting for a context.\n\nIf you previously patched the flag, and the patch included the context's data, LaunchDarkly continues to use that data. If LaunchDarkly has never encountered the combination of the context's key and kind before, it calculates the flag values based on the context kind and key.\n", + Use: "replace-context-flag-setting", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "context-kind", + In: "path", + Description: "The context kind", + Type: "string", + }, + { + Name: "context-key", + In: "path", + Description: "The context key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", + }, + }, + HTTPMethod: "PUT", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/projects/{projectKey}/environments/{environmentKey}/contexts/{contextKind}/{contextKey}/flags/{featureFlagKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_ContextsResourceCmd, client, OperationData{ + Short: "Delete context instances", + Long: "Delete context instances by ID.", + Use: "delete-instances", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "id", + In: "path", + Description: "The context instance ID", + Type: "string", + }, + }, + HTTPMethod: "DELETE", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/projects/{projectKey}/environments/{environmentKey}/context-instances/{id}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_ContextsResourceCmd, client, OperationData{ + Short: "Evaluate flags for context instance", + Long: "Evaluate flags for a context instance, for example, to determine the expected flag variation. **Do not use this API instead of an SDK.** The LaunchDarkly SDKs are specialized for the tasks of evaluating feature flags in your application at scale and generating analytics events based on those evaluations. This API is not designed for that use case. Any evaluations you perform with this API will not be reflected in features such as flag statuses and flag insights. Context instances evaluated by this API will not appear in the Contexts list. To learn more, read [Comparing LaunchDarkly's SDKs and REST API](https://docs.launchdarkly.com/guide/api/comparing-sdk-rest-api).\n\n### Filtering \n\nLaunchDarkly supports the `filter` query param for filtering, with the following fields:\n\n- `query` filters for a string that matches against the flags' keys and names. It is not case sensitive. For example: `filter=query equals dark-mode`.\n- `tags` filters the list to flags that have all of the tags in the list. For example: `filter=tags contains [\"beta\",\"q1\"]`.\n\nYou can also apply multiple filters at once. For example, setting `filter=query equals dark-mode, tags contains [\"beta\",\"q1\"]` matches flags which match the key or name `dark-mode` and are tagged `beta` and `q1`.\n", + Use: "evaluate-instance", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "limit", + In: "query", + Description: "The number of feature flags to return. Defaults to -1, which returns all flags", + Type: "integer", + }, + { + Name: "offset", + In: "query", + Description: "Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.", + Type: "integer", + }, + { + Name: "sort", + In: "query", + Description: "A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order", + Type: "string", + }, + { + Name: "filter", + In: "query", + Description: "A comma-separated list of filters. Each filter is of the form `field operator value`. Supported fields are explained above.", + Type: "string", + }, + }, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/projects/{projectKey}/environments/{environmentKey}/flags/evaluate", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_ContextsResourceCmd, client, OperationData{ + Short: "Get context attribute names", + Long: "Get context attribute names. Returns only the first 100 attribute names per context.", + Use: "list-attribute-names", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "filter", + In: "query", + Description: "A comma-separated list of context filters. This endpoint only accepts `kind` filters, with the `equals` operator, and `name` filters, with the `startsWith` operator. To learn more about the filter syntax, read [Filtering contexts and context instances](/tag/Contexts#filtering-contexts-and-context-instances).", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/projects/{projectKey}/environments/{environmentKey}/context-attributes", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_ContextsResourceCmd, client, OperationData{ + Short: "Get context attribute values", + Long: "Get context attribute values.", + Use: "list-attribute-values", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "attribute-name", + In: "path", + Description: "The attribute name", + Type: "string", + }, + { + Name: "filter", + In: "query", + Description: "A comma-separated list of context filters. This endpoint only accepts `kind` filters, with the `equals` operator, and `value` filters, with the `startsWith` operator. To learn more about the filter syntax, read [Filtering contexts and context instances](/tag/Contexts#filtering-contexts-and-context-instances).", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/projects/{projectKey}/environments/{environmentKey}/context-attributes/{attributeName}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_ContextsResourceCmd, client, OperationData{ + Short: "Get context instances", + Long: "Get context instances by ID.", + Use: "list-instances", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "id", + In: "path", + Description: "The context instance ID", + Type: "string", + }, + { + Name: "limit", + In: "query", + Description: "Specifies the maximum number of context instances to return (max: 50, default: 20)", + Type: "integer", + }, + { + Name: "continuation-token", + In: "query", + Description: "Limits results to context instances with sort values after the value specified. You can use this for pagination, however, we recommend using the `next` link we provide instead.", + Type: "string", + }, + { + Name: "sort", + In: "query", + Description: "Specifies a field by which to sort. LaunchDarkly supports sorting by timestamp in ascending order by specifying `ts` for this value, or descending order by specifying `-ts`.", + Type: "string", + }, + { + Name: "filter", + In: "query", + Description: "A comma-separated list of context filters. This endpoint only accepts an `applicationId` filter. To learn more about the filter syntax, read [Filtering contexts and context instances](/tag/Contexts#filtering-contexts-and-context-instances).", + Type: "string", + }, + { + Name: "include-total-count", + In: "query", + Description: "Specifies whether to include or omit the total count of matching context instances. Defaults to true.", + Type: "boolean", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/projects/{projectKey}/environments/{environmentKey}/context-instances/{id}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_ContextsResourceCmd, client, OperationData{ + Short: "Get context kinds", + Long: "Get all context kinds for a given project.", + Use: "list-kinds-key", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/projects/{projectKey}/context-kinds", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_ContextsResourceCmd, client, OperationData{ + Short: "Get contexts", + Long: "Get contexts based on kind and key.", + Use: "list", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "kind", + In: "path", + Description: "The context kind", + Type: "string", + }, + { + Name: "key", + In: "path", + Description: "The context key", + Type: "string", + }, + { + Name: "limit", + In: "query", + Description: "Specifies the maximum number of items in the collection to return (max: 50, default: 20)", + Type: "integer", + }, + { + Name: "continuation-token", + In: "query", + Description: "Limits results to contexts with sort values after the value specified. You can use this for pagination, however, we recommend using the `next` link we provide instead.", + Type: "string", + }, + { + Name: "sort", + In: "query", + Description: "Specifies a field by which to sort. LaunchDarkly supports sorting by timestamp in ascending order by specifying `ts` for this value, or descending order by specifying `-ts`.", + Type: "string", + }, + { + Name: "filter", + In: "query", + Description: "A comma-separated list of context filters. This endpoint only accepts an `applicationId` filter. To learn more about the filter syntax, read [Filtering contexts and context instances](/tag/Contexts#filtering-contexts-and-context-instances).", + Type: "string", + }, + { + Name: "include-total-count", + In: "query", + Description: "Specifies whether to include or omit the total count of matching contexts. Defaults to true.", + Type: "boolean", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/projects/{projectKey}/environments/{environmentKey}/contexts/{kind}/{key}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_ContextsResourceCmd, client, OperationData{ + Short: "Create or update context kind", + Long: "Create or update a context kind by key. Only the included fields will be updated.", + Use: "replace-kind", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "key", + In: "path", + Description: "The context kind key", + Type: "string", + }, + }, + HTTPMethod: "PUT", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/projects/{projectKey}/context-kinds/{key}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_ContextsResourceCmd, client, OperationData{ + Short: "Search for context instances", + Long: "\nSearch for context instances.\n\nYou can use either the query parameters or the request body parameters. If both are provided, there is an error.\n\nTo learn more about the filter syntax, read [Filtering contexts and context instances](/tag/Contexts#filtering-contexts-and-context-instances). To learn more about context instances, read [Understanding context instances](https://docs.launchdarkly.com/home/contexts#understanding-context-instances).\n", + Use: "search-instances", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "limit", + In: "query", + Description: "Specifies the maximum number of items in the collection to return (max: 50, default: 20)", + Type: "integer", + }, + { + Name: "continuation-token", + In: "query", + Description: "Limits results to context instances with sort values after the value specified. You can use this for pagination, however, we recommend using the `next` link we provide instead.", + Type: "string", + }, + { + Name: "sort", + In: "query", + Description: "Specifies a field by which to sort. LaunchDarkly supports sorting by timestamp in ascending order by specifying `ts` for this value, or descending order by specifying `-ts`.", + Type: "string", + }, + { + Name: "filter", + In: "query", + Description: "A comma-separated list of context filters. This endpoint only accepts an `applicationId` filter. To learn more about the filter syntax, read [Filtering contexts and context instances](/tag/Contexts#filtering-contexts-and-context-instances).", + Type: "string", + }, + { + Name: "include-total-count", + In: "query", + Description: "Specifies whether to include or omit the total count of matching context instances. Defaults to true.", + Type: "boolean", + }, + }, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/projects/{projectKey}/environments/{environmentKey}/context-instances/search", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_ContextsResourceCmd, client, OperationData{ + Short: "Search for contexts", + Long: "\nSearch for contexts.\n\nYou can use either the query parameters or the request body parameters. If both are provided, there is an error.\n\nTo learn more about the filter syntax, read [Filtering contexts and context instances](/tag/Contexts#filtering-contexts-and-context-instances). To learn more about contexts, read [Understanding contexts and context kinds](https://docs.launchdarkly.com/home/contexts#understanding-contexts-and-context-kinds).\n", + Use: "search", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "limit", + In: "query", + Description: "Specifies the maximum number of items in the collection to return (max: 50, default: 20)", + Type: "integer", + }, + { + Name: "continuation-token", + In: "query", + Description: "Limits results to contexts with sort values after the value specified. You can use this for pagination, however, we recommend using the `next` link we provide instead.", + Type: "string", + }, + { + Name: "sort", + In: "query", + Description: "Specifies a field by which to sort. LaunchDarkly supports sorting by timestamp in ascending order by specifying `ts` for this value, or descending order by specifying `-ts`.", + Type: "string", + }, + { + Name: "filter", + In: "query", + Description: "A comma-separated list of context filters. To learn more about the filter syntax, read [Filtering contexts and context instances](/tag/Contexts#filtering-contexts-and-context-instances).", + Type: "string", + }, + { + Name: "include-total-count", + In: "query", + Description: "Specifies whether to include or omit the total count of matching contexts. Defaults to true.", + Type: "boolean", + }, + }, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/projects/{projectKey}/environments/{environmentKey}/contexts/search", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_CustomRolesResourceCmd, client, OperationData{ + Short: "Delete custom role", + Long: "Delete a custom role by key", + Use: "delete", + Params: []Param{ + { + Name: "custom-role-key", + In: "path", + Description: "The custom role key", + Type: "string", + }, + }, + HTTPMethod: "DELETE", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/roles/{customRoleKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_CustomRolesResourceCmd, client, OperationData{ + Short: "Get custom role", + Long: "Get a single custom role by key or ID", + Use: "get", + Params: []Param{ + { + Name: "custom-role-key", + In: "path", + Description: "The custom role key or ID", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/roles/{customRoleKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_CustomRolesResourceCmd, client, OperationData{ + Short: "List custom roles", + Long: "Get a complete list of custom roles. Custom roles let you create flexible policies providing fine-grained access control to everything in LaunchDarkly, from feature flags to goals, environments, and teams. With custom roles, it's possible to enforce access policies that meet your exact workflow needs. Custom roles are available to customers on our enterprise plans. If you're interested in learning more about our enterprise plans, contact sales@launchdarkly.com.", + Use: "list", + Params: []Param{ + { + Name: "limit", + In: "query", + Description: "The maximum number of custom roles to return. Defaults to 20.", + Type: "integer", + }, + { + Name: "offset", + In: "query", + Description: "Where to start in the list. Defaults to 0. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.", + Type: "integer", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/roles", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_CustomRolesResourceCmd, client, OperationData{ + Short: "Update custom role", + Long: "Update a single custom role. Updating a custom role 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](/#section/Overview/Updates).\u003cbr/\u003e\u003cbr/\u003eTo add an element to the `policy` array, set the `path` to `/policy` and then append `/\u003carray index\u003e`. Use `/0` to add to the beginning of the array. Use `/-` to add to the end of the array.", + Use: "update", + Params: []Param{ + { + Name: "custom-role-key", + In: "path", + Description: "The custom role key", + Type: "string", + }, + }, + HTTPMethod: "PATCH", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/roles/{customRoleKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_CustomRolesResourceCmd, client, OperationData{ + Short: "Create custom role", + Long: "Create a new custom role", + Use: "create", + Params: []Param{}, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/roles", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_DataExportDestinationsResourceCmd, client, OperationData{ + Short: "Delete Data Export destination", + Long: "Delete a Data Export destination by ID.", + Use: "delete-destination", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "id", + In: "path", + Description: "The Data Export destination ID", + Type: "string", + }, + }, + HTTPMethod: "DELETE", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/destinations/{projectKey}/{environmentKey}/{id}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_DataExportDestinationsResourceCmd, client, OperationData{ + Short: "Get destination", + Long: "Get a single Data Export destination by ID.", + Use: "get-destination", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "id", + In: "path", + Description: "The Data Export destination ID", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/destinations/{projectKey}/{environmentKey}/{id}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_DataExportDestinationsResourceCmd, client, OperationData{ + Short: "List destinations", + Long: "Get a list of Data Export destinations configured across all projects and environments.", + Use: "list-destinations", + Params: []Param{}, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/destinations", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_DataExportDestinationsResourceCmd, client, OperationData{ + Short: "Update Data Export destination", + Long: "Update a Data Export destination. Updating a destination 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](/#section/Overview/Updates).", + Use: "update-destination", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "id", + In: "path", + Description: "The Data Export destination ID", + Type: "string", + }, + }, + HTTPMethod: "PATCH", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/destinations/{projectKey}/{environmentKey}/{id}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_DataExportDestinationsResourceCmd, client, OperationData{ + Short: "Create Data Export destination", + Long: "\nCreate a new Data Export destination.\n\nIn the `config` request body parameter, the fields required depend on the type of Data Export destination.\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand \u003ccode\u003econfig\u003c/code\u003e parameter details\u003c/summary\u003e\n\n#### Azure Event Hubs\n\nTo create a Data Export destination with a `kind` of `azure-event-hubs`, the `config` object requires the following fields:\n\n* `namespace`: The Event Hub Namespace name\n* `name`: The Event Hub name\n* `policyName`: The shared access signature policy name. You can find your policy name in the settings of your Azure Event Hubs Namespace.\n* `policyKey`: The shared access signature key. You can find your policy key in the settings of your Azure Event Hubs Namespace.\n\n#### Google Cloud Pub/Sub\n\nTo create a Data Export destination with a `kind` of `google-pubsub`, the `config` object requires the following fields:\n\n* `project`: The Google PubSub project ID for the project to publish to\n* `topic`: The Google PubSub topic ID for the topic to publish to\n\n#### Amazon Kinesis\n\nTo create a Data Export destination with a `kind` of `kinesis`, the `config` object requires the following fields:\n\n* `region`: The Kinesis stream's AWS region key\n* `roleArn`: The Amazon Resource Name (ARN) of the AWS role that will be writing to Kinesis\n* `streamName`: The name of the Kinesis stream that LaunchDarkly is sending events to. This is not the ARN of the stream.\n\n#### mParticle\n\nTo create a Data Export destination with a `kind` of `mparticle`, the `config` object requires the following fields:\n\n* `apiKey`: The mParticle API key\n* `secret`: The mParticle API secret\n* `userIdentity`: The type of identifier you use to identify your end users in mParticle\n* `anonymousUserIdentity`: The type of identifier you use to identify your anonymous end users in mParticle\n\n#### Segment\n\nTo create a Data Export destination with a `kind` of `segment`, the `config` object requires the following fields:\n\n* `writeKey`: The Segment write key. This is used to authenticate LaunchDarkly's calls to Segment.\n\n\u003c/details\u003e\n", + Use: "create-destination", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + }, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/destinations/{projectKey}/{environmentKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_EnvironmentsResourceCmd, client, OperationData{ + Short: "Delete environment", + Long: "Delete a environment by key.", + Use: "delete", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + }, + HTTPMethod: "DELETE", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/projects/{projectKey}/environments/{environmentKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_EnvironmentsResourceCmd, client, OperationData{ + Short: "Get environment", + Long: "\u003e ### Approval settings\n\u003e\n\u003e The `approvalSettings` key is only returned when the Flag Approvals feature is enabled.\n\nGet an environment given a project and key.\n", + Use: "get", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/projects/{projectKey}/environments/{environmentKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_EnvironmentsResourceCmd, client, OperationData{ + Short: "List environments", + Long: "Return a list of environments for the specified project.\n\nBy default, this returns the first 20 environments. Page through this list with the `limit` parameter and by following the `first`, `prev`, `next`, and `last` links in the `_links` field that returns. If those links do not appear, the pages they refer to don't exist. For example, the `first` and `prev` links will be missing from the response on the first page, because there is no previous page and you cannot return to the first page when you are already on the first page.\n\n### Filtering environments\n\nLaunchDarkly supports two fields for filters:\n- `query` is a string that matches against the environments' names and keys. It is not case sensitive.\n- `tags` is a `+`-separated list of environment tags. It filters the list of environments that have all of the tags in the list.\n\nFor example, the filter `filter=query:abc,tags:tag-1+tag-2` matches environments with the string `abc` in their name or key and also are tagged with `tag-1` and `tag-2`. The filter is not case-sensitive.\n\nThe documented values for `filter` query parameters are prior to URL encoding. For example, the `+` in `filter=tags:tag-1+tag-2` must be encoded to `%2B`.\n\n### Sorting environments\n\nLaunchDarkly supports the following fields for sorting:\n\n- `createdOn` sorts by the creation date of the environment.\n- `critical` sorts by whether the environments are marked as critical.\n- `name` sorts by environment name.\n\nFor example, `sort=name` sorts the response by environment name in ascending order.\n", + Use: "list", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "limit", + In: "query", + Description: "The number of environments to return in the response. Defaults to 20.", + Type: "integer", + }, + { + Name: "offset", + In: "query", + Description: "Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.", + Type: "integer", + }, + { + Name: "filter", + In: "query", + Description: "A comma-separated list of filters. Each filter is of the form `field:value`.", + Type: "string", + }, + { + Name: "sort", + In: "query", + Description: "A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order.", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/projects/{projectKey}/environments", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_EnvironmentsResourceCmd, client, OperationData{ + Short: "Update environment", + Long: "\nUpdate an environment. Updating an environment uses a [JSON patch](https://datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes. To learn more, read [Updates](/#section/Overview/Updates).\n\nTo update fields in the environment object that are arrays, set the `path` to the name of the field and then append `/\u003carray index\u003e`. Using `/0` appends to the beginning of the array.\n\n### Approval settings\n\nThis request only returns the `approvalSettings` key if the [Flag Approvals](https://docs.launchdarkly.com/home/feature-workflows/approvals) feature is enabled.\n\nOnly the `canReviewOwnRequest`, `canApplyDeclinedChanges`, `minNumApprovals`, `required` and `requiredApprovalTagsfields` are editable.\n\nIf you try to patch the environment by setting both `required` and `requiredApprovalTags`, the request fails and an error appears. You can specify either required approvals for all flags in an environment or those with specific tags, but not both.\n", + Use: "update", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + }, + HTTPMethod: "PATCH", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/projects/{projectKey}/environments/{environmentKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_EnvironmentsResourceCmd, client, OperationData{ + Short: "Create environment", + Long: "\u003e ### Approval settings\n\u003e\n\u003e The `approvalSettings` key is only returned when the Flag Approvals feature is enabled.\n\u003e\n\u003e You cannot update approval settings when creating new environments. Update approval settings with the PATCH Environment API.\n\nCreate a new environment in a specified project with a given name, key, swatch color, and default TTL.\n", + Use: "create", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + }, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/projects/{projectKey}/environments", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_EnvironmentsResourceCmd, client, OperationData{ + Short: "Reset environment mobile SDK key", + Long: "Reset an environment's mobile key. The optional expiry for the old key is deprecated for this endpoint, so the old key will always expire immediately.", + Use: "reset-mobile-key", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + }, + HTTPMethod: "POST", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/projects/{projectKey}/environments/{environmentKey}/mobileKey", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_EnvironmentsResourceCmd, client, OperationData{ + Short: "Reset environment SDK key", + Long: "Reset an environment's SDK key with an optional expiry time for the old key.", + Use: "reset-sdk-key", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "expiry", + In: "query", + Description: "The time at which you want the old SDK key to expire, in UNIX milliseconds. By default, the key expires immediately. During the period between this call and the time when the old SDK key expires, both the old SDK key and the new SDK key will work.", + Type: "integer", + }, + }, + HTTPMethod: "POST", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/projects/{projectKey}/environments/{environmentKey}/apiKey", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_FlagTriggersResourceCmd, client, OperationData{ + Short: "Create flag trigger", + Long: "Create a new flag trigger.", + Use: "create-trigger-workflow", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", + }, + }, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/flags/{projectKey}/{featureFlagKey}/triggers/{environmentKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_FlagTriggersResourceCmd, client, OperationData{ + Short: "Delete flag trigger", + Long: "Delete a flag trigger by ID.", + Use: "delete-trigger-workflow", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", + }, + { + Name: "id", + In: "path", + Description: "The flag trigger ID", + Type: "string", + }, + }, + HTTPMethod: "DELETE", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/flags/{projectKey}/{featureFlagKey}/triggers/{environmentKey}/{id}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_FlagTriggersResourceCmd, client, OperationData{ + Short: "Get flag trigger by ID", + Long: "Get a flag trigger by ID.", + Use: "get-trigger-workflow-by-id", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "id", + In: "path", + Description: "The flag trigger ID", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/flags/{projectKey}/{featureFlagKey}/triggers/{environmentKey}/{id}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_FlagTriggersResourceCmd, client, OperationData{ + Short: "List flag triggers", + Long: "Get a list of all flag triggers.", + Use: "list-trigger-workflows", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/flags/{projectKey}/{featureFlagKey}/triggers/{environmentKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_FlagTriggersResourceCmd, client, OperationData{ + Short: "Update flag trigger", + Long: "Update a flag trigger. Updating a flag trigger uses the semantic patch format.\n\nTo make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch).\n\n### Instructions\n\nSemantic patch requests support the following `kind` instructions for updating flag triggers.\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand instructions for \u003cstrong\u003eupdating flag triggers\u003c/strong\u003e\u003c/summary\u003e\n\n#### replaceTriggerActionInstructions\n\nRemoves the existing trigger action and replaces it with the new instructions.\n\n##### Parameters\n\n- `value`: An array of the new `kind`s of actions to perform when triggering. Supported flag actions are `turnFlagOn` and `turnFlagOff`.\n\nHere's an example that replaces the existing action with new instructions to turn flag targeting off:\n\n```json\n{\n \"instructions\": [\n {\n \"kind\": \"replaceTriggerActionInstructions\",\n \"value\": [ {\"kind\": \"turnFlagOff\"} ]\n }\n ]\n}\n```\n\n#### cycleTriggerUrl\n\nGenerates a new URL for this trigger. You must update any clients using the trigger to use this new URL.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{ \"kind\": \"cycleTriggerUrl\" }]\n}\n```\n\n#### disableTrigger\n\nDisables the trigger. This saves the trigger configuration, but the trigger stops running. To re-enable, use `enableTrigger`.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{ \"kind\": \"disableTrigger\" }]\n}\n```\n\n#### enableTrigger\n\nEnables the trigger. If you previously disabled the trigger, it begins running again.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{ \"kind\": \"enableTrigger\" }]\n}\n```\n\n\u003c/details\u003e\n", + Use: "update-trigger-workflow", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", + }, + { + Name: "id", + In: "path", + Description: "The flag trigger ID", + Type: "string", + }, + }, + HTTPMethod: "PATCH", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/flags/{projectKey}/{featureFlagKey}/triggers/{environmentKey}/{id}", + SupportsSemanticPatch: true, + }) + + NewOperationCmd(gen_FeatureFlagsResourceCmd, client, OperationData{ + Short: "Copy feature flag", + Long: "\n\u003e ### Copying flag settings is an Enterprise feature\n\u003e\n\u003e Copying flag settings is available to customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\nCopy flag settings from a source environment to a target environment.\n\nBy default, this operation copies the entire flag configuration. You can use the `includedActions` or `excludedActions` to specify that only part of the flag configuration is copied.\n\nIf you provide the optional `currentVersion` of a flag, this operation tests to ensure that the current flag version in the environment matches the version you've specified. The operation rejects attempts to copy flag settings if the environment's current version of the flag does not match the version you've specified. You can use this to enforce optimistic locking on copy attempts.\n", + Use: "copy", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key. The key identifies the flag in your code.", + Type: "string", + }, + }, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/flags/{projectKey}/{featureFlagKey}/copy", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_FeatureFlagsResourceCmd, client, OperationData{ + Short: "Delete feature flag", + Long: "Delete a feature flag in all environments. Use with caution: only delete feature flags your application no longer uses.", + Use: "delete", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key. The key identifies the flag in your code.", + Type: "string", + }, + }, + HTTPMethod: "DELETE", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/flags/{projectKey}/{featureFlagKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_FeatureFlagsResourceCmd, client, OperationData{ + Short: "Get expiring context targets for feature flag", + Long: "Get a list of context targets on a feature flag that are scheduled for removal.", + Use: "list-expiring-context-targets", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/flags/{projectKey}/{featureFlagKey}/expiring-targets/{environmentKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_FeatureFlagsResourceCmd, client, OperationData{ + Short: "Get expiring user targets for feature flag", + Long: "\n\u003e ### Contexts are now available\n\u003e\n\u003e After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use [Get expiring context targets for feature flag](/tag/Feature-flags#operation/getExpiringContextTargets) instead of this endpoint. To learn more, read [Contexts](https://docs.launchdarkly.com/home/contexts).\n\nGet a list of user targets on a feature flag that are scheduled for removal.\n", + Use: "list-expiring-user-targets", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/flags/{projectKey}/{featureFlagKey}/expiring-user-targets/{environmentKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_FeatureFlagsResourceCmd, client, OperationData{ + Short: "Get feature flag", + Long: "Get a single feature flag by key. By default, this returns the configurations for all environments. You can filter environments with the `env` query parameter. For example, setting `env=production` restricts the returned configurations to just the `production` environment.\n\n\u003e #### Recommended use\n\u003e\n\u003e This endpoint can return a large amount of information. Specifying one or multiple environments with the `env` parameter can decrease response time and overall payload size. We recommend using this parameter to return only the environments relevant to your query.\n\n### Expanding response\n\nLaunchDarkly supports the `expand` query param to include additional fields in the response, with the following fields:\n\n- `evaluation` includes evaluation information within returned environments, including which context kinds the flag has been evaluated for in the past 30 days \n- `migrationSettings` includes migration settings information within the flag and within returned environments. These settings are only included for migration flags, that is, where `purpose` is `migration`.\n\nFor example, `expand=evaluation` includes the `evaluation` field in the response.\n", + Use: "get", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", + }, + { + Name: "env", + In: "query", + Description: "Filter configurations by environment", + Type: "string", + }, + { + Name: "expand", + In: "query", + Description: "A comma-separated list of fields to expand in the response. Supported fields are explained above.", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/flags/{projectKey}/{featureFlagKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_FeatureFlagsResourceCmd, client, OperationData{ + Short: "Get feature flag status", + Long: "Get the status for a particular feature flag.", + Use: "get-status", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/flag-statuses/{projectKey}/{environmentKey}/{featureFlagKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_FeatureFlagsResourceCmd, client, OperationData{ + Short: "Get flag status across environments", + Long: "Get the status for a particular feature flag across environments.", + Use: "get-status-across-environments", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", + }, + { + Name: "env", + In: "query", + Description: "Optional environment filter", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/flag-status/{projectKey}/{featureFlagKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_FeatureFlagsResourceCmd, client, OperationData{ + Short: "List feature flag statuses", + Long: "Get a list of statuses for all feature flags. The status includes the last time the feature flag was requested, as well as a state, which is one of the following:\n\n- `new`: You created the flag fewer than seven days ago and it has never been requested.\n- `active`: LaunchDarkly is receiving requests for this flag, but there are either multiple variations configured, or it is toggled off, or there have been changes to configuration in the past seven days.\n- `inactive`: You created the feature flag more than seven days ago, and hasn't been requested within the past seven days.\n- `launched`: LaunchDarkly is receiving requests for this flag, it is toggled on, there is only one variation configured, and there have been no changes to configuration in the past seven days.\n\nTo learn more, read [Flag statuses](https://docs.launchdarkly.com/home/code/flag-status).\n", + Use: "list-statuses", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/flag-statuses/{projectKey}/{environmentKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_FeatureFlagsResourceCmd, client, OperationData{ + Short: "List feature flags", + Long: "Get a list of all feature flags in the given project. By default, each flag includes configurations for each environment. You can filter environments with the `env` query parameter. For example, setting `env=production` restricts the returned configurations to just your production environment. You can also filter feature flags by tag with the `tag` query parameter.\n\n\u003e #### Recommended use\n\u003e\n\u003e This endpoint can return a large amount of information. We recommend using some or all of these query parameters to decrease response time and overall payload size: `limit`, `env`, `query`, and `filter=creationDate`.\n\n### Filtering flags\n\nYou can filter on certain fields using the `filter` query parameter. For example, setting `filter=query:dark-mode,tags:beta+test` matches flags with the string `dark-mode` in their key or name, ignoring case, which also have the tags `beta` and `test`.\n\nThe `filter` query parameter supports the following arguments:\n\n| Filter argument | Description | Example |\n|-----------------------|-------------|----------------------|\n| `applicationEvaluated` | A string. It filters the list to flags that are evaluated in the application with the given key. | `filter=applicationEvaluated:com.launchdarkly.cafe` |\n| `archived` | (deprecated) A boolean value. It filters the list to archived flags. | Use `filter=state:archived` instead |\n| `contextKindsEvaluated` | A `+`-separated list of context kind keys. It filters the list to flags which have been evaluated in the past 30 days for all of the context kinds in the list. | `filter=contextKindsEvaluated:user+application` |\n| `codeReferences.max` | An integer value. Use `0` to return flags that do not have code references. | `filter=codeReferences.max:0` |\n| `codeReferences.min` | An integer value. Use `1` to return flags that do have code references. | `filter=codeReferences.min:1` |\n| `creationDate` | An object with an optional `before` field whose value is Unix time in milliseconds. It filters the list to flags created before the date. | `filter=creationDate:{\"before\":1690527600000}` |\n| `evaluated` | An object that contains a key of `after` and a value in Unix time in milliseconds. It filters the list to all flags that have been evaluated since the time you specify, in the environment provided. This filter requires the `filterEnv` filter. | `filter=evaluated:{\"after\":1690527600000},filterEnv:production` |\n| `filterEnv` | A string with a list of comma-separated keys of valid environments. You must use this field for filters that are environment-specific. If there are multiple environment-specific filters, you only need to include this field once. You can filter for a maximum of three environments. | `filter=evaluated:{\"after\": 1590768455282},filterEnv:production,status:active` |\n| `hasExperiment` | A boolean value. It filters the list to flags that are used in an experiment. | `filter=hasExperiment:true` |\n| `maintainerId` | A valid member ID. It filters the list to flags that are maintained by this member. | `filter=maintainerId:12ab3c45de678910abc12345` |\n| `maintainerTeamKey` | A string. It filters the list to flags that are maintained by the team with this key. | `filter=maintainerTeamKey:example-team-key` |\n| `query` | A string. It filters the list to flags that include the specified string in their key or name. It is not case sensitive. | `filter=query:example` |\n| `state` | A string, either `live`, `deprecated`, or `archived`. It filters the list to flags in this state. | `filter=state:archived` |\n| `sdkAvailability` | A string, one of `client`, `mobile`, `anyClient`, `server`. Using `client` filters the list to flags whose client-side SDK availability is set to use the client-side ID. Using `mobile` filters to flags set to use the mobile key. Using `anyClient` filters to flags set to use either the client-side ID or the mobile key. Using `server` filters to flags set to use neither, that is, to flags only available in server-side SDKs. | `filter=sdkAvailability:client` |\n| `tags` | A `+`-separated list of tags. It filters the list to flags that have all of the tags in the list. | `filter=tags:beta+test` |\n| `type` | A string, either `temporary` or `permanent`. It filters the list to flags with the specified type. | `filter=type:permanent` |\n\nThe documented values for the `filter` query are prior to URL encoding. For example, the `+` in `filter=tags:beta+test` must be encoded to `%2B`.\n\nBy default, this endpoint returns all flags. You can page through the list with the `limit` parameter and by following the `first`, `prev`, `next`, and `last` links in the returned `_links` field. These links will not be present if the pages they refer to don't exist. For example, the `first` and `prev` links will be missing from the response on the first page.\n\n### Sorting flags\n\nYou can sort flags based on the following fields:\n\n- `creationDate` sorts by the creation date of the flag.\n- `key` sorts by the key of the flag.\n- `maintainerId` sorts by the flag maintainer.\n- `name` sorts by flag name.\n- `tags` sorts by tags.\n- `targetingModifiedDate` sorts by the date that the flag's targeting rules were last modified in a given environment. It must be used with `env` parameter and it can not be combined with any other sort. If multiple `env` values are provided, it will perform sort using the first one. For example, `sort=-targetingModifiedDate\u0026env=production\u0026env=staging` returns results sorted by `targetingModifiedDate` for the `production` environment.\n- `type` sorts by flag type\n\nAll fields are sorted in ascending order by default. To sort in descending order, prefix the field with a dash ( - ). For example, `sort=-name` sorts the response by flag name in descending order.\n\n### Expanding response\n\nLaunchDarkly supports the `expand` query param to include additional fields in the response, with the following fields:\n\n- `codeReferences` includes code references for the feature flag\n- `evaluation` includes evaluation information within returned environments, including which context kinds the flag has been evaluated for in the past 30 days\n- `migrationSettings` includes migration settings information within the flag and within returned environments. These settings are only included for migration flags, that is, where `purpose` is `migration`.\n\nFor example, `expand=evaluation` includes the `evaluation` field in the response.\n\n### Migration flags\nFor migration flags, the cohort information is included in the `rules` property of a flag's response, and default cohort information is included in the `fallthrough` property of a flag's response.\nTo learn more, read [Migration Flags](https://docs.launchdarkly.com/home/flag-types/migration-flags).\n", + Use: "list", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "env", + In: "query", + Description: "Filter configurations by environment", + Type: "string", + }, + { + Name: "tag", + In: "query", + Description: "Filter feature flags by tag", + Type: "string", + }, + { + Name: "limit", + In: "query", + Description: "The number of feature flags to return. Defaults to 20.", + Type: "integer", + }, + { + Name: "offset", + In: "query", + Description: "Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.", + Type: "integer", + }, + { + Name: "archived", + In: "query", + Description: "Deprecated, use `filter=archived:true` instead. A boolean to filter the list to archived flags. When this is absent, only unarchived flags will be returned", + Type: "boolean", + }, + { + Name: "summary", + In: "query", + Description: "By default, flags do _not_ include their lists of prerequisites, targets, or rules for each environment. Set `summary=0` to include these fields for each flag returned.", + Type: "boolean", + }, + { + Name: "filter", + In: "query", + Description: "A comma-separated list of filters. Each filter is of the form field:value. Read the endpoint description for a full list of available filter fields.", + Type: "string", + }, + { + Name: "sort", + In: "query", + Description: "A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order. Read the endpoint description for a full list of available sort fields.", + Type: "string", + }, + { + Name: "compare", + In: "query", + Description: "A boolean to filter results by only flags that have differences between environments", + Type: "boolean", + }, + { + Name: "expand", + In: "query", + Description: "A comma-separated list of fields to expand in the response. Supported fields are explained above.", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/flags/{projectKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_FeatureFlagsResourceCmd, client, OperationData{ + Short: "Update expiring context targets on feature flag", + Long: "Schedule a context for removal from individual targeting on a feature flag. The flag must already individually target the context.\n\nYou can add, update, or remove a scheduled removal date. You can only schedule a context for removal on a single variation per flag.\n\nUpdating an expiring target uses the semantic patch format. To make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch).\n\n### Instructions\n\nSemantic patch requests support the following `kind` instructions for updating expiring targets.\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand instructions for \u003cstrong\u003eupdating expiring targets\u003c/strong\u003e\u003c/summary\u003e\n\n#### addExpiringTarget\n\nAdds a date and time that LaunchDarkly will remove the context from the flag's individual targeting.\n\n##### Parameters\n\n* `value`: The time, in Unix milliseconds, when LaunchDarkly should remove the context from individual targeting for this flag\n* `variationId`: ID of a variation on the flag\n* `contextKey`: The context key for the context to remove from individual targeting\n* `contextKind`: The kind of context represented by the `contextKey`\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"addExpiringTarget\",\n \"value\": 1754006460000,\n \"variationId\": \"4254742c-71ae-411f-a992-43b18a51afe0\",\n \"contextKey\": \"user-key-123abc\",\n \"contextKind\": \"user\"\n }]\n}\n```\n\n#### updateExpiringTarget\n\nUpdates the date and time that LaunchDarkly will remove the context from the flag's individual targeting\n\n##### Parameters\n\n* `value`: The time, in Unix milliseconds, when LaunchDarkly should remove the context from individual targeting for this flag\n* `variationId`: ID of a variation on the flag\n* `contextKey`: The context key for the context to remove from individual targeting\n* `contextKind`: The kind of context represented by the `contextKey`\n* `version`: (Optional) The version of the expiring target to update. If included, update will fail if version doesn't match current version of the expiring target.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"updateExpiringTarget\",\n \"value\": 1754006460000,\n \"variationId\": \"4254742c-71ae-411f-a992-43b18a51afe0\",\n \"contextKey\": \"user-key-123abc\",\n \"contextKind\": \"user\"\n }]\n}\n```\n\n#### removeExpiringTarget\n\nRemoves the scheduled removal of the context from the flag's individual targeting. The context will remain part of the flag's individual targeting until you explicitly remove it, or until you schedule another removal.\n\n##### Parameters\n\n* `variationId`: ID of a variation on the flag\n* `contextKey`: The context key for the context to remove from individual targeting\n* `contextKind`: The kind of context represented by the `contextKey`\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"removeExpiringTarget\",\n \"variationId\": \"4254742c-71ae-411f-a992-43b18a51afe0\",\n \"contextKey\": \"user-key-123abc\",\n \"contextKind\": \"user\"\n }]\n}\n```\n\n\u003c/details\u003e\n", + Use: "update-expiring-targets", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", + }, + }, + HTTPMethod: "PATCH", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/flags/{projectKey}/{featureFlagKey}/expiring-targets/{environmentKey}", + SupportsSemanticPatch: true, + }) + + NewOperationCmd(gen_FeatureFlagsResourceCmd, client, OperationData{ + Short: "Update expiring user targets on feature flag", + Long: "\u003e ### Contexts are now available\n\u003e\n\u003e After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use [Update expiring context targets on feature flag](/tag/Feature-flags#operation/patchExpiringTargets) instead of this endpoint. To learn more, read [Contexts](https://docs.launchdarkly.com/home/contexts).\n\nSchedule a target for removal from individual targeting on a feature flag. The flag must already serve a variation to specific targets based on their key.\n\nYou can add, update, or remove a scheduled removal date. You can only schedule a target for removal on a single variation per flag.\n\nUpdating an expiring target uses the semantic patch format. To make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch).\n\n### Instructions\n\nSemantic patch requests support the following `kind` instructions for updating expiring user targets.\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand instructions for \u003cstrong\u003eupdating expiring user targets\u003c/strong\u003e\u003c/summary\u003e\n\n#### addExpireUserTargetDate\n\nAdds a date and time that LaunchDarkly will remove the user from the flag's individual targeting.\n\n##### Parameters\n\n* `value`: The time, in Unix milliseconds, when LaunchDarkly should remove the user from individual targeting for this flag\n* `variationId`: ID of a variation on the flag\n* `userKey`: The user key for the user to remove from individual targeting\n\n#### updateExpireUserTargetDate\n\nUpdates the date and time that LaunchDarkly will remove the user from the flag's individual targeting.\n\n##### Parameters\n\n* `value`: The time, in Unix milliseconds, when LaunchDarkly should remove the user from individual targeting for this flag\n* `variationId`: ID of a variation on the flag\n* `userKey`: The user key for the user to remove from individual targeting\n* `version`: (Optional) The version of the expiring user target to update. If included, update will fail if version doesn't match current version of the expiring user target.\n\n#### removeExpireUserTargetDate\n\nRemoves the scheduled removal of the user from the flag's individual targeting. The user will remain part of the flag's individual targeting until you explicitly remove them, or until you schedule another removal.\n\n##### Parameters\n\n* `variationId`: ID of a variation on the flag\n* `userKey`: The user key for the user to remove from individual targeting\n\n\u003c/details\u003e\n", + Use: "update-expiring-user-targets", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", + }, + }, + HTTPMethod: "PATCH", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/flags/{projectKey}/{featureFlagKey}/expiring-user-targets/{environmentKey}", + SupportsSemanticPatch: true, + }) + + NewOperationCmd(gen_FeatureFlagsResourceCmd, client, OperationData{ + Short: "Update feature flag", + Long: "Perform a partial update to a feature flag. The request body must be a valid semantic patch, JSON patch, or JSON merge patch. To learn more the different formats, read [Updates](/#section/Overview/Updates).\n\n### Using semantic patches on a feature flag\n\nTo make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch).\n\nThe body of a semantic patch request for updating feature flags takes the following properties:\n\n* `comment` (string): (Optional) A description of the update.\n* `environmentKey` (string): (Required for some instructions only) The key of the LaunchDarkly environment.\n* `instructions` (array): (Required) A list of actions the update should perform. Each action in the list must be an object with a `kind` property that indicates the instruction. If the action requires parameters, you must include those parameters as additional fields in the object. The body of a single semantic patch can contain many different instructions.\n\n### Instructions\n\nSemantic patch requests support the following `kind` instructions for updating feature flags.\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand instructions for \u003cstrong\u003eturning flags on and off\u003c/strong\u003e\u003c/summary\u003e\n\nThese instructions require the `environmentKey` parameter.\n\n#### turnFlagOff\n\nSets the flag's targeting state to **Off**.\n\nHere's an example:\n\n```json\n{\n \"environmentKey\": \"environment-key-123abc\",\n \"instructions\": [ { \"kind\": \"turnFlagOff\" } ]\n}\n```\n\n#### turnFlagOn\n\nSets the flag's targeting state to **On**.\n\nHere's an example:\n\n```json\n{\n \"environmentKey\": \"environment-key-123abc\",\n \"instructions\": [ { \"kind\": \"turnFlagOn\" } ]\n}\n```\n\n\u003c/details\u003e\u003cbr /\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand instructions for \u003cstrong\u003eworking with targeting and variations\u003c/strong\u003e\u003c/summary\u003e\n\nThese instructions require the `environmentKey` parameter.\n\nSeveral of the instructions for working with targeting and variations require flag rule IDs, variation IDs, or clause IDs as parameters. Each of these are returned as part of the [Get feature flag](/tag/Feature-flags#operation/getFeatureFlag) response. The flag rule ID is the `_id` field of each element in the `rules` array within each environment listed in the `environments` object. The variation ID is the `_id` field in each element of the `variations` array. The clause ID is the `_id` field of each element of the `clauses` array within the `rules` array within each environment listed in the `environments` object.\n\n#### addClauses\n\nAdds the given clauses to the rule indicated by `ruleId`.\n\n##### Parameters\n\n- `ruleId`: ID of a rule in the flag.\n- `clauses`: Array of clause objects, with `contextKind` (string), `attribute` (string), `op` (string), `negate` (boolean), and `values` (array of strings, numbers, or dates) properties. The `contextKind`, `attribute`, and `values` are case sensitive. The `op` must be lower-case.\n\nHere's an example:\n\n```json\n{\n\t\"environmentKey\": \"environment-key-123abc\",\n\t\"instructions\": [{\n\t\t\"kind\": \"addClauses\",\n\t\t\"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\",\n\t\t\"clauses\": [{\n\t\t\t\"contextKind\": \"user\",\n\t\t\t\"attribute\": \"country\",\n\t\t\t\"op\": \"in\",\n\t\t\t\"negate\": false,\n\t\t\t\"values\": [\"USA\", \"Canada\"]\n\t\t}]\n\t}]\n}\n```\n\n#### addPrerequisite\n\nAdds the flag indicated by `key` with variation `variationId` as a prerequisite to the flag in the path parameter.\n\n##### Parameters\n\n- `key`: Flag key of the prerequisite flag.\n- `variationId`: ID of a variation of the prerequisite flag.\n\nHere's an example:\n\n```json\n{\n\t\"environmentKey\": \"environment-key-123abc\",\n\t\"instructions\": [{\n\t\t\"kind\": \"addPrerequisite\",\n\t\t\"key\": \"example-prereq-flag-key\",\n\t\t\"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\"\n\t}]\n}\n```\n\n#### addRule\n\nAdds a new targeting rule to the flag. The rule may contain `clauses` and serve the variation that `variationId` indicates, or serve a percentage rollout that `rolloutWeights`, `rolloutBucketBy`, and `rolloutContextKind` indicate.\n\nIf you set `beforeRuleId`, this adds the new rule before the indicated rule. Otherwise, adds the new rule to the end of the list.\n\n##### Parameters\n\n- `clauses`: Array of clause objects, with `contextKind` (string), `attribute` (string), `op` (string), `negate` (boolean), and `values` (array of strings, numbers, or dates) properties. The `contextKind`, `attribute`, and `values` are case sensitive. The `op` must be lower-case.\n- `beforeRuleId`: (Optional) ID of a flag rule.\n- Either\n - `variationId`: ID of a variation of the flag.\n\n or\n\n - `rolloutWeights`: (Optional) Map of `variationId` to weight, in thousandths of a percent (0-100000).\n - `rolloutBucketBy`: (Optional) Context attribute available in the specified `rolloutContextKind`.\n - `rolloutContextKind`: (Optional) Context kind, defaults to `user`\n\nHere's an example that uses a `variationId`:\n\n```json\n{\n \"environmentKey\": \"environment-key-123abc\",\n \"instructions\": [{\n \"kind\": \"addRule\",\n \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\",\n \"clauses\": [{\n \"contextKind\": \"organization\",\n \"attribute\": \"located_in\",\n \"op\": \"in\",\n \"negate\": false,\n \"values\": [\"Sweden\", \"Norway\"]\n }]\n }]\n}\n```\n\nHere's an example that uses a percentage rollout:\n\n```json\n{\n \"environmentKey\": \"environment-key-123abc\",\n \"instructions\": [{\n \"kind\": \"addRule\",\n \"clauses\": [{\n \"contextKind\": \"organization\",\n \"attribute\": \"located_in\",\n \"op\": \"in\",\n \"negate\": false,\n \"values\": [\"Sweden\", \"Norway\"]\n }],\n \"rolloutContextKind\": \"organization\",\n \"rolloutWeights\": {\n \"2f43f67c-3e4e-4945-a18a-26559378ca00\": 15000, // serve 15% this variation\n \"e5830889-1ec5-4b0c-9cc9-c48790090c43\": 85000 // serve 85% this variation\n }\n }]\n}\n```\n\n#### addTargets\n\nAdds context keys to the individual context targets for the context kind that `contextKind` specifies and the variation that `variationId` specifies. Returns an error if this causes the flag to target the same context key in multiple variations.\n\n##### Parameters\n\n- `values`: List of context keys.\n- `contextKind`: (Optional) Context kind to target, defaults to `user`\n- `variationId`: ID of a variation on the flag.\n\nHere's an example:\n\n```json\n{\n\t\"environmentKey\": \"environment-key-123abc\",\n\t\"instructions\": [{\n\t\t\"kind\": \"addTargets\",\n\t\t\"values\": [\"context-key-123abc\", \"context-key-456def\"],\n\t\t\"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\"\n\t}]\n}\n```\n\n#### addUserTargets\n\nAdds user keys to the individual user targets for the variation that `variationId` specifies. Returns an error if this causes the flag to target the same user key in multiple variations. If you are working with contexts, use `addTargets` instead of this instruction.\n\n##### Parameters\n\n- `values`: List of user keys.\n- `variationId`: ID of a variation on the flag.\n\nHere's an example:\n\n```json\n{\n\t\"environmentKey\": \"environment-key-123abc\",\n\t\"instructions\": [{\n\t\t\"kind\": \"addUserTargets\",\n\t\t\"values\": [\"user-key-123abc\", \"user-key-456def\"],\n\t\t\"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\"\n\t}]\n}\n```\n\n#### addValuesToClause\n\nAdds `values` to the values of the clause that `ruleId` and `clauseId` indicate. Does not update the context kind, attribute, or operator.\n\n##### Parameters\n\n- `ruleId`: ID of a rule in the flag.\n- `clauseId`: ID of a clause in that rule.\n- `values`: Array of strings, case sensitive.\n\nHere's an example:\n\n```json\n{\n\t\"environmentKey\": \"environment-key-123abc\",\n\t\"instructions\": [{\n\t\t\"kind\": \"addValuesToClause\",\n\t\t\"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\",\n\t\t\"clauseId\": \"10a58772-3121-400f-846b-b8a04e8944ed\",\n\t\t\"values\": [\"beta_testers\"]\n\t}]\n}\n```\n\n#### addVariation\n\nAdds a variation to the flag.\n\n##### Parameters\n\n- `value`: The variation value.\n- `name`: (Optional) The variation name.\n- `description`: (Optional) A description for the variation.\n\nHere's an example:\n\n```json\n{\n\t\"instructions\": [ { \"kind\": \"addVariation\", \"value\": 20, \"name\": \"New variation\" } ]\n}\n```\n\n#### clearTargets\n\nRemoves all individual targets from the variation that `variationId` specifies. This includes both user and non-user targets.\n\n##### Parameters\n\n- `variationId`: ID of a variation on the flag.\n\nHere's an example:\n\n```json\n{\n \"environmentKey\": \"environment-key-123abc\",\n \"instructions\": [ { \"kind\": \"clearTargets\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" } ]\n}\n```\n\n#### clearUserTargets\n\nRemoves all individual user targets from the variation that `variationId` specifies. If you are working with contexts, use `clearTargets` instead of this instruction.\n\n##### Parameters\n\n- `variationId`: ID of a variation on the flag.\n\nHere's an example:\n\n```json\n{\n \"environmentKey\": \"environment-key-123abc\",\n \"instructions\": [ { \"kind\": \"clearUserTargets\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" } ]\n}\n```\n\n#### removeClauses\n\nRemoves the clauses specified by `clauseIds` from the rule indicated by `ruleId`.\n\n##### Parameters\n\n- `ruleId`: ID of a rule in the flag.\n- `clauseIds`: Array of IDs of clauses in the rule.\n\nHere's an example:\n\n```json\n{\n\t\"environmentKey\": \"environment-key-123abc\",\n\t\"instructions\": [{\n\t\t\"kind\": \"removeClauses\",\n\t\t\"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\",\n\t\t\"clauseIds\": [\"10a58772-3121-400f-846b-b8a04e8944ed\", \"36a461dc-235e-4b08-97b9-73ce9365873e\"]\n\t}]\n}\n```\n\n#### removePrerequisite\n\nRemoves the prerequisite flag indicated by `key`. Does nothing if this prerequisite does not exist.\n\n##### Parameters\n\n- `key`: Flag key of an existing prerequisite flag.\n\nHere's an example:\n\n```json\n{\n \"environmentKey\": \"environment-key-123abc\",\n \"instructions\": [ { \"kind\": \"removePrerequisite\", \"key\": \"prereq-flag-key-123abc\" } ]\n}\n```\n\n#### removeRule\n\nRemoves the targeting rule specified by `ruleId`. Does nothing if the rule does not exist.\n\n##### Parameters\n\n- `ruleId`: ID of a rule in the flag.\n\nHere's an example:\n\n```json\n{\n \"environmentKey\": \"environment-key-123abc\",\n \"instructions\": [ { \"kind\": \"removeRule\", \"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\" } ]\n}\n```\n\n#### removeTargets\n\nRemoves context keys from the individual context targets for the context kind that `contextKind` specifies and the variation that `variationId` specifies. Does nothing if the flag does not target the context keys.\n\n##### Parameters\n\n- `values`: List of context keys.\n- `contextKind`: (Optional) Context kind to target, defaults to `user`\n- `variationId`: ID of a flag variation.\n\nHere's an example:\n\n```json\n{\n\t\"environmentKey\": \"environment-key-123abc\",\n\t\"instructions\": [{\n\t\t\"kind\": \"removeTargets\",\n\t\t\"values\": [\"context-key-123abc\", \"context-key-456def\"],\n\t\t\"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\"\n\t}]\n}\n```\n\n#### removeUserTargets\n\nRemoves user keys from the individual user targets for the variation that `variationId` specifies. Does nothing if the flag does not target the user keys. If you are working with contexts, use `removeTargets` instead of this instruction.\n\n##### Parameters\n\n- `values`: List of user keys.\n- `variationId`: ID of a flag variation.\n\nHere's an example:\n\n```json\n{\n\t\"environmentKey\": \"environment-key-123abc\",\n\t\"instructions\": [{\n\t\t\"kind\": \"removeUserTargets\",\n\t\t\"values\": [\"user-key-123abc\", \"user-key-456def\"],\n\t\t\"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\"\n\t}]\n}\n```\n\n#### removeValuesFromClause\n\nRemoves `values` from the values of the clause indicated by `ruleId` and `clauseId`. Does not update the context kind, attribute, or operator.\n\n##### Parameters\n\n- `ruleId`: ID of a rule in the flag.\n- `clauseId`: ID of a clause in that rule.\n- `values`: Array of strings, case sensitive.\n\nHere's an example:\n\n```json\n{\n\t\"environmentKey\": \"environment-key-123abc\",\n\t\"instructions\": [{\n\t\t\"kind\": \"removeValuesFromClause\",\n\t\t\"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\",\n\t\t\"clauseId\": \"10a58772-3121-400f-846b-b8a04e8944ed\",\n\t\t\"values\": [\"beta_testers\"]\n\t}]\n}\n```\n\n#### removeVariation\n\nRemoves a variation from the flag.\n\n##### Parameters\n\n- `variationId`: ID of a variation of the flag to remove.\n\nHere's an example:\n\n```json\n{\n\t\"instructions\": [ { \"kind\": \"removeVariation\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" } ]\n}\n```\n\n#### reorderRules\n\nRearranges the rules to match the order given in `ruleIds`. Returns an error if `ruleIds` does not match the current set of rules on the flag.\n\n##### Parameters\n\n- `ruleIds`: Array of IDs of all rules in the flag.\n\nHere's an example:\n\n```json\n{\n\t\"environmentKey\": \"environment-key-123abc\",\n\t\"instructions\": [{\n\t\t\"kind\": \"reorderRules\",\n\t\t\"ruleIds\": [\"a902ef4a-2faf-4eaf-88e1-ecc356708a29\", \"63c238d1-835d-435e-8f21-c8d5e40b2a3d\"]\n\t}]\n}\n```\n\n#### replacePrerequisites\n\nRemoves all existing prerequisites and replaces them with the list you provide.\n\n##### Parameters\n\n- `prerequisites`: A list of prerequisites. Each item in the list must include a flag `key` and `variationId`.\n\nHere's an example:\n\n```json\n{\n \"environmentKey\": \"environment-key-123abc\",\n \"instructions\": [\n {\n \"kind\": \"replacePrerequisites\",\n \"prerequisites\": [\n {\n \"key\": \"prereq-flag-key-123abc\",\n \"variationId\": \"10a58772-3121-400f-846b-b8a04e8944ed\"\n },\n {\n \"key\": \"another-prereq-flag-key-456def\",\n \"variationId\": \"e5830889-1ec5-4b0c-9cc9-c48790090c43\"\n }\n ]\n }\n ]\n}\n```\n\n#### replaceRules\n\nRemoves all targeting rules for the flag and replaces them with the list you provide.\n\n##### Parameters\n\n- `rules`: A list of rules.\n\nHere's an example:\n\n```json\n{\n \"environmentKey\": \"environment-key-123abc\",\n \"instructions\": [\n {\n \"kind\": \"replaceRules\",\n \"rules\": [\n {\n \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\",\n \"description\": \"My new rule\",\n \"clauses\": [\n {\n \"contextKind\": \"user\",\n \"attribute\": \"segmentMatch\",\n \"op\": \"segmentMatch\",\n \"values\": [\"test\"]\n }\n ],\n \"trackEvents\": true\n }\n ]\n }\n ]\n}\n```\n\n#### replaceTargets\n\nRemoves all existing targeting and replaces it with the list of targets you provide.\n\n##### Parameters\n\n- `targets`: A list of context targeting. Each item in the list includes an optional `contextKind` that defaults to `user`, a required `variationId`, and a required list of `values`.\n\nHere's an example:\n\n```json\n{\n \"environmentKey\": \"environment-key-123abc\",\n \"instructions\": [\n {\n \"kind\": \"replaceTargets\",\n \"targets\": [\n {\n \"contextKind\": \"user\",\n \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\",\n \"values\": [\"user-key-123abc\"]\n },\n {\n \"contextKind\": \"device\",\n \"variationId\": \"e5830889-1ec5-4b0c-9cc9-c48790090c43\",\n \"values\": [\"device-key-456def\"]\n }\n ]\n } \n ]\n}\n```\n\n#### replaceUserTargets\n\nRemoves all existing user targeting and replaces it with the list of targets you provide. In the list of targets, you must include a target for each of the flag's variations. If you are working with contexts, use `replaceTargets` instead of this instruction.\n\n##### Parameters\n\n- `targets`: A list of user targeting. Each item in the list must include a `variationId` and a list of `values`.\n\nHere's an example:\n\n```json\n{\n \"environmentKey\": \"environment-key-123abc\",\n \"instructions\": [\n {\n \"kind\": \"replaceUserTargets\",\n \"targets\": [\n {\n \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\",\n \"values\": [\"user-key-123abc\", \"user-key-456def\"]\n },\n {\n \"variationId\": \"e5830889-1ec5-4b0c-9cc9-c48790090c43\",\n \"values\": [\"user-key-789ghi\"]\n }\n ]\n }\n ]\n}\n```\n\n#### updateClause\n\nReplaces the clause indicated by `ruleId` and `clauseId` with `clause`.\n\n##### Parameters\n\n- `ruleId`: ID of a rule in the flag.\n- `clauseId`: ID of a clause in that rule.\n- `clause`: New `clause` object, with `contextKind` (string), `attribute` (string), `op` (string), `negate` (boolean), and `values` (array of strings, numbers, or dates) properties. The `contextKind`, `attribute`, and `values` are case sensitive. The `op` must be lower-case.\n\nHere's an example:\n\n```json\n{\n \"environmentKey\": \"environment-key-123abc\",\n \"instructions\": [{\n \"kind\": \"updateClause\",\n \"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\",\n \"clauseId\": \"10c7462a-2062-45ba-a8bb-dfb3de0f8af5\",\n \"clause\": {\n \"contextKind\": \"user\",\n \"attribute\": \"country\",\n \"op\": \"in\",\n \"negate\": false,\n \"values\": [\"Mexico\", \"Canada\"]\n }\n }]\n}\n```\n\n#### updateDefaultVariation\n\nUpdates the default on or off variation of the flag.\n\n##### Parameters\n\n- `onVariationValue`: (Optional) The value of the variation of the new on variation.\n- `offVariationValue`: (Optional) The value of the variation of the new off variation\n\nHere's an example:\n\n```json\n{\n\t\"instructions\": [ { \"kind\": \"updateDefaultVariation\", \"OnVariationValue\": true, \"OffVariationValue\": false } ]\n}\n```\n\n#### updateFallthroughVariationOrRollout\n\nUpdates the default or \"fallthrough\" rule for the flag, which the flag serves when a context matches none of the targeting rules. The rule can serve either the variation that `variationId` indicates, or a percentage rollout that `rolloutWeights` and `rolloutBucketBy` indicate.\n\n##### Parameters\n\n- `variationId`: ID of a variation of the flag.\n\nor\n\n- `rolloutWeights`: Map of `variationId` to weight, in thousandths of a percent (0-100000).\n- `rolloutBucketBy`: (Optional) Context attribute available in the specified `rolloutContextKind`.\n- `rolloutContextKind`: (Optional) Context kind, defaults to `user`\n\nHere's an example that uses a `variationId`:\n\n```json\n{\n\t\"environmentKey\": \"environment-key-123abc\",\n\t\"instructions\": [{\n\t\t\"kind\": \"updateFallthroughVariationOrRollout\",\n\t\t\"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\"\n\t}]\n}\n```\n\nHere's an example that uses a percentage rollout:\n\n```json\n{\n\t\"environmentKey\": \"environment-key-123abc\",\n\t\"instructions\": [{\n\t\t\"kind\": \"updateFallthroughVariationOrRollout\",\n\t\t\"rolloutContextKind\": \"user\",\n\t\t\"rolloutWeights\": {\n\t\t\t\"2f43f67c-3e4e-4945-a18a-26559378ca00\": 15000, // serve 15% this variation\n\t\t\t\"e5830889-1ec5-4b0c-9cc9-c48790090c43\": 85000 // serve 85% this variation\n\t\t}\n\t}]\n}\n```\n\n#### updateOffVariation\n\nUpdates the default off variation to `variationId`. The flag serves the default off variation when the flag's targeting is **Off**.\n\n##### Parameters\n\n- `variationId`: ID of a variation of the flag.\n\nHere's an example:\n\n```json\n{\n \"environmentKey\": \"environment-key-123abc\",\n \"instructions\": [ { \"kind\": \"updateOffVariation\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" } ]\n}\n```\n\n#### updatePrerequisite\n\nChanges the prerequisite flag that `key` indicates to use the variation that `variationId` indicates. Returns an error if this prerequisite does not exist.\n\n##### Parameters\n\n- `key`: Flag key of an existing prerequisite flag.\n- `variationId`: ID of a variation of the prerequisite flag.\n\nHere's an example:\n\n```json\n{\n\t\"environmentKey\": \"environment-key-123abc\",\n\t\"instructions\": [{\n\t\t\"kind\": \"updatePrerequisite\",\n\t\t\"key\": \"example-prereq-flag-key\",\n\t\t\"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\"\n\t}]\n}\n```\n\n#### updateRuleDescription\n\nUpdates the description of the feature flag rule.\n\n##### Parameters\n\n- `description`: The new human-readable description for this rule.\n- `ruleId`: The ID of the rule. You can retrieve this by making a GET request for the flag.\n\nHere's an example:\n\n```json\n{\n\t\"environmentKey\": \"environment-key-123abc\",\n\t\"instructions\": [{\n\t\t\"kind\": \"updateRuleDescription\",\n\t\t\"description\": \"New rule description\",\n\t\t\"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\"\n\t}]\n}\n```\n\n#### updateRuleTrackEvents\n\nUpdates whether or not LaunchDarkly tracks events for the feature flag associated with this rule.\n\n##### Parameters\n\n- `ruleId`: The ID of the rule. You can retrieve this by making a GET request for the flag.\n- `trackEvents`: Whether or not events are tracked.\n\nHere's an example:\n\n```json\n{\n\t\"environmentKey\": \"environment-key-123abc\",\n\t\"instructions\": [{\n\t\t\"kind\": \"updateRuleTrackEvents\",\n\t\t\"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\",\n\t\t\"trackEvents\": true\n\t}]\n}\n```\n\n#### updateRuleVariationOrRollout\n\nUpdates what `ruleId` serves when its clauses evaluate to true. The rule can serve either the variation that `variationId` indicates, or a percent rollout that `rolloutWeights` and `rolloutBucketBy` indicate.\n\n##### Parameters\n\n- `ruleId`: ID of a rule in the flag.\n- `variationId`: ID of a variation of the flag.\n\n or\n\n- `rolloutWeights`: Map of `variationId` to weight, in thousandths of a percent (0-100000).\n- `rolloutBucketBy`: (Optional) Context attribute available in the specified `rolloutContextKind`.\n- `rolloutContextKind`: (Optional) Context kind, defaults to `user`\n\nHere's an example:\n\n```json\n{\n\t\"environmentKey\": \"environment-key-123abc\",\n\t\"instructions\": [{\n\t\t\"kind\": \"updateRuleVariationOrRollout\",\n\t\t\"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\",\n\t\t\"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\"\n\t}]\n}\n```\n\n#### updateTrackEvents\n\nUpdates whether or not LaunchDarkly tracks events for the feature flag, for all rules.\n\n##### Parameters\n\n- `trackEvents`: Whether or not events are tracked.\n\nHere's an example:\n\n```json\n{\n \"environmentKey\": \"environment-key-123abc\",\n \"instructions\": [ { \"kind\": \"updateTrackEvents\", \"trackEvents\": true } ]\n}\n```\n\n#### updateTrackEventsFallthrough\n\nUpdates whether or not LaunchDarkly tracks events for the feature flag, for the default rule.\n\n##### Parameters\n\n- `trackEvents`: Whether or not events are tracked.\n\nHere's an example:\n\n```json\n{\n \"environmentKey\": \"environment-key-123abc\",\n \"instructions\": [ { \"kind\": \"updateTrackEventsFallthrough\", \"trackEvents\": true } ]\n}\n```\n\n#### updateVariation\n\nUpdates a variation of the flag.\n\n##### Parameters\n\n- `variationId`: The ID of the variation to update.\n- `name`: (Optional) The updated variation name.\n- `value`: (Optional) The updated variation value.\n- `description`: (Optional) The updated variation description.\n\nHere's an example:\n\n```json\n{\n\t\"instructions\": [ { \"kind\": \"updateVariation\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\", \"value\": 20 } ]\n}\n```\n\n\u003c/details\u003e\u003cbr /\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand instructions for \u003cstrong\u003eupdating flag settings\u003c/strong\u003e\u003c/summary\u003e\n\nThese instructions do not require the `environmentKey` parameter. They make changes that apply to the flag across all environments.\n\n#### addCustomProperties\n\nAdds a new custom property to the feature flag. Custom properties are used to associate feature flags with LaunchDarkly integrations. For example, if you create an integration with an issue tracking service, you may want to associate a flag with a list of issues related to a feature's development.\n\n##### Parameters\n\n - `key`: The custom property key.\n - `name`: The custom property name.\n - `values`: A list of the associated values for the custom property.\n\nHere's an example:\n\n```json\n{\n\t\"instructions\": [{\n\t\t\"kind\": \"addCustomProperties\",\n\t\t\"key\": \"example-custom-property\",\n\t\t\"name\": \"Example custom property\",\n\t\t\"values\": [\"value1\", \"value2\"]\n\t}]\n}\n```\n\n#### addTags\n\nAdds tags to the feature flag.\n\n##### Parameters\n\n- `values`: A list of tags to add.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [ { \"kind\": \"addTags\", \"values\": [\"tag1\", \"tag2\"] } ]\n}\n```\n\n#### makeFlagPermanent\n\nMarks the feature flag as permanent. LaunchDarkly does not prompt you to remove permanent flags, even if one variation is rolled out to all your customers.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [ { \"kind\": \"makeFlagPermanent\" } ]\n}\n```\n\n#### makeFlagTemporary\n\nMarks the feature flag as temporary.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [ { \"kind\": \"makeFlagTemporary\" } ]\n}\n```\n\n#### removeCustomProperties\n\nRemoves the associated values from a custom property. If all the associated values are removed, this instruction also removes the custom property.\n\n##### Parameters\n\n - `key`: The custom property key.\n - `values`: A list of the associated values to remove from the custom property.\n\n```json\n{\n\t\"instructions\": [{\n\t\t\"kind\": \"replaceCustomProperties\",\n\t\t\"key\": \"example-custom-property\",\n\t\t\"values\": [\"value1\", \"value2\"]\n\t}]\n}\n```\n\n#### removeMaintainer\n\nRemoves the flag's maintainer. To set a new maintainer, use the flag's **Settings** tab in the LaunchDarkly user interface.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [ { \"kind\": \"removeMaintainer\" } ]\n}\n```\n\n#### removeTags\n\nRemoves tags from the feature flag.\n\n##### Parameters\n\n- `values`: A list of tags to remove.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [ { \"kind\": \"removeTags\", \"values\": [\"tag1\", \"tag2\"] } ]\n}\n```\n\n#### replaceCustomProperties\n\nReplaces the existing associated values for a custom property with the new values.\n\n##### Parameters\n\n - `key`: The custom property key.\n - `name`: The custom property name.\n - `values`: A list of the new associated values for the custom property.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"replaceCustomProperties\",\n \"key\": \"example-custom-property\",\n \"name\": \"Example custom property\",\n \"values\": [\"value1\", \"value2\"]\n }]\n}\n```\n\n#### turnOffClientSideAvailability\n\nTurns off client-side SDK availability for the flag. This is equivalent to unchecking the **SDKs using Mobile Key** and/or **SDKs using client-side ID** boxes for the flag. If you're using a client-side or mobile SDK, you must expose your feature flags in order for the client-side or mobile SDKs to evaluate them.\n\n##### Parameters\n\n- `value`: Use \"usingMobileKey\" to turn off availability for mobile SDKs. Use \"usingEnvironmentId\" to turn on availability for client-side SDKs.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [ { \"kind\": \"turnOffClientSideAvailability\", \"value\": \"usingMobileKey\" } ]\n}\n```\n\n#### turnOnClientSideAvailability\n\nTurns on client-side SDK availability for the flag. This is equivalent to unchecking the **SDKs using Mobile Key** and/or **SDKs using client-side ID** boxes for the flag. If you're using a client-side or mobile SDK, you must expose your feature flags in order for the client-side or mobile SDKs to evaluate them.\n\n##### Parameters\n\n- `value`: Use \"usingMobileKey\" to turn on availability for mobile SDKs. Use \"usingEnvironmentId\" to turn on availability for client-side SDKs.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [ { \"kind\": \"turnOnClientSideAvailability\", \"value\": \"usingMobileKey\" } ]\n}\n```\n\n#### updateDescription\n\nUpdates the feature flag description.\n\n##### Parameters\n\n- `value`: The new description.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [ { \"kind\": \"updateDescription\", \"value\": \"Updated flag description\" } ]\n}\n```\n#### updateMaintainerMember\n\nUpdates the maintainer of the flag to an existing member and removes the existing maintainer.\n\n##### Parameters\n\n- `value`: The ID of the member.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [ { \"kind\": \"updateMaintainerMember\", \"value\": \"61e9b714fd47591727db558a\" } ]\n}\n```\n\n#### updateMaintainerTeam\n\nUpdates the maintainer of the flag to an existing team and removes the existing maintainer.\n\n##### Parameters\n\n- `value`: The key of the team.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [ { \"kind\": \"updateMaintainerTeam\", \"value\": \"example-team-key\" } ]\n}\n```\n\n#### updateName\n\nUpdates the feature flag name.\n\n##### Parameters\n\n- `value`: The new name.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [ { \"kind\": \"updateName\", \"value\": \"Updated flag name\" } ]\n}\n```\n\n\u003c/details\u003e\u003cbr /\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand instructions for \u003cstrong\u003eupdating the flag lifecycle\u003c/strong\u003e\u003c/summary\u003e\n\nThese instructions do not require the `environmentKey` parameter. They make changes that apply to the flag across all environments.\n\n#### archiveFlag\n\nArchives the feature flag. This retires it from LaunchDarkly without deleting it. You cannot archive a flag that is a prerequisite of other flags.\n\n```json\n{\n \"instructions\": [ { \"kind\": \"archiveFlag\" } ]\n}\n```\n\n#### deleteFlag\n\nDeletes the feature flag and its rules. You cannot restore a deleted flag. If this flag is requested again, the flag value defined in code will be returned for all contexts.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [ { \"kind\": \"deleteFlag\" } ]\n}\n```\n\n#### deprecateFlag\n\nDeprecates the feature flag. This hides it from the live flags list without archiving or deleting it.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [ { \"kind\": \"deprecateFlag\" } ]\n}\n```\n\n#### restoreDeprecatedFlag\n\nRestores the feature flag if it was previously deprecated.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [ { \"kind\": \"restoreDeprecatedFlag\" } ]\n}\n```\n\n#### restoreFlag\n\nRestores the feature flag if it was previously archived.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [ { \"kind\": \"restoreFlag\" } ]\n}\n```\n\n\u003c/details\u003e\n\n### Using JSON patches on a feature flag\n\nIf you do not include the semantic patch header described above, you can use a [JSON patch](/reference#updates-using-json-patch) or [JSON merge patch](https://datatracker.ietf.org/doc/html/rfc7386) representation of the desired changes.\n\nIn the JSON patch representation, use a JSON pointer in the `path` element to describe what field to change. Use the [Get feature flag](/tag/Feature-flags#operation/getFeatureFlag) endpoint to find the field you want to update.\n\nThere are a few special cases to keep in mind when determining the value of the `path` element:\n\n * To add an individual target to a specific variation if the flag variation already has individual targets, the path for the JSON patch operation is:\n\n ```json\n [\n {\n \"op\": \"add\",\n \"path\": \"/environments/devint/targets/0/values/-\",\n \"value\": \"TestClient10\"\n }\n ]\n ```\n\n * To add an individual target to a specific variation if the flag variation does not already have individual targets, the path for the JSON patch operation is:\n\n ```json\n [\n {\n \"op\": \"add\",\n \"path\": \"/environments/devint/targets/-\",\n \"value\": { \"variation\": 0, \"values\": [\"TestClient10\"] }\n }\n ]\n ```\n\n * To add a flag to a release pipeline, the path for the JSON patch operation is:\n\n ```json\n [\n {\n \"op\": \"add\",\n \"path\": \"/releasePipelineKey\",\n \"value\": \"example-release-pipeline-key\"\n }\n ]\n ```\n\n### Required approvals\nIf a request attempts to alter a flag configuration in an environment where approvals are required for the flag, the request will fail with a 405. Changes to the flag configuration in that environment will require creating an [approval request](/tag/Approvals) or a [workflow](/tag/Workflows).\n\n### Conflicts\nIf a flag configuration change made through this endpoint would cause a pending scheduled change or approval request to fail, this endpoint will return a 400. You can ignore this check by adding an `ignoreConflicts` query parameter set to `true`.\n\n### Migration flags\nFor migration flags, the cohort information is included in the `rules` property of a flag's response. You can update cohorts by updating `rules`. Default cohort information is included in the `fallthrough` property of a flag's response. You can update the default cohort by updating `fallthrough`.\nWhen you update the rollout for a cohort or the default cohort through the API, provide a rollout instead of a single `variationId`.\nTo learn more, read [Migration Flags](https://docs.launchdarkly.com/home/flag-types/migration-flags).\n", + Use: "update", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key. The key identifies the flag in your code.", + Type: "string", + }, + }, + HTTPMethod: "PATCH", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/flags/{projectKey}/{featureFlagKey}", + SupportsSemanticPatch: true, + }) + + NewOperationCmd(gen_FeatureFlagsResourceCmd, client, OperationData{ + Short: "Create a feature flag", + Long: "Create a feature flag with the given name, key, and variations.\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand instructions for \u003cstrong\u003ecreating a migration flag\u003c/strong\u003e\u003c/summary\u003e\n\n### Creating a migration flag\n\nWhen you create a migration flag, the variations are pre-determined based on the number of stages in the migration.\n\nTo create a migration flag, omit the `variations` and `defaults` information. Instead, provide a `purpose` of `migration`, and `migrationSettings`. If you create a migration flag with six stages, `contextKind` is required. Otherwise, it should be omitted.\n\nHere's an example:\n\n```json\n{\n \"key\": \"flag-key-123\",\n \"purpose\": \"migration\",\n \"migrationSettings\": {\n \"stageCount\": 6,\n \"contextKind\": \"account\"\n }\n}\n```\n\nTo learn more, read [Migration Flags](https://docs.launchdarkly.com/home/flag-types/migration-flags).\n\n\u003c/details\u003e\n", + Use: "create", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "clone", + In: "query", + Description: "The key of the feature flag to be cloned. The key identifies the flag in your code. For example, setting `clone=flagKey` copies the full targeting configuration for all environments, including `on/off` state, from the original flag to the new flag.", + Type: "string", + }, + }, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/flags/{projectKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_FeatureFlagsResourceCmd, client, OperationData{ + Short: "Get migration safety issues", + Long: "Returns the migration safety issues that are associated with the POSTed flag patch. The patch must use the semantic patch format for updating feature flags.", + Use: "create-migration-safety-issues", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "flag-key", + In: "path", + Description: "The migration flag key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + }, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/projects/{projectKey}/flags/{flagKey}/environments/{environmentKey}/migration-safety-issues", + SupportsSemanticPatch: true, + }) + + NewOperationCmd(gen_FollowFlagsResourceCmd, client, OperationData{ + Short: "Remove a member as a follower of a flag in a project and environment", + Long: "Remove a member as a follower to a flag in a project and environment", + Use: "delete-flag-followers", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "member-id", + In: "path", + Description: "The memberId of the member to remove as a follower of the flag. Reader roles can only remove themselves.", + Type: "string", + }, + }, + HTTPMethod: "DELETE", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/followers/{memberId}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_FollowFlagsResourceCmd, client, OperationData{ + Short: "Get followers of a flag in a project and environment", + Long: "Get a list of members following a flag in a project and environment", + Use: "list-flag-followers", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/followers", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_FollowFlagsResourceCmd, client, OperationData{ + Short: "Get followers of all flags in a given project and environment", + Long: "Get followers of all flags in a given environment and project", + Use: "list-followers-by-proj-env", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/projects/{projectKey}/environments/{environmentKey}/followers", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_FollowFlagsResourceCmd, client, OperationData{ + Short: "Add a member as a follower of a flag in a project and environment", + Long: "Add a member as a follower to a flag in a project and environment", + Use: "replace-flag-followers", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "member-id", + In: "path", + Description: "The memberId of the member to add as a follower of the flag. Reader roles can only add themselves.", + Type: "string", + }, + }, + HTTPMethod: "PUT", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/followers/{memberId}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_IntegrationAuditLogSubscriptionsResourceCmd, client, OperationData{ + Short: "Create audit log subscription", + Long: "Create an audit log subscription.\u003cbr /\u003e\u003cbr /\u003eFor each subscription, you must specify the set of resources you wish to subscribe to audit log notifications for. You can describe these resources using a custom role policy. To learn more, read [Custom role concepts](https://docs.launchdarkly.com/home/members/role-concepts).", + Use: "create-subscription", + Params: []Param{ + { + Name: "integration-key", + In: "path", + Description: "The integration key", + Type: "string", + }, + }, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/integrations/{integrationKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_IntegrationAuditLogSubscriptionsResourceCmd, client, OperationData{ + Short: "Delete audit log subscription", + Long: "Delete an audit log subscription.", + Use: "delete-subscription", + Params: []Param{ + { + Name: "integration-key", + In: "path", + Description: "The integration key", + Type: "string", + }, + { + Name: "id", + In: "path", + Description: "The subscription ID", + Type: "string", + }, + }, + HTTPMethod: "DELETE", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/integrations/{integrationKey}/{id}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_IntegrationAuditLogSubscriptionsResourceCmd, client, OperationData{ + Short: "Get audit log subscription by ID", + Long: "Get an audit log subscription by ID.", + Use: "get-subscription-by-id", + Params: []Param{ + { + Name: "integration-key", + In: "path", + Description: "The integration key", + Type: "string", + }, + { + Name: "id", + In: "path", + Description: "The subscription ID", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/integrations/{integrationKey}/{id}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_IntegrationAuditLogSubscriptionsResourceCmd, client, OperationData{ + Short: "Get audit log subscriptions by integration", + Long: "Get all audit log subscriptions associated with a given integration.", + Use: "list-subscriptions", + Params: []Param{ + { + Name: "integration-key", + In: "path", + Description: "The integration key", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/integrations/{integrationKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_IntegrationAuditLogSubscriptionsResourceCmd, client, OperationData{ + Short: "Update audit log subscription", + Long: "Update an audit log subscription configuration. Updating an audit log subscription uses a [JSON patch](https://datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes. To learn more, read [Updates](/#section/Overview/Updates).", + Use: "update-subscription", + Params: []Param{ + { + Name: "integration-key", + In: "path", + Description: "The integration key", + Type: "string", + }, + { + Name: "id", + In: "path", + Description: "The ID of the audit log subscription", + Type: "string", + }, + }, + HTTPMethod: "PATCH", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/integrations/{integrationKey}/{id}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_MembersResourceCmd, client, OperationData{ + Short: "Delete account member", + Long: "Delete a single account member by ID. Requests to delete account members will not work if SCIM is enabled for the account.", + Use: "delete", + Params: []Param{ + { + Name: "id", + In: "path", + Description: "The member ID", + Type: "string", + }, + }, + HTTPMethod: "DELETE", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/members/{id}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_MembersResourceCmd, client, OperationData{ + Short: "Get account member", + Long: "Get a single account member by member ID.\n\n`me` is a reserved value for the `id` parameter that returns the caller's member information.\n", + Use: "get", + Params: []Param{ + { + Name: "id", + In: "path", + Description: "The member ID", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/members/{id}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_MembersResourceCmd, client, OperationData{ + Short: "List account members", + Long: "Return a list of account members.\n\nBy default, this returns the first 20 members. Page through this list with the `limit` parameter and by following the `first`, `prev`, `next`, and `last` links in the returned `_links` field. These links are not present if the pages they refer to don't exist. For example, the `first` and `prev` links will be missing from the response on the first page.\n\n### Filtering members\n\nLaunchDarkly supports the following fields for filters:\n\n- `query` is a string that matches against the members' emails and names. It is not case sensitive.\n- `role` is a `|` separated list of roles and custom roles. It filters the list to members who have any of the roles in the list. For the purposes of this filtering, `Owner` counts as `Admin`.\n- `team` is a string that matches against the key of the teams the members belong to. It is not case sensitive.\n- `noteam` is a boolean that filters the list of members who are not on a team if true and members on a team if false.\n- `lastSeen` is a JSON object in one of the following formats:\n - `{\"never\": true}` - Members that have never been active, such as those who have not accepted their invitation to LaunchDarkly, or have not logged in after being provisioned via SCIM.\n - `{\"noData\": true}` - Members that have not been active since LaunchDarkly began recording last seen timestamps.\n - `{\"before\": 1608672063611}` - Members that have not been active since the provided value, which should be a timestamp in Unix epoch milliseconds.\n- `accessCheck` is a string that represents a specific action on a specific resource and is in the format `\u003cActionSpecifier\u003e:\u003cResourceSpecifier\u003e`. It filters the list to members who have the ability to perform that action on that resource. Note: `accessCheck` is only supported in API version `20220603` and earlier. To learn more, read [Versioning](https://apidocs.launchdarkly.com/#section/Overview/Versioning).\n - For example, the filter `accessCheck:createApprovalRequest:proj/default:env/test:flag/alternate-page` matches members with the ability to create an approval request for the `alternate-page` flag in the `test` environment of the `default` project.\n - Wildcard and tag filters are not supported when filtering for access.\n\nFor example, the filter `query:abc,role:admin|customrole` matches members with the string `abc` in their email or name, ignoring case, who also are either an `Owner` or `Admin` or have the custom role `customrole`.\n\n### Sorting members\n\nLaunchDarkly supports two fields for sorting: `displayName` and `lastSeen`:\n\n- `displayName` sorts by first + last name, using the member's email if no name is set.\n- `lastSeen` sorts by the `_lastSeen` property. LaunchDarkly considers members that have never been seen or have no data the oldest.\n", + Use: "list", + Params: []Param{ + { + Name: "limit", + In: "query", + Description: "The number of members to return in the response. Defaults to 20.", + Type: "integer", + }, + { + Name: "offset", + In: "query", + Description: "Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.", + Type: "integer", + }, + { + Name: "filter", + In: "query", + Description: "A comma-separated list of filters. Each filter is of the form `field:value`. Supported fields are explained above.", + Type: "string", + }, + { + Name: "sort", + In: "query", + Description: "A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order.", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/members", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_MembersResourceCmd, client, OperationData{ + Short: "Modify an account member", + Long: "\nUpdate a single account member. Updating a member uses a [JSON patch](https://datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes. To learn more, read [Updates](/#section/Overview/Updates).\n\nTo update fields in the account member object that are arrays, set the `path` to the name of the field and then append `/\u003carray index\u003e`. Use `/0` to add to the beginning of the array. Use `/-` to add to the end of the array. For example, to add a new custom role to a member, use the following request body:\n\n```\n [\n {\n \"op\": \"add\",\n \"path\": \"/customRoles/0\",\n \"value\": \"some-role-id\"\n }\n ]\n```\n\nYou can update only an account member's role or custom role using a JSON patch. Members can update their own names and email addresses though the LaunchDarkly UI.\n\nWhen SAML SSO or SCIM is enabled for the account, account members are managed in the Identity Provider (IdP). Requests to update account members will succeed, but the IdP will override the update shortly afterwards.\n", + Use: "update", + Params: []Param{ + { + Name: "id", + In: "path", + Description: "The member ID", + Type: "string", + }, + }, + HTTPMethod: "PATCH", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/members/{id}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_MembersResourceCmd, client, OperationData{ + Short: "Add a member to teams", + Long: "Add one member to one or more teams.", + Use: "create-teams", + Params: []Param{ + { + Name: "id", + In: "path", + Description: "The member ID", + Type: "string", + }, + }, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/members/{id}/teams", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_MembersResourceCmd, client, OperationData{ + Short: "Invite new members", + Long: "Invite one or more new members to join an account. Each member is sent an invitation. Members with \"admin\" or \"owner\" roles may create new members, as well as anyone with a \"createMember\" permission for \"member/\\*\". If a member cannot be invited, the entire request is rejected and no members are invited from that request.\n\nEach member _must_ have an `email` field and either a `role` or a `customRoles` field. If any of the fields are not populated correctly, the request is rejected with the reason specified in the \"message\" field of the response.\n\nRequests to create account members will not work if SCIM is enabled for the account.\n\n_No more than 50 members may be created per request._\n\nA request may also fail because of conflicts with existing members. These conflicts are reported using the additional `code` and `invalid_emails` response fields with the following possible values for `code`:\n\n- **email_already_exists_in_account**: A member with this email address already exists in this account.\n- **email_taken_in_different_account**: A member with this email address exists in another account.\n- **duplicate_email**s: This request contains two or more members with the same email address.\n\nA request that fails for one of the above reasons returns an HTTP response code of 400 (Bad Request).\n", + Use: "create", + Params: []Param{}, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/members", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_MetricsResourceCmd, client, OperationData{ + Short: "Delete metric", + Long: "Delete a metric by key.", + Use: "delete", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "metric-key", + In: "path", + Description: "The metric key", + Type: "string", + }, + }, + HTTPMethod: "DELETE", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/metrics/{projectKey}/{metricKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_MetricsResourceCmd, client, OperationData{ + Short: "Get metric", + Long: "Get information for a single metric from the specific project.\n\n### Expanding the metric response\nLaunchDarkly supports four fields for expanding the \"Get metric\" response. By default, these fields are **not** included in the response.\n\nTo expand the response, append the `expand` query parameter and add a comma-separated list with any of the following fields:\n\n- `experiments` includes all experiments from the specific project that use the metric\n- `experimentCount` includes the number of experiments from the specific project that use the metric\n- `metricGroups` includes all metric groups from the specific project that use the metric\n- `metricGroupCount` includes the number of metric groups from the specific project that use the metric\n\nFor example, `expand=experiments` includes the `experiments` field in the response.\n", + Use: "get", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "metric-key", + In: "path", + Description: "The metric key", + Type: "string", + }, + { + Name: "expand", + In: "query", + Description: "A comma-separated list of properties that can reveal additional information in the response.", + Type: "string", + }, + { + Name: "version-id", + In: "query", + Description: "The specific version ID of the metric", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/metrics/{projectKey}/{metricKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_MetricsResourceCmd, client, OperationData{ + Short: "List metrics", + Long: "Get a list of all metrics for the specified project.\n\n### Expanding the metric list response\nLaunchDarkly supports expanding the \"List metrics\" response. By default, the expandable field is **not** included in the response.\n\nTo expand the response, append the `expand` query parameter and add the following supported field:\n\n- `experimentCount` includes the number of experiments from the specific project that use the metric\n\nFor example, `expand=experimentCount` includes the `experimentCount` field for each metric in the response.\n", + Use: "list", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "expand", + In: "query", + Description: "A comma-separated list of properties that can reveal additional information in the response.", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/metrics/{projectKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_MetricsResourceCmd, client, OperationData{ + Short: "Update metric", + Long: "Patch a metric by key. Updating a metric uses a [JSON patch](https://datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes. To learn more, read [Updates](/#section/Overview/Updates).", + Use: "update", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "metric-key", + In: "path", + Description: "The metric key", + Type: "string", + }, + }, + HTTPMethod: "PATCH", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/metrics/{projectKey}/{metricKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_MetricsResourceCmd, client, OperationData{ + Short: "Create metric", + Long: "Create a new metric in the specified project. The expected `POST` body differs depending on the specified `kind` property.", + Use: "create", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + }, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/metrics/{projectKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_Oauth2ClientsResourceCmd, client, OperationData{ + Short: "Create a LaunchDarkly OAuth 2.0 client", + Long: "Create (register) a LaunchDarkly OAuth2 client. OAuth2 clients allow you to build custom integrations using LaunchDarkly as your identity provider.", + Use: "create-o-auth-2-client", + Params: []Param{}, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/oauth/clients", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_Oauth2ClientsResourceCmd, client, OperationData{ + Short: "Delete OAuth 2.0 client", + Long: "Delete an existing OAuth 2.0 client by unique client ID.", + Use: "delete-o-auth-client", + Params: []Param{ + { + Name: "client-id", + In: "path", + Description: "The client ID", + Type: "string", + }, + }, + HTTPMethod: "DELETE", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/oauth/clients/{clientId}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_Oauth2ClientsResourceCmd, client, OperationData{ + Short: "Get client by ID", + Long: "Get a registered OAuth 2.0 client by unique client ID.", + Use: "get-o-auth-client-by-id", + Params: []Param{ + { + Name: "client-id", + In: "path", + Description: "The client ID", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/oauth/clients/{clientId}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_Oauth2ClientsResourceCmd, client, OperationData{ + Short: "Get clients", + Long: "Get all OAuth 2.0 clients registered by your account.", + Use: "list-o-auth-clients", + Params: []Param{}, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/oauth/clients", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_Oauth2ClientsResourceCmd, client, OperationData{ + Short: "Patch client by ID", + Long: "Patch an existing OAuth 2.0 client by client ID. Updating an OAuth2 client uses a [JSON patch](https://datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes. To learn more, read [Updates](/#section/Overview/Updates). Only `name`, `description`, and `redirectUri` may be patched.", + Use: "update-o-auth-client", + Params: []Param{ + { + Name: "client-id", + In: "path", + Description: "The client ID", + Type: "string", + }, + }, + HTTPMethod: "PATCH", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/oauth/clients/{clientId}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_OtherResourceCmd, client, OperationData{ + Short: "Gets the public IP list", + Long: "Get a list of IP ranges the LaunchDarkly service uses. You can use this list to allow LaunchDarkly through your firewall. We post upcoming changes to this list in advance on our [status page](https://status.launchdarkly.com/). \u003cbr /\u003e\u003cbr /\u003eIn the sandbox, click 'Try it' and enter any string in the 'Authorization' field to test this endpoint.", + Use: "get-ips", + Params: []Param{}, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/public-ip-list", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_OtherResourceCmd, client, OperationData{ + Short: "Gets the OpenAPI spec in json", + Long: "Get the latest version of the OpenAPI specification for LaunchDarkly's API in JSON format. In the sandbox, click 'Try it' and enter any string in the 'Authorization' field to test this endpoint.", + Use: "get-openapi-spec", + Params: []Param{}, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/openapi.json", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_OtherResourceCmd, client, OperationData{ + Short: "Root resource", + Long: "Get all of the resource categories the API supports. In the sandbox, click 'Try it' and enter any string in the 'Authorization' field to test this endpoint.", + Use: "get-root", + Params: []Param{}, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_OtherResourceCmd, client, OperationData{ + Short: "Get version information", + Long: "Get the latest API version, the list of valid API versions in ascending order, and the version being used for this request. These are all in the external, date-based format.", + Use: "get-versions", + Params: []Param{}, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/versions", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_ProjectsResourceCmd, client, OperationData{ + Short: "Delete project", + Long: "Delete a project by key. Use this endpoint with caution. Deleting a project will delete all associated environments and feature flags. You cannot delete the last project in an account.", + Use: "delete", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + }, + HTTPMethod: "DELETE", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/projects/{projectKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_ProjectsResourceCmd, client, OperationData{ + Short: "Get flag defaults for project", + Long: "Get the flag defaults for a specific project.", + Use: "get-flag-defaults", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/projects/{projectKey}/flag-defaults", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_ProjectsResourceCmd, client, OperationData{ + Short: "Get project", + Long: "Get a single project by key.\n\n### Expanding the project response\n\nLaunchDarkly supports one field for expanding the \"Get project\" response. By default, these fields are **not** included in the response.\n\nTo expand the response, append the `expand` query parameter and add a comma-separated list with any of the following fields:\n* `environments` includes a paginated list of the project environments.\n\nFor example, `expand=environments` includes the `environments` field for the project in the response.\n", + Use: "get", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key.", + Type: "string", + }, + { + Name: "expand", + In: "query", + Description: "A comma-separated list of properties that can reveal additional information in the response.", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/projects/{projectKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_ProjectsResourceCmd, client, OperationData{ + Short: "List projects", + Long: "Return a list of projects.\n\nBy default, this returns the first 20 projects. Page through this list with the `limit` parameter and by following the `first`, `prev`, `next`, and `last` links in the `_links` field that returns. If those links do not appear, the pages they refer to don't exist. For example, the `first` and `prev` links will be missing from the response on the first page, because there is no previous page and you cannot return to the first page when you are already on the first page.\n\n### Filtering projects\n\nLaunchDarkly supports two fields for filters:\n- `query` is a string that matches against the projects' names and keys. It is not case sensitive.\n- `tags` is a `+`-separated list of project tags. It filters the list of projects that have all of the tags in the list.\n\nFor example, the filter `filter=query:abc,tags:tag-1+tag-2` matches projects with the string `abc` in their name or key and also are tagged with `tag-1` and `tag-2`. The filter is not case-sensitive.\n\nThe documented values for `filter` query parameters are prior to URL encoding. For example, the `+` in `filter=tags:tag-1+tag-2` must be encoded to `%2B`.\n\n### Sorting projects\n\nLaunchDarkly supports two fields for sorting:\n- `name` sorts by project name.\n- `createdOn` sorts by the creation date of the project.\n\nFor example, `sort=name` sorts the response by project name in ascending order.\n\n### Expanding the projects response\n\nLaunchDarkly supports one field for expanding the \"List projects\" response. By default, these fields are **not** included in the response.\n\nTo expand the response, append the `expand` query parameter and add a comma-separated list with the `environments` field.\n\n`Environments` includes a paginated list of the project environments.\n* `environments` includes a paginated list of the project environments.\n\nFor example, `expand=environments` includes the `environments` field for each project in the response.\n", + Use: "list", + Params: []Param{ + { + Name: "limit", + In: "query", + Description: "The number of projects to return in the response. Defaults to 20.", + Type: "integer", + }, + { + Name: "offset", + In: "query", + Description: "Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and returns the next `limit` items.", + Type: "integer", + }, + { + Name: "filter", + In: "query", + Description: "A comma-separated list of filters. Each filter is constructed as `field:value`.", + Type: "string", + }, + { + Name: "sort", + In: "query", + Description: "A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order.", + Type: "string", + }, + { + Name: "expand", + In: "query", + Description: "A comma-separated list of properties that can reveal additional information in the response.", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/projects", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_ProjectsResourceCmd, client, OperationData{ + Short: "Update flag default for project", + Long: "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](/#section/Overview/Updates).", + Use: "update-flag-defaults", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + }, + HTTPMethod: "PATCH", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/projects/{projectKey}/flag-defaults", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_ProjectsResourceCmd, client, OperationData{ + Short: "Update project", + Long: "Update a project. Updating a project uses a [JSON patch](https://datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes. To learn more, read [Updates](/#section/Overview/Updates).\u003cbr/\u003e\u003cbr/\u003eTo add an element to the project fields that are arrays, set the `path` to the name of the field and then append `/\u003carray index\u003e`. Use `/0` to add to the beginning of the array. Use `/-` to add to the end of the array.", + Use: "update", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + }, + HTTPMethod: "PATCH", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/projects/{projectKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_ProjectsResourceCmd, client, OperationData{ + Short: "Create project", + Long: "Create a new project with the given key and name. Project keys must be unique within an account.", + Use: "create", + Params: []Param{}, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/projects", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_ProjectsResourceCmd, client, OperationData{ + Short: "Create or update flag defaults for project", + Long: "Create or update flag defaults for a project.", + Use: "replace-flag-defaults", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + }, + HTTPMethod: "PUT", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/projects/{projectKey}/flag-defaults", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_RelayProxyConfigurationsResourceCmd, client, OperationData{ + Short: "Delete Relay Proxy config by ID", + Long: "Delete a Relay Proxy config.", + Use: "delete-relay-auto-config", + Params: []Param{ + { + Name: "id", + In: "path", + Description: "The relay auto config id", + Type: "string", + }, + }, + HTTPMethod: "DELETE", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/account/relay-auto-configs/{id}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_RelayProxyConfigurationsResourceCmd, client, OperationData{ + Short: "Get Relay Proxy config", + Long: "Get a single Relay Proxy auto config by ID.", + Use: "get-relay-proxy-config", + Params: []Param{ + { + Name: "id", + In: "path", + Description: "The relay auto config id", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/account/relay-auto-configs/{id}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_RelayProxyConfigurationsResourceCmd, client, OperationData{ + Short: "List Relay Proxy configs", + Long: "Get a list of Relay Proxy configurations in the account.", + Use: "list-relay-proxy-configs", + Params: []Param{}, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/account/relay-auto-configs", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_RelayProxyConfigurationsResourceCmd, client, OperationData{ + Short: "Update a Relay Proxy config", + Long: "Update a Relay Proxy configuration. Updating a configuration 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](/#section/Overview/Updates).", + Use: "update-relay-auto-config", + Params: []Param{ + { + Name: "id", + In: "path", + Description: "The relay auto config id", + Type: "string", + }, + }, + HTTPMethod: "PATCH", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/account/relay-auto-configs/{id}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_RelayProxyConfigurationsResourceCmd, client, OperationData{ + Short: "Create a new Relay Proxy config", + Long: "Create a Relay Proxy config.", + Use: "create-relay-auto-config", + Params: []Param{}, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/account/relay-auto-configs", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_RelayProxyConfigurationsResourceCmd, client, OperationData{ + Short: "Reset Relay Proxy configuration key", + Long: "Reset a Relay Proxy configuration's secret key with an optional expiry time for the old key.", + Use: "reset-relay-auto-config", + Params: []Param{ + { + Name: "id", + In: "path", + Description: "The Relay Proxy configuration ID", + Type: "string", + }, + { + Name: "expiry", + In: "query", + Description: "An expiration time for the old Relay Proxy configuration key, expressed as a Unix epoch time in milliseconds. By default, the Relay Proxy configuration will expire immediately.", + Type: "integer", + }, + }, + HTTPMethod: "POST", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/account/relay-auto-configs/{id}/reset", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_ScheduledChangesResourceCmd, client, OperationData{ + Short: "Delete scheduled changes workflow", + Long: "Delete a scheduled changes workflow.", + Use: "delete-flag-config", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "id", + In: "path", + Description: "The scheduled change id", + Type: "string", + }, + }, + HTTPMethod: "DELETE", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/scheduled-changes/{id}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_ScheduledChangesResourceCmd, client, OperationData{ + Short: "Get a scheduled change", + Long: "Get a scheduled change that will be applied to the feature flag by ID.", + Use: "get-feature-flag", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "id", + In: "path", + Description: "The scheduled change id", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/scheduled-changes/{id}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_ScheduledChangesResourceCmd, client, OperationData{ + Short: "List scheduled changes", + Long: "Get a list of scheduled changes that will be applied to the feature flag.", + Use: "list-flag-config", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/scheduled-changes", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_ScheduledChangesResourceCmd, client, OperationData{ + Short: "Update scheduled changes workflow", + Long: "\nUpdate a scheduled change, overriding existing instructions with the new ones. Updating a scheduled change uses the semantic patch format.\n\nTo make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch).\n\n### Instructions\n\nSemantic patch requests support the following `kind` instructions for updating scheduled changes.\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand instructions for \u003cstrong\u003eupdating scheduled changes\u003c/strong\u003e\u003c/summary\u003e\n\n#### deleteScheduledChange\n\nRemoves the scheduled change.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{ \"kind\": \"deleteScheduledChange\" }]\n}\n```\n\n#### replaceScheduledChangesInstructions\n\nRemoves the existing scheduled changes and replaces them with the new instructions.\n\n##### Parameters\n\n- `value`: An array of the new actions to perform when the execution date for these scheduled changes arrives. Supported scheduled actions are `turnFlagOn` and `turnFlagOff`.\n\nHere's an example that replaces the scheduled changes with new instructions to turn flag targeting off:\n\n```json\n{\n \"instructions\": [\n {\n \"kind\": \"replaceScheduledChangesInstructions\",\n \"value\": [ {\"kind\": \"turnFlagOff\"} ]\n }\n ]\n}\n```\n\n#### updateScheduledChangesExecutionDate\n\nUpdates the execution date for the scheduled changes.\n\n##### Parameters\n\n- `value`: the new execution date, in Unix milliseconds.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [\n {\n \"kind\": \"updateScheduledChangesExecutionDate\",\n \"value\": 1754092860000\n }\n ]\n}\n```\n\n\u003c/details\u003e\n", + Use: "update-flag-config", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "id", + In: "path", + Description: "The scheduled change ID", + Type: "string", + }, + { + Name: "ignore-conflicts", + In: "query", + Description: "Whether to succeed (`true`) or fail (`false`) when these new instructions conflict with existing scheduled changes", + Type: "boolean", + }, + }, + HTTPMethod: "PATCH", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/scheduled-changes/{id}", + SupportsSemanticPatch: true, + }) + + NewOperationCmd(gen_ScheduledChangesResourceCmd, client, OperationData{ + Short: "Create scheduled changes workflow", + Long: "Create scheduled changes for a feature flag. If the `ignoreConficts` query parameter is false and there are conflicts between these instructions and existing scheduled changes, the request will fail. If the parameter is true and there are conflicts, the request will succeed.", + Use: "create-flag-config", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "ignore-conflicts", + In: "query", + Description: "Whether to succeed (`true`) or fail (`false`) when these instructions conflict with existing scheduled changes", + Type: "boolean", + }, + }, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/scheduled-changes", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_SegmentsResourceCmd, client, OperationData{ + Short: "Delete segment", + Long: "Delete a segment.", + Use: "delete", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "segment-key", + In: "path", + Description: "The segment key", + Type: "string", + }, + }, + HTTPMethod: "DELETE", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_SegmentsResourceCmd, client, OperationData{ + Short: "List segment memberships for context instance", + Long: "For a given context instance with attributes, get membership details for all segments. In the request body, pass in the context instance.", + Use: "list-context-instance-membership-by-env", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + }, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/projects/{projectKey}/environments/{environmentKey}/segments/evaluate", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_SegmentsResourceCmd, client, OperationData{ + Short: "Get expiring targets for segment", + Long: "Get a list of a segment's context targets that are scheduled for removal.", + Use: "list-expiring-targets", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "segment-key", + In: "path", + Description: "The segment key", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/segments/{projectKey}/{segmentKey}/expiring-targets/{environmentKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_SegmentsResourceCmd, client, OperationData{ + Short: "Get expiring user targets for segment", + Long: "\u003e ### Contexts are now available\n\u003e\n\u003e After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use [Get expiring targets for segment](/tag/Segments#operation/getExpiringTargetsForSegment) instead of this endpoint. To learn more, read [Contexts](https://docs.launchdarkly.com/home/contexts).\n\nGet a list of a segment's user targets that are scheduled for removal.\n", + Use: "list-expiring-user-targets", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "segment-key", + In: "path", + Description: "The segment key", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/segments/{projectKey}/{segmentKey}/expiring-user-targets/{environmentKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_SegmentsResourceCmd, client, OperationData{ + Short: "Get segment", + Long: "Get a single segment by key.\u003cbr/\u003e\u003cbr/\u003eSegments can be rule-based, list-based, or synced. Big segments include larger list-based segments and synced segments. Some fields in the response only apply to big segments.", + Use: "get", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "segment-key", + In: "path", + Description: "The segment key", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_SegmentsResourceCmd, client, OperationData{ + Short: "Get big segment membership for context", + Long: "Get the membership status (included/excluded) for a given context in this big segment. Big segments include larger list-based segments and synced segments. This operation does not support standard segments.", + Use: "get-membership-for-context", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "segment-key", + In: "path", + Description: "The segment key", + Type: "string", + }, + { + Name: "context-key", + In: "path", + Description: "The context key", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/contexts/{contextKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_SegmentsResourceCmd, client, OperationData{ + Short: "Get big segment membership for user", + Long: "\u003e ### Contexts are now available\n\u003e\n\u003e After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use [Get expiring targets for segment](/tag/Segments#operation/getExpiringTargetsForSegment) instead of this endpoint. To learn more, read [Contexts](https://docs.launchdarkly.com/home/contexts).\n\nGet the membership status (included/excluded) for a given user in this big segment. This operation does not support standard segments.\n", + Use: "get-membership-for-user", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "segment-key", + In: "path", + Description: "The segment key", + Type: "string", + }, + { + Name: "user-key", + In: "path", + Description: "The user key", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/users/{userKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_SegmentsResourceCmd, client, OperationData{ + Short: "List segments", + Long: "Get a list of all segments in the given project.\u003cbr/\u003e\u003cbr/\u003eSegments can be rule-based, list-based, or synced. Big segments include larger list-based segments and synced segments. Some fields in the response only apply to big segments.", + Use: "list", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "limit", + In: "query", + Description: "The number of segments to return. Defaults to 20.", + Type: "integer", + }, + { + Name: "offset", + In: "query", + Description: "Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.", + Type: "integer", + }, + { + Name: "sort", + In: "query", + Description: "Accepts sorting order and fields. Fields can be comma separated. Possible fields are 'creationDate', 'name', 'lastModified'. Example: `sort=name` sort by names ascending or `sort=-name,creationDate` sort by names descending and creationDate ascending.", + Type: "string", + }, + { + Name: "filter", + In: "query", + Description: "Accepts filter by kind, query, tags, unbounded, or external. To filter by kind or query, use the `equals` operator. To filter by tags, use the `anyOf` operator. Query is a 'fuzzy' search across segment key, name, and description. Example: `filter=tags anyOf ['enterprise', 'beta'],query equals 'toggle'` returns segments with 'toggle' in their key, name, or description that also have 'enterprise' or 'beta' as a tag. To filter by unbounded, use the `equals` operator. Example: `filter=unbounded equals true`. To filter by external, use the `exists` operator. Example: `filter=external exists true`.", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/segments/{projectKey}/{environmentKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_SegmentsResourceCmd, client, OperationData{ + Short: "Update expiring targets for segment", + Long: "\nUpdate expiring context targets for a segment. Updating a context target expiration uses the semantic patch format.\n\nTo make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch).\n\nIf the request is well-formed but any of its instructions failed to process, this operation returns status code `200`. In this case, the response `errors` array will be non-empty.\n\n### Instructions\n\nSemantic patch requests support the following `kind` instructions for updating expiring context targets.\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand instructions for \u003cstrong\u003eupdating expiring context targets\u003c/strong\u003e\u003c/summary\u003e\n\n#### addExpiringTarget\n\nSchedules a date and time when LaunchDarkly will remove a context from segment targeting. The segment must already have the context as an individual target.\n\n##### Parameters\n\n- `targetType`: The type of individual target for this context. Must be either `included` or `excluded`.\n- `contextKey`: The context key.\n- `contextKind`: The kind of context being targeted.\n- `value`: The date when the context should expire from the segment targeting, in Unix milliseconds.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"addExpiringTarget\",\n \"targetType\": \"included\",\n \"contextKey\": \"user-key-123abc\",\n \"contextKind\": \"user\",\n \"value\": 1754092860000\n }]\n}\n```\n\n#### updateExpiringTarget\n\nUpdates the date and time when LaunchDarkly will remove a context from segment targeting.\n\n##### Parameters\n\n- `targetType`: The type of individual target for this context. Must be either `included` or `excluded`.\n- `contextKey`: The context key.\n- `contextKind`: The kind of context being targeted.\n- `value`: The new date when the context should expire from the segment targeting, in Unix milliseconds.\n- `version`: (Optional) The version of the expiring target to update. If included, update will fail if version doesn't match current version of the expiring target.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"updateExpiringTarget\",\n \"targetType\": \"included\",\n \"contextKey\": \"user-key-123abc\",\n \"contextKind\": \"user\",\n \"value\": 1754179260000\n }]\n}\n```\n\n#### removeExpiringTarget\n\nRemoves the scheduled expiration for the context in the segment.\n\n##### Parameters\n\n- `targetType`: The type of individual target for this context. Must be either `included` or `excluded`.\n- `contextKey`: The context key.\n- `contextKind`: The kind of context being targeted.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"removeExpiringTarget\",\n \"targetType\": \"included\",\n \"contextKey\": \"user-key-123abc\",\n \"contextKind\": \"user\",\n }]\n}\n```\n\n\u003c/details\u003e\n", + Use: "update-expiring-targets", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "segment-key", + In: "path", + Description: "The segment key", + Type: "string", + }, + }, + HTTPMethod: "PATCH", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/segments/{projectKey}/{segmentKey}/expiring-targets/{environmentKey}", + SupportsSemanticPatch: true, + }) + + NewOperationCmd(gen_SegmentsResourceCmd, client, OperationData{ + Short: "Update expiring user targets for segment", + Long: "\n\u003e ### Contexts are now available\n\u003e\n\u003e After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use [Update expiring targets for segment](/tag/Segments#operation/patchExpiringTargetsForSegment) instead of this endpoint. To learn more, read [Contexts](https://docs.launchdarkly.com/home/contexts).\n\nUpdate expiring user targets for a segment. Updating a user target expiration uses the semantic patch format.\n\nTo make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch).\n\nIf the request is well-formed but any of its instructions failed to process, this operation returns status code `200`. In this case, the response `errors` array will be non-empty.\n\n### Instructions\n\nSemantic patch requests support the following `kind` instructions for updating expiring user targets.\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand instructions for \u003cstrong\u003eupdating expiring user targets\u003c/strong\u003e\u003c/summary\u003e\n\n#### addExpireUserTargetDate\n\nSchedules a date and time when LaunchDarkly will remove a user from segment targeting.\n\n##### Parameters\n\n- `targetType`: A segment's target type, must be either `included` or `excluded`.\n- `userKey`: The user key.\n- `value`: The date when the user should expire from the segment targeting, in Unix milliseconds.\n\n#### updateExpireUserTargetDate\n\nUpdates the date and time when LaunchDarkly will remove a user from segment targeting.\n\n##### Parameters\n\n- `targetType`: A segment's target type, must be either `included` or `excluded`.\n- `userKey`: The user key.\n- `value`: The new date when the user should expire from the segment targeting, in Unix milliseconds.\n- `version`: The segment version.\n\n#### removeExpireUserTargetDate\n\nRemoves the scheduled expiration for the user in the segment.\n\n##### Parameters\n\n- `targetType`: A segment's target type, must be either `included` or `excluded`.\n- `userKey`: The user key.\n\n\u003c/details\u003e\n", + Use: "update-expiring-user-targets", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "segment-key", + In: "path", + Description: "The segment key", + Type: "string", + }, + }, + HTTPMethod: "PATCH", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/segments/{projectKey}/{segmentKey}/expiring-user-targets/{environmentKey}", + SupportsSemanticPatch: true, + }) + + NewOperationCmd(gen_SegmentsResourceCmd, client, OperationData{ + Short: "Patch segment", + Long: "Update a segment. The request body must be a valid semantic patch, JSON patch, or JSON merge patch. To learn more the different formats, read [Updates](/#section/Overview/Updates).\n\n### Using semantic patches on a segment\n\nTo make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch).\n\nThe body of a semantic patch request for updating segments requires an `environmentKey` in addition to `instructions` and an optional `comment`. The body of the request takes the following properties:\n\n* `comment` (string): (Optional) A description of the update.\n* `environmentKey` (string): (Required) The key of the LaunchDarkly environment.\n* `instructions` (array): (Required) A list of actions the update should perform. Each action in the list must be an object with a `kind` property that indicates the instruction. If the action requires parameters, you must include those parameters as additional fields in the object.\n\n### Instructions\n\nSemantic patch requests support the following `kind` instructions for updating segments.\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand instructions for \u003cstrong\u003eupdating segments\u003c/strong\u003e\u003c/summary\u003e\n\n#### addIncludedTargets\n\nAdds context keys to the individual context targets included in the segment for the specified `contextKind`. Returns an error if this causes the same context key to be both included and excluded.\n\n##### Parameters\n\n- `contextKind`: The context kind the targets should be added to.\n- `values`: List of keys.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"addIncludedTargets\",\n \"contextKind\": \"org\",\n \"values\": [ \"org-key-123abc\", \"org-key-456def\" ]\n }]\n}\n```\n\n#### addIncludedUsers\n\nAdds user keys to the individual user targets included in the segment. Returns an error if this causes the same user key to be both included and excluded. If you are working with contexts, use `addIncludedTargets` instead of this instruction.\n\n##### Parameters\n\n- `values`: List of user keys.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"addIncludedUsers\",\n \"values\": [ \"user-key-123abc\", \"user-key-456def\" ]\n }]\n}\n```\n\n#### addExcludedTargets\n\nAdds context keys to the individual context targets excluded in the segment for the specified `contextKind`. Returns an error if this causes the same context key to be both included and excluded.\n\n##### Parameters\n\n- `contextKind`: The context kind the targets should be added to.\n- `values`: List of keys.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"addExcludedTargets\",\n \"contextKind\": \"org\",\n \"values\": [ \"org-key-123abc\", \"org-key-456def\" ]\n }]\n}\n```\n\n#### addExcludedUsers\n\nAdds user keys to the individual user targets excluded from the segment. Returns an error if this causes the same user key to be both included and excluded. If you are working with contexts, use `addExcludedTargets` instead of this instruction.\n\n##### Parameters\n\n- `values`: List of user keys.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"addExcludedUsers\",\n \"values\": [ \"user-key-123abc\", \"user-key-456def\" ]\n }]\n}\n```\n\n#### removeIncludedTargets\n\nRemoves context keys from the individual context targets included in the segment for the specified `contextKind`.\n\n##### Parameters\n\n- `contextKind`: The context kind the targets should be removed from.\n- `values`: List of keys.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"removeIncludedTargets\",\n \"contextKind\": \"org\",\n \"values\": [ \"org-key-123abc\", \"org-key-456def\" ]\n }]\n}\n```\n\n#### removeIncludedUsers\n\nRemoves user keys from the individual user targets included in the segment. If you are working with contexts, use `removeIncludedTargets` instead of this instruction.\n\n##### Parameters\n\n- `values`: List of user keys.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"removeIncludedUsers\",\n \"values\": [ \"user-key-123abc\", \"user-key-456def\" ]\n }]\n}\n```\n\n#### removeExcludedTargets\n\nRemoves context keys from the individual context targets excluded from the segment for the specified `contextKind`.\n\n##### Parameters\n\n- `contextKind`: The context kind the targets should be removed from.\n- `values`: List of keys.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"removeExcludedTargets\",\n \"contextKind\": \"org\",\n \"values\": [ \"org-key-123abc\", \"org-key-456def\" ]\n }]\n}\n```\n\n#### removeExcludedUsers\n\nRemoves user keys from the individual user targets excluded from the segment. If you are working with contexts, use `removeExcludedTargets` instead of this instruction.\n\n##### Parameters\n\n- `values`: List of user keys.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"removeExcludedUsers\",\n \"values\": [ \"user-key-123abc\", \"user-key-456def\" ]\n }]\n}\n```\n\n#### updateName\n\nUpdates the name of the segment.\n\n##### Parameters\n\n- `value`: Name of the segment.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"updateName\",\n \"value\": \"Updated segment name\"\n }]\n}\n```\n\n\u003c/details\u003e\n\n## Using JSON patches on a segment\n\nIf you do not include the header described above, you can use a [JSON patch](/reference#updates-using-json-patch) or [JSON merge patch](https://datatracker.ietf.org/doc/html/rfc7386) representation of the desired changes.\n\nFor example, to update the description for a segment with a JSON patch, use the following request body:\n\n```json\n{\n \"patch\": [\n {\n \"op\": \"replace\",\n \"path\": \"/description\",\n \"value\": \"new description\"\n }\n ]\n}\n```\n\nTo update fields in the segment that are arrays, set the `path` to the name of the field and then append `/\u003carray index\u003e`. Use `/0` to add the new entry to the beginning of the array. Use `/-` to add the new entry to the end of the array.\n\nFor example, to add a rule to a segment, use the following request body:\n\n```json\n{\n \"patch\":[\n {\n \"op\": \"add\",\n \"path\": \"/rules/0\",\n \"value\": {\n \"clauses\": [{ \"contextKind\": \"user\", \"attribute\": \"email\", \"op\": \"endsWith\", \"values\": [\".edu\"], \"negate\": false }]\n }\n }\n ]\n}\n```\n\nTo add or remove targets from segments, we recommend using semantic patch. Semantic patch for segments includes specific instructions for adding and removing both included and excluded targets.\n", + Use: "update", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "segment-key", + In: "path", + Description: "The segment key", + Type: "string", + }, + }, + HTTPMethod: "PATCH", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}", + SupportsSemanticPatch: true, + }) + + NewOperationCmd(gen_SegmentsResourceCmd, client, OperationData{ + Short: "Create segment", + Long: "Create a new segment.", + Use: "create", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + }, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/segments/{projectKey}/{environmentKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_SegmentsResourceCmd, client, OperationData{ + Short: "Update context targets on a big segment", + Long: "Update context targets included or excluded in a big segment. Big segments include larger list-based segments and synced segments. This operation does not support standard segments.", + Use: "update-big-context-targets", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "segment-key", + In: "path", + Description: "The segment key", + Type: "string", + }, + }, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/contexts", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_SegmentsResourceCmd, client, OperationData{ + Short: "Update user context targets on a big segment", + Long: "Update user context targets included or excluded in a big segment. Big segments include larger list-based segments and synced segments. This operation does not support standard segments.", + Use: "update-big-targets", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "segment-key", + In: "path", + Description: "The segment key", + Type: "string", + }, + }, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/users", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_TagsResourceCmd, client, OperationData{ + Short: "List tags", + Long: "Get a list of tags.", + Use: "list", + Params: []Param{ + { + Name: "kind", + In: "query", + Description: "Fetch tags associated with the specified resource type. Options are `flag`, `project`, `environment`, `segment`. Returns all types by default.", + Type: "string", + }, + { + Name: "pre", + In: "query", + Description: "Return tags with the specified prefix", + Type: "string", + }, + { + Name: "archived", + In: "query", + Description: "Whether or not to return archived flags", + Type: "boolean", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/tags", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_TeamsResourceCmd, client, OperationData{ + Short: "Delete team", + Long: "Delete a team by key. To learn more, read [Deleting a team](https://docs.launchdarkly.com/home/teams/managing#deleting-a-team).", + Use: "delete", + Params: []Param{ + { + Name: "team-key", + In: "path", + Description: "The team key", + Type: "string", + }, + }, + HTTPMethod: "DELETE", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/teams/{teamKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_TeamsResourceCmd, client, OperationData{ + Short: "Get team", + Long: "Fetch a team by key.\n\n### Expanding the teams response\nLaunchDarkly supports four fields for expanding the \"Get team\" response. By default, these fields are **not** included in the response.\n\nTo expand the response, append the `expand` query parameter and add a comma-separated list with any of the following fields:\n\n* `members` includes the total count of members that belong to the team.\n* `roles` includes a paginated list of the custom roles that you have assigned to the team.\n* `projects` includes a paginated list of the projects that the team has any write access to.\n* `maintainers` includes a paginated list of the maintainers that you have assigned to the team.\n\nFor example, `expand=members,roles` includes the `members` and `roles` fields in the response.\n", + Use: "get", + Params: []Param{ + { + Name: "team-key", + In: "path", + Description: "The team key.", + Type: "string", + }, + { + Name: "expand", + In: "query", + Description: "A comma-separated list of properties that can reveal additional information in the response.", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/teams/{teamKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_TeamsResourceCmd, client, OperationData{ + Short: "Get team maintainers", + Long: "Fetch the maintainers that have been assigned to the team. To learn more, read [Managing team maintainers](https://docs.launchdarkly.com/home/teams/managing#managing-team-maintainers).", + Use: "list-maintainers", + Params: []Param{ + { + Name: "team-key", + In: "path", + Description: "The team key", + Type: "string", + }, + { + Name: "limit", + In: "query", + Description: "The number of maintainers to return in the response. Defaults to 20.", + Type: "integer", + }, + { + Name: "offset", + In: "query", + Description: "Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.", + Type: "integer", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/teams/{teamKey}/maintainers", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_TeamsResourceCmd, client, OperationData{ + Short: "Get team custom roles", + Long: "Fetch the custom roles that have been assigned to the team. To learn more, read [Managing team permissions](https://docs.launchdarkly.com/home/teams/managing#managing-team-permissions).", + Use: "list-roles", + Params: []Param{ + { + Name: "team-key", + In: "path", + Description: "The team key", + Type: "string", + }, + { + Name: "limit", + In: "query", + Description: "The number of roles to return in the response. Defaults to 20.", + Type: "integer", + }, + { + Name: "offset", + In: "query", + Description: "Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.", + Type: "integer", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/teams/{teamKey}/roles", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_TeamsResourceCmd, client, OperationData{ + Short: "List teams", + Long: "Return a list of teams.\n\nBy default, this returns the first 20 teams. Page through this list with the `limit` parameter and by following the `first`, `prev`, `next`, and `last` links in the `_links` field that returns. If those links do not appear, the pages they refer to don't exist. For example, the `first` and `prev` links will be missing from the response on the first page, because there is no previous page and you cannot return to the first page when you are already on the first page.\n\n### Filtering teams\n\nLaunchDarkly supports the following fields for filters:\n\n- `query` is a string that matches against the teams' names and keys. It is not case-sensitive.\n - A request with `query:abc` returns teams with the string `abc` in their name or key.\n- `nomembers` is a boolean that filters the list of teams who have 0 members\n - A request with `nomembers:true` returns teams that have 0 members\n - A request with `nomembers:false` returns teams that have 1 or more members\n\n### Expanding the teams response\nLaunchDarkly supports expanding several fields in the \"List teams\" response. By default, these fields are **not** included in the response.\n\nTo expand the response, append the `expand` query parameter and add a comma-separated list with any of the following fields:\n\n* `members` includes the total count of members that belong to the team.\n* `maintainers` includes a paginated list of the maintainers that you have assigned to the team.\n\nFor example, `expand=members,maintainers` includes the `members` and `maintainers` fields in the response.\n", + Use: "list", + Params: []Param{ + { + Name: "limit", + In: "query", + Description: "The number of teams to return in the response. Defaults to 20.", + Type: "integer", + }, + { + Name: "offset", + In: "query", + Description: "Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and returns the next `limit` items.", + Type: "integer", + }, + { + Name: "filter", + In: "query", + Description: "A comma-separated list of filters. Each filter is constructed as `field:value`.", + Type: "string", + }, + { + Name: "expand", + In: "query", + Description: "A comma-separated list of properties that can reveal additional information in the response.", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/teams", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_TeamsResourceCmd, client, OperationData{ + Short: "Update team", + Long: "Perform a partial update to a team. Updating a team uses the semantic patch format.\n\nTo make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch).\n\n### Instructions\n\nSemantic patch requests support the following `kind` instructions for updating teams.\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand instructions for \u003cstrong\u003eupdating teams\u003c/strong\u003e\u003c/summary\u003e\n\n#### addCustomRoles\n\nAdds custom roles to the team. Team members will have these custom roles granted to them.\n\n##### Parameters\n\n- `values`: List of custom role keys.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"addCustomRoles\",\n \"values\": [ \"example-custom-role\" ]\n }]\n}\n```\n\n#### removeCustomRoles\n\nRemoves custom roles from the team. The app will no longer grant these custom roles to the team members.\n\n##### Parameters\n\n- `values`: List of custom role keys.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"removeCustomRoles\",\n \"values\": [ \"example-custom-role\" ]\n }]\n}\n```\n\n#### addMembers\n\nAdds members to the team.\n\n##### Parameters\n\n- `values`: List of member IDs to add.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"addMembers\",\n \"values\": [ \"1234a56b7c89d012345e678f\", \"507f1f77bcf86cd799439011\" ]\n }]\n}\n```\n\n#### removeMembers\n\nRemoves members from the team.\n\n##### Parameters\n\n- `values`: List of member IDs to remove.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"removeMembers\",\n \"values\": [ \"1234a56b7c89d012345e678f\", \"507f1f77bcf86cd799439011\" ]\n }]\n}\n```\n\n#### replaceMembers\n\nReplaces the existing members of the team with the new members.\n\n##### Parameters\n\n- `values`: List of member IDs of the new members.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"replaceMembers\",\n \"values\": [ \"1234a56b7c89d012345e678f\", \"507f1f77bcf86cd799439011\" ]\n }]\n}\n```\n\n#### addPermissionGrants\n\nAdds permission grants to members for the team. For example, a permission grant could allow a member to act as a team maintainer. A permission grant may have either an `actionSet` or a list of `actions` but not both at the same time. The members do not have to be team members to have a permission grant for the team.\n\n##### Parameters\n\n- `actionSet`: Name of the action set.\n- `actions`: List of actions.\n- `memberIDs`: List of member IDs.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"addPermissionGrants\",\n \"actions\": [ \"updateTeamName\", \"updateTeamDescription\" ],\n \"memberIDs\": [ \"1234a56b7c89d012345e678f\", \"507f1f77bcf86cd799439011\" ]\n }]\n}\n```\n\n#### removePermissionGrants\n\nRemoves permission grants from members for the team. A permission grant may have either an `actionSet` or a list of `actions` but not both at the same time. The `actionSet` and `actions` must match an existing permission grant.\n\n##### Parameters\n\n- `actionSet`: Name of the action set.\n- `actions`: List of actions.\n- `memberIDs`: List of member IDs.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"removePermissionGrants\",\n \"actions\": [ \"updateTeamName\", \"updateTeamDescription\" ],\n \"memberIDs\": [ \"1234a56b7c89d012345e678f\", \"507f1f77bcf86cd799439011\" ]\n }]\n}\n```\n\n#### updateDescription\n\nUpdates the description of the team.\n\n##### Parameters\n\n- `value`: The new description.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"updateDescription\",\n \"value\": \"Updated team description\"\n }]\n}\n```\n\n#### updateName\n\nUpdates the name of the team.\n\n##### Parameters\n\n- `value`: The new name.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"updateName\",\n \"value\": \"Updated team name\"\n }]\n}\n```\n\n\u003c/details\u003e\n\n### Expanding the teams response\nLaunchDarkly supports four fields for expanding the \"Update team\" response. By default, these fields are **not** included in the response.\n\nTo expand the response, append the `expand` query parameter and add a comma-separated list with any of the following fields:\n\n* `members` includes the total count of members that belong to the team.\n* `roles` includes a paginated list of the custom roles that you have assigned to the team.\n* `projects` includes a paginated list of the projects that the team has any write access to.\n* `maintainers` includes a paginated list of the maintainers that you have assigned to the team.\n\nFor example, `expand=members,roles` includes the `members` and `roles` fields in the response.\n", + Use: "update", + Params: []Param{ + { + Name: "team-key", + In: "path", + Description: "The team key", + Type: "string", + }, + { + Name: "expand", + In: "query", + Description: "A comma-separated list of properties that can reveal additional information in the response. Supported fields are explained above.", + Type: "string", + }, + }, + HTTPMethod: "PATCH", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/teams/{teamKey}", + SupportsSemanticPatch: true, + }) + + NewOperationCmd(gen_TeamsResourceCmd, client, OperationData{ + Short: "Create team", + Long: "Create a team. To learn more, read [Creating a team](https://docs.launchdarkly.com/home/teams/creating).\n\n### Expanding the teams response\nLaunchDarkly supports four fields for expanding the \"Create team\" response. By default, these fields are **not** included in the response.\n\nTo expand the response, append the `expand` query parameter and add a comma-separated list with any of the following fields:\n\n* `members` includes the total count of members that belong to the team.\n* `roles` includes a paginated list of the custom roles that you have assigned to the team.\n* `projects` includes a paginated list of the projects that the team has any write access to.\n* `maintainers` includes a paginated list of the maintainers that you have assigned to the team.\n\nFor example, `expand=members,roles` includes the `members` and `roles` fields in the response.\n", + Use: "create", + Params: []Param{ + { + Name: "expand", + In: "query", + Description: "A comma-separated list of properties that can reveal additional information in the response. Supported fields are explained above.", + Type: "string", + }, + }, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/teams", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_TeamsResourceCmd, client, OperationData{ + Short: "Add multiple members to team", + Long: "Add multiple members to an existing team by uploading a CSV file of member email addresses. Your CSV file must include email addresses in the first column. You can include data in additional columns, but LaunchDarkly ignores all data outside the first column. Headers are optional. To learn more, read [Managing team members](https://docs.launchdarkly.com/home/teams/managing#managing-team-members).\n\n**Members are only added on a `201` response.** A `207` indicates the CSV file contains a combination of valid and invalid entries. A `207` results in no members being added to the team.\n\nOn a `207` response, if an entry contains bad input, the `message` field contains the row number as well as the reason for the error. The `message` field is omitted if the entry is valid.\n\nExample `207` response:\n```json\n{\n \"items\": [\n {\n \"status\": \"success\",\n \"value\": \"new-team-member@acme.com\"\n },\n {\n \"message\": \"Line 2: empty row\",\n \"status\": \"error\",\n \"value\": \"\"\n },\n {\n \"message\": \"Line 3: email already exists in the specified team\",\n \"status\": \"error\",\n \"value\": \"existing-team-member@acme.com\"\n },\n {\n \"message\": \"Line 4: invalid email formatting\",\n \"status\": \"error\",\n \"value\": \"invalid email format\"\n }\n ]\n}\n```\n\nMessage | Resolution\n--- | ---\nEmpty row | This line is blank. Add an email address and try again.\nDuplicate entry | This email address appears in the file twice. Remove the email from the file and try again.\nEmail already exists in the specified team | This member is already on your team. Remove the email from the file and try again.\nInvalid formatting | This email address is not formatted correctly. Fix the formatting and try again.\nEmail does not belong to a LaunchDarkly member | The email address doesn't belong to a LaunchDarkly account member. Invite them to LaunchDarkly, then re-add them to the team.\n\nOn a `400` response, the `message` field may contain errors specific to this endpoint.\n\nExample `400` response:\n```json\n{\n \"code\": \"invalid_request\",\n \"message\": \"Unable to process file\"\n}\n```\n\nMessage | Resolution\n--- | ---\nUnable to process file | LaunchDarkly could not process the file for an unspecified reason. Review your file for errors and try again.\nFile exceeds 25mb | Break up your file into multiple files of less than 25mbs each.\nAll emails have invalid formatting | None of the email addresses in the file are in the correct format. Fix the formatting and try again.\nAll emails belong to existing team members | All listed members are already on this team. Populate the file with member emails that do not belong to the team and try again.\nFile is empty | The CSV file does not contain any email addresses. Populate the file and try again.\nNo emails belong to members of your LaunchDarkly organization | None of the email addresses belong to members of your LaunchDarkly account. Invite these members to LaunchDarkly, then re-add them to the team.\n", + Use: "create-members", + Params: []Param{ + { + Name: "team-key", + In: "path", + Description: "The team key", + Type: "string", + }, + }, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/teams/{teamKey}/members", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_TokensResourceCmd, client, OperationData{ + Short: "Delete access token", + Long: "Delete an access token by ID.", + Use: "delete", + Params: []Param{ + { + Name: "id", + In: "path", + Description: "The ID of the access token to update", + Type: "string", + }, + }, + HTTPMethod: "DELETE", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/tokens/{id}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_TokensResourceCmd, client, OperationData{ + Short: "Get access token", + Long: "Get a single access token by ID.", + Use: "get", + Params: []Param{ + { + Name: "id", + In: "path", + Description: "The ID of the access token", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/tokens/{id}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_TokensResourceCmd, client, OperationData{ + Short: "List access tokens", + Long: "Fetch a list of all access tokens.", + Use: "list", + Params: []Param{ + { + Name: "show-all", + In: "query", + Description: "If set to true, and the authentication access token has the 'Admin' role, personal access tokens for all members will be retrieved.", + Type: "boolean", + }, + { + Name: "limit", + In: "query", + Description: "The number of access tokens to return in the response. Defaults to 25.", + Type: "integer", + }, + { + Name: "offset", + In: "query", + Description: "Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.", + Type: "integer", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/tokens", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_TokensResourceCmd, client, OperationData{ + Short: "Patch access token", + Long: "Update an access token's settings. Updating an access token uses a [JSON patch](https://datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes. To learn more, read [Updates](/#section/Overview/Updates).", + Use: "update", + Params: []Param{ + { + Name: "id", + In: "path", + Description: "The ID of the access token to update", + Type: "string", + }, + }, + HTTPMethod: "PATCH", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/tokens/{id}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_TokensResourceCmd, client, OperationData{ + Short: "Create access token", + Long: "Create a new access token.", + Use: "create", + Params: []Param{}, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/tokens", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_TokensResourceCmd, client, OperationData{ + Short: "Reset access token", + Long: "Reset an access token's secret key with an optional expiry time for the old key.", + Use: "reset", + Params: []Param{ + { + Name: "id", + In: "path", + Description: "The ID of the access token to update", + Type: "string", + }, + { + Name: "expiry", + In: "query", + Description: "An expiration time for the old token key, expressed as a Unix epoch time in milliseconds. By default, the token will expire immediately.", + Type: "integer", + }, + }, + HTTPMethod: "POST", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/tokens/{id}/reset", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_UserFlagSettingsResourceCmd, client, OperationData{ + Short: "Get expiring dates on flags for user", + Long: "Get a list of flags for which the given user is scheduled for removal.", + Use: "list-expiring-flags-for-user", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "user-key", + In: "path", + Description: "The user key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/users/{projectKey}/{userKey}/expiring-user-targets/{environmentKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_UserFlagSettingsResourceCmd, client, OperationData{ + Short: "Get flag setting for user", + Long: "Get a single flag setting for a user by flag key. \u003cbr /\u003e\u003cbr /\u003eThe `_value` is the flag variation that the user receives. The `setting` indicates whether you've explicitly targeted a user to receive a particular variation. For example, if you have turned off a feature flag for a user, this setting will be `false`. The example response indicates that the user `Abbie_Braun` has the `sort.order` flag enabled.", + Use: "get", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "user-key", + In: "path", + Description: "The user key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/users/{projectKey}/{environmentKey}/{userKey}/flags/{featureFlagKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_UserFlagSettingsResourceCmd, client, OperationData{ + Short: "List flag settings for user", + Long: "Get the current flag settings for a given user. \u003cbr /\u003e\u003cbr /\u003eThe `_value` is the flag variation that the user receives. The `setting` indicates whether you've explicitly targeted a user to receive a particular variation. For example, if you have turned off a feature flag for a user, this setting will be `false`. The example response indicates that the user `Abbie_Braun` has the `sort.order` flag enabled and the `alternate.page` flag disabled, and that the user has not been explicitly targeted to receive a particular variation.", + Use: "list", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "user-key", + In: "path", + Description: "The user key", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/users/{projectKey}/{environmentKey}/{userKey}/flags", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_UserFlagSettingsResourceCmd, client, OperationData{ + Short: "Update expiring user target for flags", + Long: "Schedule the specified user for removal from individual targeting on one or more flags. The user must already be individually targeted for each flag.\n\nYou can add, update, or remove a scheduled removal date. You can only schedule a user for removal on a single variation per flag.\n\nUpdating an expiring target uses the semantic patch format. To make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch).\n\n### Instructions\n\nSemantic patch requests support the following `kind` instructions for updating expiring user targets.\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand instructions for \u003cstrong\u003eupdating expiring user targets\u003c/strong\u003e\u003c/summary\u003e\n\n#### addExpireUserTargetDate\n\nAdds a date and time that LaunchDarkly will remove the user from the flag's individual targeting.\n\n##### Parameters\n\n* `flagKey`: The flag key\n* `variationId`: ID of a variation on the flag\n* `value`: The time, in Unix milliseconds, when LaunchDarkly should remove the user from individual targeting for this flag.\n\n#### updateExpireUserTargetDate\n\nUpdates the date and time that LaunchDarkly will remove the user from the flag's individual targeting.\n\n##### Parameters\n\n* `flagKey`: The flag key\n* `variationId`: ID of a variation on the flag\n* `value`: The time, in Unix milliseconds, when LaunchDarkly should remove the user from individual targeting for this flag.\n* `version`: The version of the expiring user target to update. If included, update will fail if version doesn't match current version of the expiring user target.\n\n#### removeExpireUserTargetDate\n\nRemoves the scheduled removal of the user from the flag's individual targeting. The user will remain part of the flag's individual targeting until explicitly removed, or until another removal is scheduled.\n\n##### Parameters\n\n* `flagKey`: The flag key\n* `variationId`: ID of a variation on the flag\n\n\u003c/details\u003e\n", + Use: "update-expiring-flags-for-user", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "user-key", + In: "path", + Description: "The user key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + }, + HTTPMethod: "PATCH", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/users/{projectKey}/{userKey}/expiring-user-targets/{environmentKey}", + SupportsSemanticPatch: true, + }) + + NewOperationCmd(gen_UserFlagSettingsResourceCmd, client, OperationData{ + Short: "Update flag settings for user", + Long: "Enable or disable a feature flag for a user based on their key.\n\nOmitting the `setting` attribute from the request body, or including a `setting` of `null`, erases the current setting for a user.\n\nIf you previously patched the flag, and the patch included the user's data, LaunchDarkly continues to use that data. If LaunchDarkly has never encountered the user's key before, it calculates the flag values based on the user key alone.\n", + Use: "replace-flag-setting", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "user-key", + In: "path", + Description: "The user key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", + }, + }, + HTTPMethod: "PUT", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/users/{projectKey}/{environmentKey}/{userKey}/flags/{featureFlagKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_UsersResourceCmd, client, OperationData{ + Short: "Delete user", + Long: "\u003e ### Use contexts instead\n\u003e\n\u003e After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use [Delete context instances](/tag/Contexts#operation/deleteContextInstances) instead of this endpoint.\n\nDelete a user by key.\n", + Use: "delete", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "user-key", + In: "path", + Description: "The user key", + Type: "string", + }, + }, + HTTPMethod: "DELETE", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/users/{projectKey}/{environmentKey}/{userKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_UsersResourceCmd, client, OperationData{ + Short: "Find users", + Long: "\u003e ### Use contexts instead\n\u003e\n\u003e After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use [Search for context instances](/tag/Contexts#operation/searchContextInstances) instead of this endpoint.\n\nSearch users in LaunchDarkly based on their last active date, a user attribute filter set, or a search query.\n\nAn example user attribute filter set is `filter=firstName:Anna,activeTrial:false`. This matches users that have the user attribute `firstName` set to `Anna`, that also have the attribute `activeTrial` set to `false`.\n\nTo paginate through results, follow the `next` link in the `_links` object. To learn more, read [Representations](/#section/Representations).\n", + Use: "list-search", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "q", + In: "query", + Description: "Full-text search for users based on name, first name, last name, e-mail address, or key", + Type: "string", + }, + { + Name: "limit", + In: "query", + Description: "Specifies the maximum number of items in the collection to return (max: 50, default: 20)", + Type: "integer", + }, + { + Name: "offset", + In: "query", + Description: "Deprecated, use `searchAfter` instead. Specifies the first item to return in the collection.", + Type: "integer", + }, + { + Name: "after", + In: "query", + Description: "A Unix epoch time in milliseconds specifying the maximum last time a user requested a feature flag from LaunchDarkly", + Type: "integer", + }, + { + Name: "sort", + In: "query", + Description: "Specifies a field by which to sort. LaunchDarkly supports the `userKey` and `lastSeen` fields. Fields prefixed by a dash ( - ) sort in descending order.", + Type: "string", + }, + { + Name: "search-after", + In: "query", + Description: "Limits results to users with sort values after the value you specify. You can use this for pagination, but we recommend using the `next` link we provide instead.", + Type: "string", + }, + { + Name: "filter", + In: "query", + Description: "A comma-separated list of user attribute filters. Each filter is in the form of attributeKey:attributeValue", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/user-search/{projectKey}/{environmentKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_UsersResourceCmd, client, OperationData{ + Short: "Get user", + Long: "\u003e ### Use contexts instead\n\u003e\n\u003e After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use [Get context instances](/tag/Contexts#operation/getContextInstances) instead of this endpoint.\n\nGet a user by key. The `user` object contains all attributes sent in `variation` calls for that key.\n", + Use: "get", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "user-key", + In: "path", + Description: "The user key", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/users/{projectKey}/{environmentKey}/{userKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_UsersResourceCmd, client, OperationData{ + Short: "List users", + Long: "\u003e ### Use contexts instead\n\u003e\n\u003e After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use [Search for contexts](/tag/Contexts#operation/searchContexts) instead of this endpoint.\n\nList all users in the environment. Includes the total count of users. This is useful for exporting all users in the system for further analysis.\n\nEach page displays users up to a set `limit`. The default is 20. To page through, follow the `next` link in the `_links` object. To learn more, read [Representations](/#section/Representations).\n", + Use: "list", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "limit", + In: "query", + Description: "The number of elements to return per page", + Type: "integer", + }, + { + Name: "search-after", + In: "query", + Description: "Limits results to users with sort values after the value you specify. You can use this for pagination, but we recommend using the `next` link we provide instead.", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/users/{projectKey}/{environmentKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_WebhooksResourceCmd, client, OperationData{ + Short: "Delete webhook", + Long: "Delete a webhook by ID.", + Use: "delete", + Params: []Param{ + { + Name: "id", + In: "path", + Description: "The ID of the webhook to delete", + Type: "string", + }, + }, + HTTPMethod: "DELETE", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/webhooks/{id}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_WebhooksResourceCmd, client, OperationData{ + Short: "List webhooks", + Long: "Fetch a list of all webhooks.", + Use: "list-all", + Params: []Param{}, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/webhooks", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_WebhooksResourceCmd, client, OperationData{ + Short: "Get webhook", + Long: "Get a single webhook by ID.", + Use: "get", + Params: []Param{ + { + Name: "id", + In: "path", + Description: "The ID of the webhook", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/webhooks/{id}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_WebhooksResourceCmd, client, OperationData{ + Short: "Update webhook", + Long: "Update a webhook's settings. Updating webhook settings uses a [JSON patch](https://datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes. To learn more, read [Updates](/#section/Overview/Updates).", + Use: "update", + Params: []Param{ + { + Name: "id", + In: "path", + Description: "The ID of the webhook to update", + Type: "string", + }, + }, + HTTPMethod: "PATCH", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/webhooks/{id}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_WebhooksResourceCmd, client, OperationData{ + Short: "Creates a webhook", + Long: "Create a new webhook.", + Use: "create", + Params: []Param{}, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/webhooks", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_WorkflowTemplatesResourceCmd, client, OperationData{ + Short: "Create workflow template", + Long: "Create a template for a feature flag workflow", + Use: "create", + Params: []Param{}, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/templates", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_WorkflowTemplatesResourceCmd, client, OperationData{ + Short: "Delete workflow template", + Long: "Delete a workflow template", + Use: "delete", + Params: []Param{ + { + Name: "template-key", + In: "path", + Description: "The template key", + Type: "string", + }, + }, + HTTPMethod: "DELETE", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/templates/{templateKey}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_WorkflowTemplatesResourceCmd, client, OperationData{ + Short: "Get workflow templates", + Long: "Get workflow templates belonging to an account, or can optionally return templates_endpoints.workflowTemplateSummariesListingOutputRep when summary query param is true", + Use: "list", + Params: []Param{ + { + Name: "summary", + In: "query", + Description: "Whether the entire template object or just a summary should be returned", + Type: "boolean", + }, + { + Name: "search", + In: "query", + Description: "The substring in either the name or description of a template", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/templates", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_WorkflowsResourceCmd, client, OperationData{ + Short: "Delete workflow", + Long: "Delete a workflow from a feature flag.", + Use: "delete", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "workflow-id", + In: "path", + Description: "The workflow id", + Type: "string", + }, + }, + HTTPMethod: "DELETE", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/workflows/{workflowId}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_WorkflowsResourceCmd, client, OperationData{ + Short: "Get custom workflow", + Long: "Get a specific workflow by ID.", + Use: "get-custom", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "workflow-id", + In: "path", + Description: "The workflow ID", + Type: "string", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/workflows/{workflowId}", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_WorkflowsResourceCmd, client, OperationData{ + Short: "Get workflows", + Long: "Display workflows associated with a feature flag.", + Use: "list", + Params: []Param{ + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + { + Name: "status", + In: "query", + Description: "Filter results by workflow status. Valid status filters are `active`, `completed`, and `failed`.", + Type: "string", + }, + { + Name: "sort", + In: "query", + Description: "A field to sort the items by. Prefix field by a dash ( - ) to sort in descending order. This endpoint supports sorting by `creationDate` or `stopDate`.", + Type: "string", + }, + { + Name: "limit", + In: "query", + Description: "The maximum number of workflows to return. Defaults to 20.", + Type: "integer", + }, + { + Name: "offset", + In: "query", + Description: "Where to start in the list. Defaults to 0. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.", + Type: "integer", + }, + }, + HTTPMethod: "GET", + HasBody: false, + RequiresBody: false, + Path: "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/workflows", + SupportsSemanticPatch: false, + }) + + NewOperationCmd(gen_WorkflowsResourceCmd, client, OperationData{ + Short: "Create workflow", + Long: "Create a workflow for a feature flag. You can create a workflow directly, or you can apply a template to create a new workflow.\n\n### Creating a workflow\n\nYou can use the create workflow endpoint to create a workflow directly by adding a `stages` array to the request body.\n\nFor each stage, define the `name`, `conditions` when the stage should be executed, and `action` that describes the stage.\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand example\u003c/summary\u003e\n\n_Example request body_\n```json\n{\n \"name\": \"Progressive rollout starting in two days\",\n \"description\": \"Turn flag targeting on and increase feature rollout in 10% increments each day\",\n \"stages\": [\n {\n \"name\": \"10% rollout on day 1\",\n \"conditions\": [\n {\n \"kind\": \"schedule\",\n \"scheduleKind\": \"relative\", // or \"absolute\"\n // If \"scheduleKind\" is \"absolute\", set \"executionDate\";\n // \"waitDuration\" and \"waitDurationUnit\" will be ignored\n \"waitDuration\": 2,\n \"waitDurationUnit\": \"calendarDay\"\n },\n {\n \"kind\": \"ld-approval\",\n \"notifyMemberIds\": [ \"507f1f77bcf86cd799439011\" ],\n \"notifyTeamKeys\": [ \"team-key-123abc\" ]\n }\n ],\n \"action\": {\n \"instructions\": [\n {\n \"kind\": \"turnFlagOn\"\n },\n {\n \"kind\": \"updateFallthroughVariationOrRollout\",\n \"rolloutWeights\": {\n \"452f5fb5-7320-4ba3-81a1-8f4324f79d49\": 90000,\n \"fc15f6a4-05d3-4aa4-a997-446be461345d\": 10000\n }\n }\n ]\n }\n }\n ]\n}\n```\n\u003c/details\u003e\n\n### Creating a workflow by applying a workflow template\n\nYou can also create a workflow by applying a workflow template. If you pass a valid workflow template key as the `templateKey` query parameter with the request, the API will attempt to create a new workflow with the stages defined in the workflow template with the corresponding key.\n\n#### Applicability of stages\nTemplates are created in the context of a particular flag in a particular environment in a particular project. However, because workflows created from a template can be applied to any project, environment, and flag, some steps of the workflow may need to be updated in order to be applicable for the target resource.\n\nYou can pass a `dryRun` query parameter to tell the API to return a report of which steps of the workflow template are applicable in the target project/environment/flag, and which will need to be updated. When the `dryRun` query parameter is present the response body includes a `meta` property that holds a list of parameters that could potentially be inapplicable for the target resource. Each of these parameters will include a `valid` field. You will need to update any invalid parameters in order to create the new workflow. You can do this using the `parameters` property, which overrides the workflow template parameters.\n\n#### Overriding template parameters\nYou can use the `parameters` property in the request body to tell the API to override the specified workflow template parameters with new values that are specific to your target project/environment/flag.\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand example\u003c/summary\u003e\n\n_Example request body_\n```json\n{\n\t\"name\": \"workflow created from my-template\",\n\t\"description\": \"description of my workflow\",\n\t\"parameters\": [\n\t\t{\n\t\t\t\"_id\": \"62cf2bc4cadbeb7697943f3b\",\n\t\t\t\"path\": \"/clauses/0/values\",\n\t\t\t\"default\": {\n\t\t\t\t\"value\": [\"updated-segment\"]\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"_id\": \"62cf2bc4cadbeb7697943f3d\",\n\t\t\t\"path\": \"/variationId\",\n\t\t\t\"default\": {\n\t\t\t\t\"value\": \"abcd1234-abcd-1234-abcd-1234abcd12\"\n\t\t\t}\n\t\t}\n\t]\n}\n```\n\u003c/details\u003e\n\nIf there are any steps in the template that are not applicable to the target resource, the workflow will not be created, and the `meta` property will be included in the response body detailing which parameters need to be updated.\n", + Use: "create", + Params: []Param{ + { + Name: "template-key", + In: "query", + Description: "The template key to apply as a starting point for the new workflow", + Type: "string", + }, + { + Name: "dry-run", + In: "query", + Description: "Whether to call the endpoint in dry-run mode", + Type: "boolean", + }, + { + Name: "project-key", + In: "path", + Description: "The project key", + Type: "string", + }, + { + Name: "feature-flag-key", + In: "path", + Description: "The feature flag key", + Type: "string", + }, + { + Name: "environment-key", + In: "path", + Description: "The environment key", + Type: "string", + }, + }, + HTTPMethod: "POST", + HasBody: true, + RequiresBody: true, + Path: "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/workflows", SupportsSemanticPatch: false, }) diff --git a/cmd/resources/resource_cmds.tmpl b/cmd/resources/resource_cmds.tmpl index 1f3b2de2..6ff7d98c 100644 --- a/cmd/resources/resource_cmds.tmpl +++ b/cmd/resources/resource_cmds.tmpl @@ -11,11 +11,11 @@ import ( func AddAllResourceCmds(rootCmd *cobra.Command, client resources.Client, analyticsTracker analytics.Tracker) { // Resource commands - {{ range $resName, $resData := .Resources }} - gen_{{ $resName }}ResourceCmd := NewResourceCmd( + {{ range $resKey, $resData := .Resources }} + gen_{{ $resData.GoName }}ResourceCmd := NewResourceCmd( rootCmd, analyticsTracker, - "{{ $resData.Name }}", + "{{ $resKey }}", "Make requests (list, create, etc.) on {{ $resData.DisplayName }}", {{ $resData.Description }}, ) @@ -23,7 +23,7 @@ func AddAllResourceCmds(rootCmd *cobra.Command, client resources.Client, analyti // Operation commands {{ range $resName, $resData := .Resources }}{{ range $opName, $opData := $resData.Operations }} - NewOperationCmd(gen_{{ $resName }}ResourceCmd, client, OperationData{ + NewOperationCmd(gen_{{ $resData.GoName }}ResourceCmd, client, OperationData{ Short: {{ $opData.Short }}, Long: {{ $opData.Long }}, Use: "{{ $opData.Use }}", @@ -36,6 +36,7 @@ func AddAllResourceCmds(rootCmd *cobra.Command, client resources.Client, analyti }, {{ end }} }, HTTPMethod: "{{ $opData.HTTPMethod }}", + HasBody: {{ $opData.HasBody }}, RequiresBody: {{ $opData.RequiresBody }}, Path: "{{ $opData.Path }}", SupportsSemanticPatch: {{ $opData.SupportsSemanticPatch }}, diff --git a/cmd/resources/resource_cmds_test.go b/cmd/resources/resource_cmds_test.go index a2d9826a..ab48792d 100644 --- a/cmd/resources/resource_cmds_test.go +++ b/cmd/resources/resource_cmds_test.go @@ -14,7 +14,7 @@ func TestCreateTeam(t *testing.T) { t.Run("help shows postTeam description", func(t *testing.T) { args := []string{ "teams", - "post-team", // temporary command name + "create", "--help", } diff --git a/cmd/resources/resource_utils.go b/cmd/resources/resource_utils.go new file mode 100644 index 00000000..304bc104 --- /dev/null +++ b/cmd/resources/resource_utils.go @@ -0,0 +1,125 @@ +package resources + +import ( + "fmt" + "regexp" + "strconv" + "strings" + + "github.com/getkin/kin-openapi/openapi3" + "github.com/iancoleman/strcase" +) + +// we have certain tags that aren't a 1:1 match to their operation id names +var mapTagToSchemaName = map[string]string{ + "Access tokens": "Tokens", + "Account members": "Members", + "Approvals": "Approval requests", + "Code references": "Code refs", + "OAuth2 Clients": "Oauth2 clients", // this is just so we don't kebab case to o-auth + "User settings": "User flag settings", +} + +func getResourceNames(name string) (string, string) { + if mappedName, ok := mapTagToSchemaName[name]; ok { + name = mappedName + } + + resourceKey := strcase.ToKebab(name) + // the operationIds use "FeatureFlag" so we want to keep that whole, but the command should just be `flags` + if name == "Feature flags" { + resourceKey = "flags" + } + return name, resourceKey +} + +func replaceMethodWithCmdUse(operationId string) string { + r := strings.NewReplacer( + "post", "create", + "patch", "update", + "put", "replace", + ) + + return r.Replace(operationId) +} + +func removeResourceFromOperationId(resourceName, operationId string) string { + // operations use both singular (Team) and plural (Teams) resource names, whereas resource names are (usually) plural + var singularResourceName string + if strings.HasSuffix("teams", "s") { + singularResourceName = strings.TrimRight(resourceName, "s") + } + + r := strings.NewReplacer( + // a lot of "list" operations say "GetFor{ResourceName}" + fmt.Sprintf("For%s", singularResourceName), "", + fmt.Sprintf("For%s", resourceName), "", + fmt.Sprint("ByProject"), "", + resourceName, "", + singularResourceName, "", + ) + + return r.Replace(operationId) +} + +func getCmdUse(resourceName, operationId string, isList bool) string { + action := removeResourceFromOperationId(resourceName, operationId) + action = strcase.ToKebab(action) + action = replaceMethodWithCmdUse(action) + + if isList { + re := regexp.MustCompile(`^get(.*)$`) + action = re.ReplaceAllString(action, "list$1") + } + + return action +} + +func isListResponse(op *openapi3.Operation, spec *openapi3.T) bool { + // get the success response type from the operation to retrieve its schema + var schema *openapi3.SchemaRef + for respType, respInfo := range op.Responses.Map() { + respCode, _ := strconv.Atoi(respType) + if respCode < 300 { + for _, s := range respInfo.Value.Content { + schemaName := strings.TrimPrefix(s.Schema.Ref, "#/components/schemas/") + schema = spec.Components.Schemas[schemaName] + } + } + } + + // if the schema is nil, there is no response body for the request + if schema == nil { + return false + } + + for propName := range schema.Value.Properties { + if propName == "items" { + return true + } + } + + return false +} + +var mapParamToFlagName = map[string]string{ + "feature-flag": "flag", +} + +func stripFlagName(flagName string) string { + r := strings.NewReplacer( + "-key", "", + "-id", "", + ) + + return r.Replace(flagName) +} + +func getFlagName(paramName string) string { + flagName := strcase.ToKebab(paramName) + flagName = stripFlagName(flagName) + if mappedName, ok := mapParamToFlagName[flagName]; ok { + flagName = mappedName + } + return flagName +} diff --git a/cmd/resources/resources.go b/cmd/resources/resources.go index 5d486ac8..03f20dcc 100644 --- a/cmd/resources/resources.go +++ b/cmd/resources/resources.go @@ -28,7 +28,7 @@ type TemplateData struct { } type ResourceData struct { - Name string + GoName string DisplayName string Description string Operations map[string]OperationData @@ -40,6 +40,7 @@ type OperationData struct { Use string Params []Param HTTPMethod string + HasBody bool RequiresBody bool Path string SupportsSemanticPatch bool @@ -76,9 +77,11 @@ func GetTemplateData(fileName string) (TemplateData, error) { // skip beta resources for now continue } - resources[strcase.ToCamel(r.Name)] = ResourceData{ - DisplayName: strings.ToLower(r.Name), - Name: strcase.ToKebab(strings.ToLower(r.Name)), + + resourceName, resourceKey := getResourceNames(r.Name) + resources[resourceKey] = ResourceData{ + GoName: strcase.ToCamel(resourceName), + DisplayName: strings.ToLower(resourceName), Description: jsonString(r.Description), Operations: make(map[string]OperationData, 0), } @@ -91,26 +94,35 @@ func GetTemplateData(fileName string) (TemplateData, error) { // skip beta resources for now continue } - resource, ok := resources[tag] + _, resourceKey := getResourceNames(tag) + resource, ok := resources[resourceKey] if !ok { - log.Printf("Matching resource not found for %s operation's tag: %s", op.OperationID, tag) + log.Printf("Matching resource not found for %s operation's tag: %s", op.OperationID, resourceKey) continue } - use := getCmdUse(method, op, spec) + isList := isListResponse(op, spec) + use := getCmdUse(resource.GoName, op.OperationID, isList) var supportsSemanticPatch bool if strings.Contains(op.Description, "semantic patch") { supportsSemanticPatch = true } + var hasBody, requiresBody bool + if op.RequestBody != nil { + hasBody = true + requiresBody = op.RequestBody.Value.Required + } + operation := OperationData{ Short: jsonString(op.Summary), Long: jsonString(op.Description), Use: use, Params: make([]Param, 0), HTTPMethod: method, - RequiresBody: method == "PUT" || method == "POST" || method == "PATCH", + HasBody: hasBody, + RequiresBody: requiresBody, Path: path, SupportsSemanticPatch: supportsSemanticPatch, } @@ -137,45 +149,6 @@ func GetTemplateData(fileName string) (TemplateData, error) { return TemplateData{Resources: resources}, nil } -func getCmdUse(method string, op *openapi3.Operation, spec *openapi3.T) string { - return strcase.ToKebab(op.OperationID) - - // TODO: work with operation ID & response type to stripe out resource name and update post -> create, get -> list, etc. - //methodMap := map[string]string{ - // "GET": "get", - // "POST": "create", - // "PUT": "replace", // TODO: confirm this - // "DELETE": "delete", - // "PATCH": "update", - //} - // - //use := methodMap[method] - // - //var schema *openapi3.SchemaRef - //for respType, respInfo := range op.Responses.Map() { - // respCode, _ := strconv.Atoi(respType) - // if respCode < 300 { - // for _, s := range respInfo.Value.Content { - // schemaName := strings.TrimPrefix(s.Schema.Ref, "#/components/schemas/") - // schema = spec.Components.Schemas[schemaName] - // } - // } - //} - // - //if schema == nil { - // // probably won't need to keep this logging in but leaving it for debugging purposes - // log.Printf("No response type defined for %s", op.OperationID) - //} else { - // for propName := range schema.Value.Properties { - // if propName == "items" { - // use = "list" - // break - // } - // } - //} - //return use -} - func NewResourceCmd(parentCmd *cobra.Command, analyticsTracker analytics.Tracker, resourceName, shortDescription, longDescription string) *cobra.Command { cmd := &cobra.Command{ Use: resourceName, @@ -203,13 +176,15 @@ type OperationCmd struct { } func (op *OperationCmd) initFlags() error { - if op.RequiresBody { + if op.HasBody { op.cmd.Flags().StringP(cliflags.DataFlag, "d", "", "Input data in JSON") - err := op.cmd.MarkFlagRequired(cliflags.DataFlag) - if err != nil { - return err + if op.RequiresBody { + err := op.cmd.MarkFlagRequired(cliflags.DataFlag) + if err != nil { + return err + } } - err = viper.BindPFlag(cliflags.DataFlag, op.cmd.Flags().Lookup(cliflags.DataFlag)) + err := viper.BindPFlag(cliflags.DataFlag, op.cmd.Flags().Lookup(cliflags.DataFlag)) if err != nil { return err } @@ -224,7 +199,7 @@ func (op *OperationCmd) initFlags() error { } for _, p := range op.Params { - flagName := strcase.ToKebab(p.Name) + flagName := getFlagName(p.Name) op.cmd.Flags().String(flagName, "", p.Description) @@ -271,7 +246,8 @@ func (op *OperationCmd) makeRequest(cmd *cobra.Command, args []string) error { query := url.Values{} var urlParms []string for _, p := range op.Params { - val := viper.GetString(p.Name) + flagName := getFlagName(p.Name) + val := viper.GetString(flagName) if val != "" { switch p.In { case "path": @@ -301,7 +277,13 @@ func (op *OperationCmd) makeRequest(cmd *cobra.Command, args []string) error { return errors.NewError(output.CmdOutputError(viper.GetString(cliflags.OutputFlag), err)) } - output, err := output.CmdOutput("get", viper.GetString(cliflags.OutputFlag), res) + if string(res) == "" { + // assuming the key to be deleted/replaced is last in the list of params, + // e.g. contexts delete-instances or code-refs replace-branch + res = []byte(fmt.Sprintf(`{"key": %q}`, urlParms[len(urlParms)-1])) + } + + output, err := output.CmdOutput(cmd.Use, viper.GetString(cliflags.OutputFlag), res) if err != nil { return errors.NewError(err.Error()) } diff --git a/cmd/resources/test_data/expected_template_data.json b/cmd/resources/test_data/expected_template_data.json index e433dbd5..21a43efb 100644 --- a/cmd/resources/test_data/expected_template_data.json +++ b/cmd/resources/test_data/expected_template_data.json @@ -1,14 +1,14 @@ { "Resources":{ - "Teams":{ - "Name":"teams", + "teams":{ + "GoName":"Teams", "DisplayName":"teams", "Description":"\"A team is a group of members in your LaunchDarkly account.\"", "Operations":{ "deleteTeam":{ "Short":"\"Delete team\"", "Long":"\"Delete a team by key.\"", - "Use":"delete-team", + "Use":"delete", "Params":[ { "Name":"team-key", @@ -19,6 +19,7 @@ } ], "HTTPMethod":"DELETE", + "HasBody":false, "RequiresBody":false, "Path":"/api/v2/teams/{teamKey}", "SupportsSemanticPatch":false @@ -26,7 +27,7 @@ "getTeam":{ "Short":"\"Get team\"", "Long":"\"Get team\"", - "Use":"get-team", + "Use":"get", "Params":[ { "Name":"team-key", @@ -44,6 +45,7 @@ } ], "HTTPMethod":"GET", + "HasBody":false, "RequiresBody":false, "Path":"/api/v2/teams/{teamKey}", "SupportsSemanticPatch":false @@ -51,7 +53,7 @@ "getTeams":{ "Short":"\"List teams\"", "Long":"\"Return a list of teams.\"", - "Use":"get-teams", + "Use":"list", "Params":[ { "Name":"limit", @@ -62,6 +64,7 @@ } ], "HTTPMethod":"GET", + "HasBody":false, "RequiresBody":false, "Path":"/api/v2/teams", "SupportsSemanticPatch":false @@ -69,7 +72,7 @@ "patchTeam":{ "Short":"\"Update team\"", "Long":"\"Perform a partial update to a team.\"", - "Use":"patch-team", + "Use":"update", "Params":[ { "Name":"team-key", @@ -87,6 +90,7 @@ } ], "HTTPMethod":"PATCH", + "HasBody":true, "RequiresBody":true, "Path":"/api/v2/teams/{teamKey}", "SupportsSemanticPatch":false @@ -94,7 +98,7 @@ "postTeam":{ "Short":"\"Create team\"", "Long":"\"Create a team.\"", - "Use":"post-team", + "Use":"create", "Params":[ { "Name":"expand", @@ -105,6 +109,7 @@ } ], "HTTPMethod":"POST", + "HasBody":true, "RequiresBody":true, "Path":"/api/v2/teams", "SupportsSemanticPatch":false diff --git a/cmd/root.go b/cmd/root.go index 83574bde..79763ed2 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -4,6 +4,7 @@ package cmd import ( "fmt" + mbrscmd "ldcli/cmd/members" "log" "os" "strconv" @@ -14,10 +15,6 @@ import ( "ldcli/cmd/cliflags" configcmd "ldcli/cmd/config" - envscmd "ldcli/cmd/environments" - flagscmd "ldcli/cmd/flags" - mbrscmd "ldcli/cmd/members" - projcmd "ldcli/cmd/projects" resourcecmd "ldcli/cmd/resources" "ldcli/internal/analytics" "ldcli/internal/config" @@ -123,29 +120,14 @@ func NewRootCommand( return nil, err } - environmentsCmd, err := envscmd.NewEnvironmentsCmd(analyticsTracker, clients.EnvironmentsClient) - if err != nil { - return nil, err - } - flagsCmd, err := flagscmd.NewFlagsCmd(analyticsTracker, clients.FlagsClient) - if err != nil { - return nil, err - } membersCmd, err := mbrscmd.NewMembersCmd(analyticsTracker, clients.MembersClient) if err != nil { return nil, err } - projectsCmd, err := projcmd.NewProjectsCmd(analyticsTracker, clients.ProjectsClient) - if err != nil { - return nil, err - } cmd.AddCommand(configcmd.NewConfigCmd(analyticsTracker)) - cmd.AddCommand(environmentsCmd) - cmd.AddCommand(flagsCmd) - cmd.AddCommand(membersCmd) - cmd.AddCommand(projectsCmd) cmd.AddCommand(NewQuickStartCmd(analyticsTracker, clients.EnvironmentsClient, clients.FlagsClient)) + cmd.AddCommand(membersCmd) resourcecmd.AddAllResourceCmds(cmd, clients.ResourcesClient, analyticsTracker) diff --git a/internal/output/resource_output.go b/internal/output/resource_output.go index 47c2aa2e..456f66fb 100644 --- a/internal/output/resource_output.go +++ b/internal/output/resource_output.go @@ -46,6 +46,9 @@ func CmdOutput(action string, outputKind string, input []byte) (string, error) { } if isMultipleResponse { + if len(maybeResources.Items) == 0 { + return "No items found", nil + } // the response could have various properties we want to show outputFn := MultiplePlaintextOutputFn if _, ok := maybeResources.Items[0]["email"]; ok { diff --git a/ld-openapi.json b/ld-openapi.json new file mode 100644 index 00000000..4e630a6b --- /dev/null +++ b/ld-openapi.json @@ -0,0 +1,37303 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "LaunchDarkly REST API", + "description": "# Overview\n\n## Authentication\n\nLaunchDarkly's REST API uses the HTTPS protocol with a minimum TLS version of 1.2.\n\nAll REST API resources are authenticated with either [personal or service access tokens](https://docs.launchdarkly.com/home/account-security/api-access-tokens), or session cookies. Other authentication mechanisms are not supported. You can manage personal access tokens on your [**Account settings**](https://app.launchdarkly.com/settings/tokens) page.\n\nLaunchDarkly also has SDK keys, mobile keys, and client-side IDs that are used by our server-side SDKs, mobile SDKs, and JavaScript-based SDKs, respectively. **These keys cannot be used to access our REST API**. These keys are environment-specific, and can only perform read-only operations such as fetching feature flag settings.\n\n| Auth mechanism | Allowed resources | Use cases |\n| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -------------------------------------------------- |\n| [Personal or service access tokens](https://docs.launchdarkly.com/home/account-security/api-access-tokens) | Can be customized on a per-token basis | Building scripts, custom integrations, data export. |\n| SDK keys | Can only access read-only resources specific to server-side SDKs. Restricted to a single environment. | Server-side SDKs |\n| Mobile keys | Can only access read-only resources specific to mobile SDKs, and only for flags marked available to mobile keys. Restricted to a single environment. | Mobile SDKs |\n| Client-side ID | Can only access read-only resources specific to JavaScript-based client-side SDKs, and only for flags marked available to client-side. Restricted to a single environment. | Client-side JavaScript |\n\n> #### Keep your access tokens and SDK keys private\n>\n> Access tokens should _never_ be exposed in untrusted contexts. Never put an access token in client-side JavaScript, or embed it in a mobile application. LaunchDarkly has special mobile keys that you can embed in mobile apps. If you accidentally expose an access token or SDK key, you can reset it from your [**Account settings**](https://app.launchdarkly.com/settings/tokens) page.\n>\n> The client-side ID is safe to embed in untrusted contexts. It's designed for use in client-side JavaScript.\n\n### Authentication using request header\n\nThe preferred way to authenticate with the API is by adding an `Authorization` header containing your access token to your requests. The value of the `Authorization` header must be your access token.\n\nManage personal access tokens from the [**Account settings**](https://app.launchdarkly.com/settings/tokens) page.\n\n### Authentication using session cookie\n\nFor testing purposes, you can make API calls directly from your web browser. If you are logged in to the LaunchDarkly application, the API will use your existing session to authenticate calls.\n\nIf you have a [role](https://docs.launchdarkly.com/home/team/built-in-roles) other than Admin, or have a [custom role](https://docs.launchdarkly.com/home/team/custom-roles) defined, you may not have permission to perform some API calls. You will receive a `401` response code in that case.\n\n> ### Modifying the Origin header causes an error\n>\n> LaunchDarkly validates that the Origin header for any API request authenticated by a session cookie matches the expected Origin header. The expected Origin header is `https://app.launchdarkly.com`.\n>\n> If the Origin header does not match what's expected, LaunchDarkly returns an error. This error can prevent the LaunchDarkly app from working correctly.\n>\n> Any browser extension that intentionally changes the Origin header can cause this problem. For example, the `Allow-Control-Allow-Origin: *` Chrome extension changes the Origin header to `http://evil.com` and causes the app to fail.\n>\n> To prevent this error, do not modify your Origin header.\n>\n> LaunchDarkly does not require origin matching when authenticating with an access token, so this issue does not affect normal API usage.\n\n## Representations\n\nAll resources expect and return JSON response bodies. Error responses also send a JSON body. To learn more about the error format of the API, read [Errors](/#section/Overview/Errors).\n\nIn practice this means that you always get a response with a `Content-Type` header set to `application/json`.\n\nIn addition, request bodies for `PATCH`, `POST`, and `PUT` requests must be encoded as JSON with a `Content-Type` header set to `application/json`.\n\n### Summary and detailed representations\n\nWhen you fetch a list of resources, the response includes only the most important attributes of each resource. This is a _summary representation_ of the resource. When you fetch an individual resource, such as a single feature flag, you receive a _detailed representation_ of the resource.\n\nThe best way to find a detailed representation is to follow links. Every summary representation includes a link to its detailed representation.\n\n### Expanding responses\n\nSometimes the detailed representation of a resource does not include all of the attributes of the resource by default. If this is the case, the request method will clearly document this and describe which attributes you can include in an expanded response.\n\nTo include the additional attributes, append the `expand` request parameter to your request and add a comma-separated list of the attributes to include. For example, when you append `?expand=members,roles` to the [Get team](/tag/Teams#operation/getTeam) endpoint, the expanded response includes both of these attributes.\n\n### Links and addressability\n\nThe best way to navigate the API is by following links. These are attributes in representations that link to other resources. The API always uses the same format for links:\n\n- Links to other resources within the API are encapsulated in a `_links` object\n- If the resource has a corresponding link to HTML content on the site, it is stored in a special `_site` link\n\nEach link has two attributes:\n\n- An `href`, which contains the URL\n- A `type`, which describes the content type\n\nFor example, a feature resource might return the following:\n\n```json\n{\n \"_links\": {\n \"parent\": {\n \"href\": \"/api/features\",\n \"type\": \"application/json\"\n },\n \"self\": {\n \"href\": \"/api/features/sort.order\",\n \"type\": \"application/json\"\n }\n },\n \"_site\": {\n \"href\": \"/features/sort.order\",\n \"type\": \"text/html\"\n }\n}\n```\n\nFrom this, you can navigate to the parent collection of features by following the `parent` link, or navigate to the site page for the feature by following the `_site` link.\n\nCollections are always represented as a JSON object with an `items` attribute containing an array of representations. Like all other representations, collections have `_links` defined at the top level.\n\nPaginated collections include `first`, `last`, `next`, and `prev` links containing a URL with the respective set of elements in the collection.\n\n## Updates\n\nResources that accept partial updates use the `PATCH` verb. Most resources support the [JSON patch](/reference#updates-using-json-patch) format. Some resources also support the [JSON merge patch](/reference#updates-using-json-merge-patch) format, and some resources support the [semantic patch](/reference#updates-using-semantic-patch) format, which is a way to specify the modifications to perform as a set of executable instructions. Each resource supports optional [comments](/reference#updates-with-comments) that you can submit with updates. Comments appear in outgoing webhooks, the audit log, and other integrations.\n\nWhen a resource supports both JSON patch and semantic patch, we document both in the request method. However, the specific request body fields and descriptions included in our documentation only match one type of patch or the other.\n\n### Updates using JSON patch\n\n[JSON patch](https://datatracker.ietf.org/doc/html/rfc6902) is a way to specify the modifications to perform on a resource. JSON patch uses paths and a limited set of operations to describe how to transform the current state of the resource into a new state. JSON patch documents are always arrays, where each element contains an operation, a path to the field to update, and the new value.\n\nFor example, in this feature flag representation:\n\n```json\n{\n \"name\": \"New recommendations engine\",\n \"key\": \"engine.enable\",\n \"description\": \"This is the description\",\n ...\n}\n```\nYou can change the feature flag's description with the following patch document:\n\n```json\n[{ \"op\": \"replace\", \"path\": \"/description\", \"value\": \"This is the new description\" }]\n```\n\nYou can specify multiple modifications to perform in a single request. You can also test that certain preconditions are met before applying the patch:\n\n```json\n[\n { \"op\": \"test\", \"path\": \"/version\", \"value\": 10 },\n { \"op\": \"replace\", \"path\": \"/description\", \"value\": \"The new description\" }\n]\n```\n\nThe above patch request tests whether the feature flag's `version` is `10`, and if so, changes the feature flag's description.\n\nAttributes that are not editable, such as a resource's `_links`, have names that start with an underscore.\n\n### Updates using JSON merge patch\n\n[JSON merge patch](https://datatracker.ietf.org/doc/html/rfc7386) is another format for specifying the modifications to perform on a resource. JSON merge patch is less expressive than JSON patch. However, in many cases it is simpler to construct a merge patch document. For example, you can change a feature flag's description with the following merge patch document:\n\n```json\n{\n \"description\": \"New flag description\"\n}\n```\n\n### Updates using semantic patch\n\nSome resources support the semantic patch format. A semantic patch is a way to specify the modifications to perform on a resource as a set of executable instructions.\n\nSemantic patch allows you to be explicit about intent using precise, custom instructions. In many cases, you can define semantic patch instructions independently of the current state of the resource. This can be useful when defining a change that may be applied at a future date.\n\nTo make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header.\n\nHere's how:\n\n```\nContent-Type: application/json; domain-model=launchdarkly.semanticpatch\n```\n\nIf you call a semantic patch resource without this header, you will receive a `400` response because your semantic patch will be interpreted as a JSON patch.\n\nThe body of a semantic patch request takes the following properties:\n\n* `comment` (string): (Optional) A description of the update.\n* `environmentKey` (string): (Required for some resources only) The environment key.\n* `instructions` (array): (Required) A list of actions the update should perform. Each action in the list must be an object with a `kind` property that indicates the instruction. If the instruction requires parameters, you must include those parameters as additional fields in the object. The documentation for each resource that supports semantic patch includes the available instructions and any additional parameters.\n\nFor example:\n\n```json\n{\n \"comment\": \"optional comment\",\n \"instructions\": [ {\"kind\": \"turnFlagOn\"} ]\n}\n```\n\nIf any instruction in the patch encounters an error, the endpoint returns an error and will not change the resource. In general, each instruction silently does nothing if the resource is already in the state you request.\n\n### Updates with comments\n\nYou can submit optional comments with `PATCH` changes.\n\nTo submit a comment along with a JSON patch document, use the following format:\n\n```json\n{\n \"comment\": \"This is a comment string\",\n \"patch\": [{ \"op\": \"replace\", \"path\": \"/description\", \"value\": \"The new description\" }]\n}\n```\n\nTo submit a comment along with a JSON merge patch document, use the following format:\n\n```json\n{\n \"comment\": \"This is a comment string\",\n \"merge\": { \"description\": \"New flag description\" }\n}\n```\n\nTo submit a comment along with a semantic patch, use the following format:\n\n```json\n{\n \"comment\": \"This is a comment string\",\n \"instructions\": [ {\"kind\": \"turnFlagOn\"} ]\n}\n```\n\n## Errors\n\nThe API always returns errors in a common format. Here's an example:\n\n```json\n{\n \"code\": \"invalid_request\",\n \"message\": \"A feature with that key already exists\",\n \"id\": \"30ce6058-87da-11e4-b116-123b93f75cba\"\n}\n```\n\nThe `code` indicates the general class of error. The `message` is a human-readable explanation of what went wrong. The `id` is a unique identifier. Use it when you're working with LaunchDarkly Support to debug a problem with a specific API call.\n\n### HTTP status error response codes\n\n| Code | Definition | Description | Possible Solution |\n| ---- | ----------------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |\n| 400 | Invalid request | The request cannot be understood. | Ensure JSON syntax in request body is correct. |\n| 401 | Invalid access token | Requestor is unauthorized or does not have permission for this API call. | Ensure your API access token is valid and has the appropriate permissions. |\n| 403 | Forbidden | Requestor does not have access to this resource. | Ensure that the account member or access token has proper permissions set. |\n| 404 | Invalid resource identifier | The requested resource is not valid. | Ensure that the resource is correctly identified by ID or key. |\n| 405 | Method not allowed | The request method is not allowed on this resource. | Ensure that the HTTP verb is correct. |\n| 409 | Conflict | The API request can not be completed because it conflicts with a concurrent API request. | Retry your request. |\n| 422 | Unprocessable entity | The API request can not be completed because the update description can not be understood. | Ensure that the request body is correct for the type of patch you are using, either JSON patch or semantic patch.\n| 429 | Too many requests | Read [Rate limiting](/#section/Overview/Rate-limiting). | Wait and try again later. |\n\n## CORS\n\nThe LaunchDarkly API supports Cross Origin Resource Sharing (CORS) for AJAX requests from any origin. If an `Origin` header is given in a request, it will be echoed as an explicitly allowed origin. Otherwise the request returns a wildcard, `Access-Control-Allow-Origin: *`. For more information on CORS, read the [CORS W3C Recommendation](http://www.w3.org/TR/cors). Example CORS headers might look like:\n\n```http\nAccess-Control-Allow-Headers: Accept, Content-Type, Content-Length, Accept-Encoding, Authorization\nAccess-Control-Allow-Methods: OPTIONS, GET, DELETE, PATCH\nAccess-Control-Allow-Origin: *\nAccess-Control-Max-Age: 300\n```\n\nYou can make authenticated CORS calls just as you would make same-origin calls, using either [token or session-based authentication](/#section/Overview/Authentication). If you are using session authentication, you should set the `withCredentials` property for your `xhr` request to `true`. You should never expose your access tokens to untrusted entities.\n\n## Rate limiting\n\nWe use several rate limiting strategies to ensure the availability of our APIs. Rate-limited calls to our APIs return a `429` status code. Calls to our APIs include headers indicating the current rate limit status. The specific headers returned depend on the API route being called. The limits differ based on the route, authentication mechanism, and other factors. Routes that are not rate limited may not contain any of the headers described below.\n\n> ### Rate limiting and SDKs\n>\n> LaunchDarkly SDKs are never rate limited and do not use the API endpoints defined here. LaunchDarkly uses a different set of approaches, including streaming/server-sent events and a global CDN, to ensure availability to the routes used by LaunchDarkly SDKs.\n\n### Global rate limits\n\nAuthenticated requests are subject to a global limit. This is the maximum number of calls that your account can make to the API per ten seconds. All service and personal access tokens on the account share this limit, so exceeding the limit with one access token will impact other tokens. Calls that are subject to global rate limits may return the headers below:\n\n| Header name | Description |\n| ------------------------------ | -------------------------------------------------------------------------------- |\n| `X-Ratelimit-Global-Remaining` | The maximum number of requests the account is permitted to make per ten seconds. |\n| `X-Ratelimit-Reset` | The time at which the current rate limit window resets in epoch milliseconds. |\n\nWe do not publicly document the specific number of calls that can be made globally. This limit may change, and we encourage clients to program against the specification, relying on the two headers defined above, rather than hardcoding to the current limit.\n\n### Route-level rate limits\n\nSome authenticated routes have custom rate limits. These also reset every ten seconds. Any service or personal access tokens hitting the same route share this limit, so exceeding the limit with one access token may impact other tokens. Calls that are subject to route-level rate limits return the headers below:\n\n| Header name | Description |\n| ----------------------------- | ----------------------------------------------------------------------------------------------------- |\n| `X-Ratelimit-Route-Remaining` | The maximum number of requests to the current route the account is permitted to make per ten seconds. |\n| `X-Ratelimit-Reset` | The time at which the current rate limit window resets in epoch milliseconds. |\n\nA _route_ represents a specific URL pattern and verb. For example, the [Delete environment](/tag/Environments#operation/deleteEnvironment) endpoint is considered a single route, and each call to delete an environment counts against your route-level rate limit for that route.\n\nWe do not publicly document the specific number of calls that an account can make to each endpoint per ten seconds. These limits may change, and we encourage clients to program against the specification, relying on the two headers defined above, rather than hardcoding to the current limits.\n\n### IP-based rate limiting\n\nWe also employ IP-based rate limiting on some API routes. If you hit an IP-based rate limit, your API response will include a `Retry-After` header indicating how long to wait before re-trying the call. Clients must wait at least `Retry-After` seconds before making additional calls to our API, and should employ jitter and backoff strategies to avoid triggering rate limits again.\n\n## OpenAPI (Swagger) and client libraries\n\nWe have a [complete OpenAPI (Swagger) specification](https://app.launchdarkly.com/api/v2/openapi.json) for our API.\n\nWe auto-generate multiple client libraries based on our OpenAPI specification. To learn more, visit the [collection of client libraries on GitHub](https://github.com/search?q=topic%3Alaunchdarkly-api+org%3Alaunchdarkly&type=Repositories). You can also use this specification to generate client libraries to interact with our REST API in your language of choice.\n\nOur OpenAPI specification is supported by several API-based tools such as Postman and Insomnia. In many cases, you can directly import our specification to explore our APIs.\n\n## Method overriding\n\nSome firewalls and HTTP clients restrict the use of verbs other than `GET` and `POST`. In those environments, our API endpoints that use `DELETE`, `PATCH`, and `PUT` verbs are inaccessible.\n\nTo avoid this issue, our API supports the `X-HTTP-Method-Override` header, allowing clients to \"tunnel\" `DELETE`, `PATCH`, and `PUT` requests using a `POST` request.\n\nFor example, to call a `PATCH` endpoint using a `POST` request, you can include `X-HTTP-Method-Override:PATCH` as a header.\n\n## Beta resources\n\nWe sometimes release new API resources in **beta** status before we release them with general availability.\n\nResources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible.\n\nWe try to promote resources into general availability as quickly as possible. This happens after sufficient testing and when we're satisfied that we no longer need to make backwards-incompatible changes.\n\nWe mark beta resources with a \"Beta\" callout in our documentation, pictured below:\n\n> ### This feature is in beta\n>\n> To use this feature, pass in a header including the `LD-API-Version` key with value set to `beta`. Use this header with each call. To learn more, read [Beta resources](/#section/Overview/Beta-resources).\n>\n> Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible.\n\n### Using beta resources\n\nTo use a beta resource, you must include a header in the request. If you call a beta resource without this header, you receive a `403` response.\n\nUse this header:\n\n```\nLD-API-Version: beta\n```\n\n## Federal environments\n\nThe version of LaunchDarkly that is available on domains controlled by the United States government is different from the version of LaunchDarkly available to the general public. If you are an employee or contractor for a United States federal agency and use LaunchDarkly in your work, you likely use the federal instance of LaunchDarkly.\n\nIf you are working in the federal instance of LaunchDarkly, the base URI for each request is `https://app.launchdarkly.us`. In the \"Try it\" sandbox for each request, click the request path to view the complete resource path for the federal environment.\n\nTo learn more, read [LaunchDarkly in federal environments](https://docs.launchdarkly.com/home/advanced/federal).\n\n## Versioning\n\nWe try hard to keep our REST API backwards compatible, but we occasionally have to make backwards-incompatible changes in the process of shipping new features. These breaking changes can cause unexpected behavior if you don't prepare for them accordingly.\n\nUpdates to our REST API include support for the latest features in LaunchDarkly. We also release a new version of our REST API every time we make a breaking change. We provide simultaneous support for multiple API versions so you can migrate from your current API version to a new version at your own pace.\n\n### Setting the API version per request\n\nYou can set the API version on a specific request by sending an `LD-API-Version` header, as shown in the example below:\n\n```\nLD-API-Version: 20240415\n```\n\nThe header value is the version number of the API version you would like to request. The number for each version corresponds to the date the version was released in `yyyymmdd` format. In the example above the version `20240415` corresponds to April 15, 2024.\n\n### Setting the API version per access token\n\nWhen you create an access token, you must specify a specific version of the API to use. This ensures that integrations using this token cannot be broken by version changes.\n\nTokens created before versioning was released have their version set to `20160426`, which is the version of the API that existed before the current versioning scheme, so that they continue working the same way they did before versioning.\n\nIf you would like to upgrade your integration to use a new API version, you can explicitly set the header described above.\n\n> ### Best practice: Set the header for every client or integration\n>\n> We recommend that you set the API version header explicitly in any client or integration you build.\n>\n> Only rely on the access token API version during manual testing.\n\n### API version changelog\n\n|
Version
| Changes | End of life (EOL)\n|---|---|---|\n| `20240415` | | Current |\n| `20220603` | | 2025-04-15 |\n| `20210729` | | 2023-06-03 |\n| `20191212` | | 2022-07-29 |\n| `20160426` | | 2020-12-12 |\n\nTo learn more about how EOL is determined, read LaunchDarkly's [End of Life (EOL) Policy](https://launchdarkly.com/policies/end-of-life-policy/).\n", + "contact": { + "name": "LaunchDarkly Technical Support Team", + "url": "https://support.launchdarkly.com", + "email": "support@launchdarkly.com" + }, + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0" + }, + "version": "2.0" + }, + "servers": [ + { + "url": "https://app.launchdarkly.com", + "description": " Default" + }, + { + "url": "https://app.launchdarkly.us", + "description": " Federal" + } + ], + "security": [ + { + "ApiKey": [ + "read", + "write" + ] + } + ], + "tags": [ + { + "name": "Access tokens", + "description": "The access tokens API allows you to list, create, modify, and delete access tokens programmatically. \n\nWhen using access tokens to manage access tokens, the following restrictions apply:\n- Personal tokens can see all service tokens and other personal tokens created by the same team member. If the personal token has the \"Admin\" role, it may also see other member's personal tokens. To learn more, read [Personal tokens](https://docs.launchdarkly.com/home/account-security/api-access-tokens#personal-tokens).\n- Service tokens can see all service tokens. If the token has the \"Admin\" role, it may also see all personal tokens. To learn more, read [Service tokens](https://docs.launchdarkly.com/home/account-security/api-access-tokens#service-tokens).\n- Tokens can only manage other tokens, including themselves, if they have \"Admin\" role or explicit permission via a custom role. To learn more, read [Personal access token actions](https://docs.launchdarkly.com/home/team/role-actions#personal-access-token-actions).\n\nSeveral of the endpoints in the access tokens API require an access token ID. The access token ID is returned as part of the [Create access token](/tag/Access-tokens#operation/resetToken) and [List access tokens](/tag/Access-tokens#operation/getTokens) responses. It is the `_id` field, or the `_id` field of each element in the `items` array. \n\nTo learn more about access tokens, read [API access tokens](https://docs.launchdarkly.com/home/account-security/api-access-tokens).\n" + }, + { + "name": "Account members", + "description": "The account members API allows you to invite new members to an account by making a `POST` request to `/api/v2/members`. When you invite a new member to an account, an invitation is sent to the email you provided. Members with \"admin\" or \"owner\" roles may create new members, as well as anyone with a \"createMember\" permission for \"member/\\*\". To learn more, read [LaunchDarkly account members](https://docs.launchdarkly.com/home/members/managing).\n\nAny member may request the complete list of account members with a `GET` to `/api/v2/members`.\n\nValid built-in role names that you can provide for the `role` field include `reader`, `writer`, `admin`, `owner/admin`, and `no_access`. To learn more about built-in roles, read [LaunchDarkly's built-in roles](https://docs.launchdarkly.com/home/members/built-in-roles).\n\nSeveral of the endpoints in the account members API require a member ID. The member ID is returned as part of the [Invite new members](/tag/Account-members#operation/postMembers) and [List account members](/tag/Account-members#operation/getMembers) responses. It is the `_id` field of each element in the `items` array.\n" + }, + { + "name": "Account members (beta)", + "description": "> ### This feature is in beta\n>\n> To use this feature, pass in a header including the `LD-API-Version` key with value set to `beta`. Use this header with each call. To learn more, read [Beta resources](/#section/Overview/Beta-resources).\n>\n> Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible.\n" + }, + { + "name": "Account usage (beta)", + "description": "> ### This feature is in beta\n>\n> To use this feature, pass in a header including the `LD-API-Version` key with value set to `beta`. Use this header with each call. To learn more, read [Beta resources](/#section/Overview/Beta-resources).\n>\n> Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible.\n\nThe account usage API lets you query for metrics about how your account is using LaunchDarkly. To learn more, read [Account usage metrics](https://docs.launchdarkly.com/home/billing/usage-metrics).\n\nEach endpoint returns time-series data in the form of an array of data points with timestamps. Each one contains data for that time from one or more series. It also includes a metadata array describing what each of the series is.\n" + }, + { + "name": "Applications (beta)", + "description": "> ### This feature is in beta\n>\n> To use this feature, pass in a header including the `LD-API-Version` key with value set to `beta`. Use this header with each call. To learn more, read [Beta resources](/#section/Overview/Beta-resources).\n>\n> Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible.\n\nThe applications API lets you create, update, delete, and search for applications and application versions.\n\nEach application includes information about the app you're creating, and a set of versions of the app that you've released. You can use applications to target particular application versions in your feature flags more easily, and to handle unsupported application versions more gracefully.\n\nIn addition to creating applications through the applications API, you can also create applications in the LaunchDarkly user interface. To learn more, read [Applications](https://docs.launchdarkly.com/home/organize/applications). LaunchDarkly also creates applications and application versions automatically when a LaunchDarkly SDK evaluates a feature flag for a context that includes application information. To learn more, read [Automatic environment attributes](https://docs.launchdarkly.com/sdk/features/environment-attributes).\n\nYou can use an application in any project in your LaunchDarkly account.\n\n### Filtering applications and application versions\n\nThe `filter` parameter supports the following operators: `equals`, `notEquals`, `anyOf`, `startsWith`.\n\nYou can also combine filters in the following ways:\n\n- Use a comma (`,`) as an AND operator\n- Use a vertical bar (`|`) as an OR operator\n- Use parentheses (`()`) to group filters\n\n#### Supported fields and operators\n\nYou can only filter certain fields in applications when using the `filter` parameter. Additionally, you can only filter some fields with certain operators.\n\nWhen you search for applications, the `filter` parameter supports the following fields and operators:\n\n|
Field
|Description |Supported operators |\n|---|---|---|\n|`key` | The application or application version key, a unique identifier |`equals`, `notEquals`, `anyOf` |\n|`name` | The application name or application version name |`equals`, `notEquals`, `anyOf`, `startsWith` |\n|`autoAdded` | Whether the application or application version was automatically created because it was included in a context when a LaunchDarkly SDK evaluated a feature flag, or was created through the LaunchDarkly UI or REST API |`equals`, `notEquals` |\n|`kind` | The application kind, one of `mobile`, `server`, `browser`. Only available for [Get applications](/tag/Applications-(beta)#operation/getApplications). |`equals`, `notEquals`, `anyOf` |\n|`supported` | Whether a mobile application version is supported or unsupported. Only available for [Get application versions by application key](/tag/Applications-(beta)#operation/getApplicationVersions).|`equals`, `notEquals` |\n\nFor example, the filter `?filter=kind anyOf ['mobile', 'server']` matches applications whose `kind` is either `mobile` or `server`. The filter is not case-sensitive.\n\nThe documented values for `filter` query parameters are prior to URL encoding. For example, the `[` in `?filter=kind anyOf ['mobile', 'server']` must be encoded to `%5B`.\n\n### Sorting applications and application versions\n\nLaunchDarkly supports the following fields for sorting:\n- `name` sorts by application name.\n- `creationDate` sorts by the creation date of the application.\n\nBy default, the sort is in ascending order. Use `-` to sort in descending order. For example, `?sort=name` sorts the response by application name in ascending order, and `?sort=-name` sorts in descending order.\n" + }, + { + "name": "Approvals", + "description": "You can create an approval request that prevents a flag change from being applied without approval from a team member. Select up to ten members as reviewers. Reviewers receive an email notification, but anyone with sufficient permissions can review a pending approval request. A change needs at least one approval before you can apply it. To learn more, read [Approvals](https://docs.launchdarkly.com/home/feature-workflows/approvals).\n\nChanges that conflict will fail if approved and applied, and the flag will not be updated.\n\nSeveral of the endpoints in the approvals API require a flag approval request ID. The flag approval request ID is returned as part of the [Create approval request](/tag/Approvals#operation/postApprovalRequest) and [List approval requests for a flag](/tag/Approvals#operation/getApprovalsForFlag) responses. It is the `_id` field, or the `_id` field of each element in the `items` array. If you created the approval request as part of a [workflow](/tag/Workflows), you can also use a workflow ID as the approval request ID. The workflow ID is returned as part of the [Create workflow](/tag/Workflows#operation/postWorkflow) and [Get workflows](/tag/Workflows#operation/getWorkflows) responses. It is the `_id` field, or the `_id` field of each element in the `items` array.\n" + }, + { + "name": "Audit log", + "description": "The audit log contains a record of all the changes made to any resource in the system. You can filter the audit log by timestamps, or use a custom policy to select which entries to receive.\n\nSeveral of the endpoints in the audit log API require an audit log entry ID. The audit log entry ID is returned as part of the [List audit log entries](/tag/Audit-log#operation/getAuditLogEntries) response. It is the `_id` field of each element in the `items` array.\n\nTo learn more, read [The audit log and history tabs](https://docs.launchdarkly.com/home/code/audit-log-history/).\n" + }, + { + "name": "Code references", + "description": "> ### Code references is an Enterprise feature\n>\n> Code references is available to customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\n> ### Use ld-find-code-refs\n>\n> LaunchDarkly provides the [ld-find-code-refs utility](https://github.com/launchdarkly/ld-find-code-refs) that creates repository connections, generates code reference data, and creates calls to the code references API. Most customers do not need to call this API directly.\n\nThe code references API provides access to all resources related to each connected repository, and associated feature flag code reference data for all branches. To learn more, read [Code references](https://docs.launchdarkly.com/home/code/code-references).\n" + }, + { + "name": "Contexts", + "description": "\nContexts are people, services, machines, or other resources that encounter feature flags in your product. Contexts are identified by their `kind`, which describes the type of resources encountering flags, and by their `key`. Each unique combination of one or more contexts that have encountered a feature flag in your product is called a context instance.\n\nWhen you use the LaunchDarkly SDK to evaluate a flag, you provide a context to that call. LaunchDarkly records the key and attributes of each context instance. You can view these in the LaunchDarkly user interface from the **Contexts** list, or use the Context APIs. To learn more, read [Contexts](https://docs.launchdarkly.com/home/contexts).\n\nLaunchDarkly provides APIs for you to:\n\n* retrieve contexts, context instances, and context attribute names and values\n* search for contexts or context instances\n* delete context instances\n* fetch context kinds\n* create and update context kinds\n\nTo learn more about context kinds, read [Context kinds](https://docs.launchdarkly.com/home/contexts/context-kinds).\n\nContexts are always scoped within a project and an environment. Each environment has its own set of context instance records.\n\nSeveral of the endpoints in the contexts API require a context instance ID or application ID. Both of these IDs are returned as part of the [Search for context instances](/tag/Contexts#operation/searchContextInstances) response. The context instance ID is the `id` field of each element in the `items` array. The application ID is the `applicationId` field of each element in the `items` array. By default, the application ID is set to the SDK you are using. In the LaunchDarkly UI, the application ID and application version appear on the context details page in the \"From source\" field. You can change the application ID as part of your SDK configuration. To learn more, read [Application metadata configuration](https://docs.launchdarkly.com/sdk/features/app-config).\n\n### Filtering contexts and context instances\n\nWhen you [search for contexts](/tag/Contexts#operation/searchContexts) or [context instances](/tag/Contexts#operation/searchContextInstances), you can filter on certain fields using the `filter` parameter either as a query parameter or as a request body parameter.\n\nThe `filter` parameter supports the following operators: `after`, `anyOf`, `before`, `contains`, `equals`, `exists`, `notEquals`, `startsWith`.\n\n
\nExpand for details on operators and syntax\n\n#### after\n\nReturns contexts or context instances if any of the values in a field, which should be dates, are after the provided time. For example:\n\n* `myField after \"2022-09-21T19:03:15+00:00\"`\n\n#### anyOf\n\nReturns contexts or context instances if any of the values in a field match any of the values in the match value. For example:\n\n* `myField anyOf [44]`\n* `myField anyOf [\"phone\",\"tablet\"]`\n* `myField anyOf [true]\"`\n\n#### before\n\nReturns contexts or context instances if any of the values in a field, which should be dates, are before the provided time. For example:\n\n* `myField before \"2022-09-21T19:03:15+00:00\"`\n\n#### contains\n\nReturns contexts or context instances if all the match values are found in the list of values in this field. For example:\n\n* `myListField contains 44`\n* `myListField contains [\"phone\",\"tablet\"]`\n* `myListField contains true`\n\n#### equals\n\nReturns contexts or context instances if there is an exact match on the entire field. For example:\n\n* `myField equals 44`\n* `myField equals \"device\"`\n* `myField equals true`\n* `myField equals [1,2,3,4]`\n* `myField equals [\"hello\",\"goodbye\"]`\n\n#### exists\n\nReturns contexts or context instances if the field matches the specified existence. For example:\n\n* `myField exists true`\n* `myField exists false`\n* `*.name exists true`\n\n#### notEquals\n\nReturns contexts or context instances if there is not an exact match on the entire field. For example:\n\n* `myField notEquals 44`\n* `myField notEquals \"device\"`\n* `myField notEquals true`\n* `myField notEquals [1,2,3,4]`\n* `myField notEquals [\"hello\",\"goodbye\"]`\n\n#### startsWith\n\nReturns contexts or context instances if the value in a field, which should be a singular string, begins with the provided substring. For example:\n\n* `myField startsWith \"do\"`\n\n
\n\nYou can also combine filters in the following ways:\n\n* Use a comma (`,`) as an AND operator\n* Use a vertical bar (`|`) as an OR operator\n* Use parentheses `()` to group filters\n\nFor example:\n\n* `myField notEquals 0, myField notEquals 1` returns contexts or context instances where `myField` is not 0 and is not 1\n* `myFirstField equals \"device\",(mySecondField equals \"iPhone\"|mySecondField equals \"iPad\")` returns contexts or context instances where `myFirstField` is equal to \"device\" and `mySecondField` is equal to either \"iPhone\" or \"iPad\"\n\n#### Supported fields and operators\n\nYou can only filter certain fields in contexts and context instances when using the `filter` parameter. Additionally, you can only filter some fields with certain operators.\n\nWhen you search for [contexts]((/tag/Contexts#operation/searchContexts)), the `filter` parameter supports the following fields and operators:\n\n|
Field
|Description |Supported operators |\n|---|---|---|\n|`applicationId` |An identifier representing the application where the LaunchDarkly SDK is running. |`equals`, `notEquals`, `anyOf` |\n|`id` |Unique identifier for the context. |`equals`, `notEquals`, `anyOf` |\n|`key` |The context key. |`equals`, `notEquals`, `anyOf`, `startsWith` |\n|`kind` |The context kind. |`equals`, `notEquals`, `anyOf` |\n|`kinds` |A list of all kinds found in the context. Supply a list of strings to the operator. |`equals`, `anyOf`, `contains` |\n|`kindKey` |The kind and key for the context. They are joined with `:`, for example, `user:user-key-abc123`. |`equals`, `notEquals`, `anyOf` |\n|`kindKeys` |A list of all kinds and keys found in the context. The kind and key are joined with `:`, for example, `user:user-key-abc123`. Supply a list of strings to the operator. |`equals`, `anyOf`, `contains` |\n|`q` |A \"fuzzy\" search across context attribute values and the context key. Supply a string or list of strings to the operator. |`equals` |\n|`name` |The name for the context. |`equals`, `notEquals`, `exists`, `anyOf`, `startsWith` |\n|`.` |A kind and the name of any attribute that appears in a context of that kind, for example, `user.email`. To filter all kinds, use `*` in place of the kind, for example, `*.email`. You can use either a literal attribute name or a JSON path to specify the attribute. If you use a JSON path, then you must escape the `/` character, using `~1`, and the `~` character, using `~0`. For example, use `user.job/title` or `user./job~1title` to filter the `/job/title` field in a user context kind. If the field or value includes whitespace, it should be enclosed in double quotes. |`equals`, `notEquals`, `exists`, `startsWith`, `before`, `after`.|\n\nWhen searching for [context instances](/tag/Contexts#operation/searchContextInstances), the `filter` parameter supports the following fields and operators\n\n|
Field
|Description |Supported operators |\n|---|---|---|\n|`applicationId` |An identifier representing the application where the LaunchDarkly SDK is running. |`equals`, `notEquals`, `anyOf` |\n|`id` |Unique identifier for the context instance. |`equals`, `notEquals`, `anyOf` |\n|`kinds` |A list of all kinds found in the context instance. Supply a list of strings to the operator. |`equals`, `anyOf`, `contains` |\n|`kindKeys` |A list of all kinds and keys found in the context instance. The kind and key are joined with `:`, for example, `user:user-key-abc123`. Supply a list of strings to the operator. |`equals`, `anyOf`, `contains` |\n" + }, + { + "name": "Context settings", + "description": "You can use the context settings API to assign a context to a specific variation for any feature flag. To learn more, read [Viewing and managing contexts](https://docs.launchdarkly.com/home/contexts/attributes#viewing-and-managing-contexts).\n" + }, + { + "name": "Custom roles", + "description": "> ### Custom roles is an Enterprise feature\n>\n> Custom roles is available to customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\nCustom roles allow you to create flexible policies providing fine-grained access control to everything in LaunchDarkly, from feature flags to goals, environments and teams. With custom roles, it's possible to enforce access policies that meet your exact workflow needs.\n\nThe custom roles API allows you to create, update and delete custom roles. You can also use the API to list all of your custom roles or get a custom role by ID.\n\nFor more information about custom roles and the syntax for custom role policies, read the product documentation for [Custom roles](https://docs.launchdarkly.com/home/members/custom-roles).\n" + }, + { + "name": "Data Export destinations", + "description": "> ### Data Export is an add-on feature\n>\n> Data Export is available as an add-on for customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\nData Export provides a real-time export of raw analytics data, including feature flag requests, analytics events, custom events, and more.\n\nData Export destinations are locations that receive exported data. The Data Export destinations API allows you to configure destinations so that your data can be exported.\n\nSeveral of the endpoints in the Data Export destinations API require a Data Export destination ID. The Data Export destination ID is returned as part of the [Create a Data Export destination](/tag/Data-Export-destinations#operation/postDestination) and [List destinations](/tag/Data-Export-destinations#operation/getDestinations) responses. It is the `_id` field, or the `_id` field of each element in the `items` array.\n\nTo learn more, read [Data Export](https://docs.launchdarkly.com/home/data-export).\n" + }, + { + "name": "Environments", + "description": "Environments allow you to maintain separate rollout rules in different contexts, from local development to QA, staging, and production. With the LaunchDarkly Environments API, you can programmatically create, delete, and update environments. To learn more, read [Environments](https://docs.launchdarkly.com/home/organize/environments).\n" + }, + { + "name": "Experiments (beta)", + "description": "> ### Available for Pro and Enterprise plans\n>\n> Experimentation is available to customers on a Pro or Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To add Experimentation to your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\n\n> ### This feature is in beta\n>\n> To use this feature, pass in a header including the `LD-API-Version` key with value set to `beta`. Use this header with each call. To learn more, read [Beta resources](/#section/Overview/Beta-resources).\n>\n> Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible.\n\nExperimentation lets you validate the impact of features you roll out to your app or infrastructure. You can measure things like page views, clicks, load time, infrastructure costs, and more. By connecting metrics you create to flags in your LaunchDarkly environment, you can measure the changes in your customers' behavior based on what flags they evaluate. You can run experiments with any type of flag, including boolean, string, number, and JSON flags. To learn more, read [About Experimentation](https://docs.launchdarkly.com/home/about-experimentation).\n\nYou can manage experiments by using the dedicated experiment endpoints described below.\n\nSeveral of the endpoints require a treatment ID or a flag rule ID. Treatment IDs are returned as part of the [Get experiment results](/tag/Experiments-(beta)#operation/getExperimentResults) response. They are the `treatmentId` of each element in the `treatmentResults` array. Winning treatment IDs are also returned as part of the [Get experiment](/tag/Experiments-(beta)#operation/getExperiment) response. They are the `winningTreatmentId` in the `currentIteration`, the `winningTreatmentId` in the `draftIteration`, and the `winningTreatmentId` in each element of the `previousIterations` array. In the flags object, the rule ID is the ID of the variation or rollout of the flag. Each flag variation ID is returned as part of the [Get feature flag](/tag/Experiments-(beta)#operation/getFeatureFlag) response. It is the `_id` field in each element of the `variations` array.\n\nCustomers on older contracts may have experiments created under an older data model. These experiments are listed in the LaunchDarkly user interface as \"Legacy experiments.\" You can manage them by making PATCH requests to the flags API, and you can analyze them by making a GET request to the deprecated [Get legacy experiment results](/tag/Experiments-(beta)#operation/getLegacyExperimentResults) endpoint. To learn more about legacy experiments, read [Legacy experiments](https://docs.launchdarkly.com/home/managing-experiments#legacy-experiments).\n\n
\nClick to expand details on using the PATCH requests to the flags API to manage legacy experiments\n\n### Managing legacy experiments\n\nTo manage legacy experiments, make the following PATCH requests to the flags API:\n\n#### Adding an experiment\n\nTo add an experiment to a flag, add a new object to the `/experiments/items/` property.\n\nThe object must contain:\n\n1. The key of the metric you want to use for the experiment.\n2. (Optional) A list of keys for the environments where the experiment should record data.\n\n```json\nPATCH /api/v2/flags/{projKey}/{flagKey}\n[\n {\n \"op\": \"add\",\n \"path\": \"/experiments/items/0\",\n \"value\": {\n \"metricKey\": \"metric-key-123abc\",\n \"environments\": []\n }\n }\n]\n```\n\n#### Removing an experiment\n\nTo remove an experiment, remove the corresponding item from the experiments or items property.\n\n```json\nPATCH /api/v2/flags/{projKey}/{flagKey}\n[\n {\n \"op\": \"remove\",\n \"path\": \"/experiments/items/0\"\n }\n]\n```\n\n#### Starting or resuming an experiment\n\nTo start recording data for an experiment in an environment, add the environment key to the list of environments for that experiment.\n\n```json\nPATCH /api/v2/flags/{projKey}/{flagKey}\n[\n {\n \"op\": \"add\",\n \"path\": \"/experiments/items/0/environments/0\",\n \"value\": \"production\"\n }\n]\n```\n\n#### Stopping an experiment\n\nTo stop collecting data for an experiment in a specific environment, remove the environment from the list that experiment uses.\n\n```json\nPATCH /api/v2/flags/{projKey}/{flagKey}\n[\n {\n \"op\": \"remove\",\n \"path\": \"/experiments/items/0/environments/0\"\n }\n]\n```\n\n#### Updating the baseline\n\nTo update the baseline for all experiments on a flag across all environments in the project, replace the `baselineIdx` property with the index of the new baseline variation.\n\n```json\nPATCH /api/v2/flags/{projKey}/{flagKey}\n[\n {\n \"op\": \"replace\",\n \"path\": \"/experiments/baselineIdx\",\n \"value\": 1\n }\n]\n```\n

\n" + }, + { + "name": "Feature flags", + "description": "The feature flags API allows you to list, create, modify, and delete feature flags, their statuses, and their expiring targets programmatically. For example, you can control percentage rollouts, target specific contexts, or even toggle off a feature flag programmatically.\n\n## Sample feature flag representation\n\nEvery feature flag has a set of top-level attributes, as well as an `environments` map containing the flag rollout and targeting rules specific to each environment. To learn more, read [Using feature flags](https://docs.launchdarkly.com/home/creating-flags).\n\n
\nClick to expand an example of a complete feature flag representation\n\n```json\n{\n \"name\": \"Alternate product page\",\n \"kind\": \"boolean\",\n \"description\": \"This is a description\",\n \"key\": \"alternate.page\",\n \"_version\": 2,\n \"creationDate\": 1418684722483,\n \"includeInSnippet\": true,\n \"clientSideAvailability\" {\n \"usingMobileKey\": false,\n \"usingEnvironmentId\": true,\n },\n \"variations\": [\n {\n \"value\": true,\n \"name\": \"true\",\n \"_id\": \"86208e6e-468f-4425-b334-7f318397f95c\"\n },\n {\n \"value\": false,\n \"name\": \"false\",\n \"_id\": \"7b32de80-f346-4276-bb77-28dfa7ddc2d8\"\n }\n ],\n \"variationJsonSchema\": null,\n \"defaults\": {\n \"onVariation\": 0,\n \"offVariation\": 1\n },\n \"temporary\": false,\n \"tags\": [\"ops\", \"experiments\"],\n \"_links\": {\n \"parent\": {\n \"href\": \"/api/v2/flags/default\",\n \"type\": \"application/json\"\n },\n \"self\": {\n \"href\": \"/api/v2/flags/default/alternate.page\",\n \"type\": \"application/json\"\n }\n },\n \"maintainerId\": \"548f6741c1efad40031b18ae\",\n \"_maintainer\": {\n \"_links\": {\n \"self\": {\n \"href\": \"/api/v2/members/548f6741c1efad40031b18ae\",\n \"type\": \"application/json\"\n }\n },\n \"_id\": \"548f6741c1efad40031b18ae\",\n \"firstName\": \"Ariel\",\n \"lastName\": \"Flores\",\n \"role\": \"reader\",\n \"email\": \"ariel@acme.com\"\n },\n \"goalIds\": [],\n \"experiments\": {\n \"baselineIdx\": 0,\n \"items\": []\n },\n \"environments\": {\n \"production\": {\n \"on\": true,\n \"archived\": false,\n \"salt\": \"YWx0ZXJuYXRlLnBhZ2U=\",\n \"sel\": \"45501b9314dc4641841af774cb038b96\",\n \"lastModified\": 1469326565348,\n \"version\": 61,\n \"targets\": [{\n \"values\": [\"user-key-123abc\"],\n \"variation\": 0,\n \"contextKind\": \"user\"\n }],\n \"contextTargets\": [{\n \"values\": [],\n \"variation\": 0,\n \"contextKind\": \"user\"\n }, {\n \"values\": [\"org-key-123abc\"],\n \"variation\": 0,\n \"contextKind\": \"organization\"\n }],\n \"rules\": [\n {\n \"_id\": \"f3ea72d0-e473-4e8b-b942-565b790ffe18\",\n \"variation\": 0,\n \"clauses\": [\n {\n \"_id\": \"6b81968e-3744-4416-9d64-74547eb0a7d1\",\n \"attribute\": \"groups\",\n \"op\": \"in\",\n \"values\": [\"Top Customers\"],\n \"contextKind\": \"user\",\n \"negate\": false\n },\n {\n \"_id\": \"9d60165d-82b8-4b9a-9136-f23407ba1718\",\n \"attribute\": \"email\",\n \"op\": \"endsWith\",\n \"values\": [\"gmail.com\"],\n \"contextKind\": \"user\",\n \"negate\": false\n }\n ],\n \"trackEvents\": false,\n \"ref\": \"73257308-472b-4d9c-a556-10aa7adbf857\"\n }\n ],\n \"fallthrough\": {\n \"rollout\": {\n \"variations\": [\n {\n \"variation\": 0,\n \"weight\": 60000\n },\n {\n \"variation\": 1,\n \"weight\": 40000\n }\n ],\n \"contextKind\": \"user\"\n }\n },\n \"offVariation\": 1,\n \"prerequisites\": [],\n \"_site\": {\n \"href\": \"/default/production/features/alternate.page\",\n \"type\": \"text/html\"\n },\n \"_environmentName\": \"Production\",\n \"trackEvents\": false,\n \"trackEventsFallthrough\": false,\n \"_summary\": {\n \"variations\": {\n \"0\": {\n \"rules\": 1,\n \"nullRules\": 0,\n \"targets\": 2,\n \"rollout\": 60000\n },\n \"1\": {\n \"rules\": 0,\n \"nullRules\": 0,\n \"targets\": 0,\n \"isOff\": true,\n \"rollout\": 40000\n }\n },\n \"prerequisites\": 0\n }\n }\n}\n```\n\n
\n\n## Anatomy of a feature flag\n\nThis section describes the sample feature flag representation in more detail.\n\n### Top-level attributes\n\nMost of the top-level attributes have a straightforward interpretation, for example `name` and `description`.\n\nThe `variations` array represents the different variation values that a feature flag has. For a boolean flag, there are two variations: `true` and `false`. Multivariate flags have more variation values, and those values could be any JSON type: numbers, strings, objects, or arrays. In targeting rules, the variations are referred to by their index into this array.\n\nTo update these attributes, read [Update feature flag](#operation/patchFeatureFlag), especially the instructions for **updating flag settings**.\n\n### Per-environment configurations\n\nEach entry in the `environments` map contains a JSON object that represents the environment-specific flag configuration data available in the flag's Targeting tab. To learn more, read [Targeting with flags](https://docs.launchdarkly.com/home/targeting-flags).\n\nTo update per-environment information for a flag, read [Update feature flag](#operation/patchFeatureFlag), especially the instructions for **turning flags on and off** and **working with targeting and variations**.\n\n### Individual context targets\n\nThe `targets` and `contextTargets` arrays in the per-environment configuration data correspond to the individual context targeting on the Targeting tab. To learn more, read [Individual targeting](https://docs.launchdarkly.com/home/targeting-flags/individual-targeting).\n\nEach object in the `targets` and `contextTargets` arrays represents a list of context keys assigned to a particular variation. The `targets` array includes contexts with `contextKind` of \"user\" and the `contextTargets` array includes contexts with context kinds other than \"user.\"\n\nFor example:\n\n```json\n{\n ...\n \"environments\" : {\n \"production\" : {\n ...\n \"targets\": [\n {\n \"values\": [\"user-key-123abc\"],\n \"variation\": 0,\n \"contextKind\": \"user\"\n }\n ],\n \"contextTargets\": [\n {\n \"values\": [\"org-key-123abc\"],\n \"variation\": 0,\n \"contextKind\": \"organization\"\n }\n ]\n }\n }\n}\n```\n\nThe `targets` array means that any user context instance with the key `user-key-123abc` receives the first variation listed in the `variations` array. The `contextTargets` array means that any organization context with the key `org-key-123abc` receives the first variation listed in the `variations` array. Recall that the variations are stored at the top level of the flag JSON in an array, and the per-environment configuration rules point to indexes into this array. If this is a boolean flag, both contexts are receiving the `true` variation.\n\n### Targeting rules\n\nThe `rules` array corresponds to the rules section of the Targeting tab. This is where you can express complex rules on attributes with conditions and operators. For example, you might create a rule that specifies \"roll out the `true` variation to 80% of contexts whose email address ends with `gmail.com`\". To learn more, read [Creating targeting rules](https://docs.launchdarkly.com/home/targeting-flags/targeting-rules#creating-targeting-rules).\n\n### The fallthrough rule\n\nThe `fallthrough` object is a special rule that contains no conditions. It is the rollout strategy that is applied when none of the individual or custom targeting rules match. In the LaunchDarkly UI, it is called the \"Default rule.\"\n\n### The off variation\n\nThe off variation represents the variation to serve if the feature flag targeting is turned off, meaning the `on` attribute is `false`. For boolean flags, this is usually `false`. For multivariate flags, set the off variation to whatever variation represents the control or baseline behavior for your application. If you don't set the off variation, LaunchDarkly will serve the fallback value defined in your code.\n\n### Percentage rollouts\n\nWhen you work with targeting rules and with the default rule, you can specify either a single variation or a percentage rollout. The `weight` attribute defines the percentage rollout for each variation. Weights range from 0 (a 0% rollout) to 100000 (a 100% rollout). The weights are scaled by a factor of 1000 so that fractions of a percent can be represented without using floating-point. For example, a weight of `60000` means that 60% of contexts will receive that variation. The sum of weights across all variations should be 100%.\n" + }, + { + "name": "Feature flags (beta)", + "description": "> ### This feature is in beta\n>\n> To use this feature, pass in a header including the `LD-API-Version` key with value set to `beta`. Use this header with each call. To learn more, read [Beta resources](/#section/Overview/Beta-resources).\n>\n> Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible.\n" + }, + { + "name": "Flag links (beta)", + "description": "> ### This feature is in beta\n>\n> To use this feature, pass in a header including the `LD-API-Version` key with value set to `beta`. Use this header with each call. To learn more, read [Beta resources](#section/Overview/Beta-resources).\n>\n> Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible.\n\nFlag links let you view external mentions of flags from other tools and services. Links to external conversations and references to your flags allow you to collaborate more easily and quickly review relevant flag contexts. To learn more, read [Flag links](https://docs.launchdarkly.com/home/organize/links).\n\nYou can create custom flag links by associating an external URL with a feature flag. After you create a flag link, it applies across all your environments. You should use caution when you delete a flag link, because it will be deleted from all your environments.\n\nWith the flag links API, you can view, create, update, and delete links to flags.\n\nSeveral of the endpoints in the flag links API require a flag link ID. The flag link ID is returned as part of the [Create flag link](/tag/Flag-links-(beta)#operation/createFlagLink) and [List flag links](/tag/Flag-links-(beta)#operation/getFlagLinks) responses. It is the `_id` field, or the `_id` field of each element in the `items` array.\n" + }, + { + "name": "Flag triggers", + "description": "> ### Flag triggers is an Enterprise feature\n>\n> Flag triggers is available to customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\nFlag triggers let you initiate flag changes remotely using a unique webhook URL. For example, you can integrate triggers with your existing tools to enable or disable flags when you hit specific operational health thresholds or receive certain alerts. To learn more, read [Flag triggers](https://docs.launchdarkly.com/home/feature-workflows/triggers).\n\nWith the flag triggers API, you can create, delete, and manage triggers.\n\nSeveral of the endpoints in the flag triggers API require a flag trigger ID. The flag trigger ID is returned as part of the [Create flag trigger](/tag/Flag-triggers#operation/createTriggerWorkflow) and [List flag triggers](/tag/Flag-triggers#operation/getTriggerWorkflows) responses. It is the `_id` field, or the `_id` field of each element in the `items` array.\n" + }, + { + "name": "Follow flags", + "description": "Follow flags to receive email updates about targeting changes to a flag in a project and environment.\n\nSeveral of the endpoints in the follow flags API require a member ID. The member ID is returned as part of the [Invite new members](/tag/Account-members#operation/postMembers) and [List account members](/tag/Account-members#operation/getMembers) responses. It is the `_id` field of each element in the `items` array.\n" + }, + { + "name": "Integration audit log subscriptions", + "description": "Audit log integration subscriptions allow you to send audit log events hooks to one of dozens of external tools. For example, you can send flag change event webhooks to external third party software. To learn more, read [Building your own integrations](https://docs.launchdarkly.com/integrations/building-integrations#building-your-own-integrations).\n\nYou can use the integration subscriptions API to create, delete, and manage your integration audit log subscriptions.\n\nEach of these operations requires an `integrationKey` that refers to the type of integration. The required `config` fields to create a subscription vary depending on the `integrationKey`. You can find a full list of the fields for each integration below.\n\nSeveral of these operations require a subscription ID. The subscription ID is returned as part of the [Create audit log subscription](/tag/Integration-audit-log-subscriptions#operation/createSubscription) and [Get audit log subscriptions by integration](/tag/Integration-audit-log-subscriptions#operation/getSubscriptions) responses. It is the `_id` field, or the `_id` field of each element in the `items` array.\n\n### Configuration bodies by integrationKey\n\n#### datadog\n\n`apiKey` is a sensitive value.\n\n`hostURL` must evaluate to either `\"https://api.datadoghq.com\"` or `\"https://api.datadoghq.eu\"` and will default to the former if not explicitly defined.\n\n```\n\"config\": {\n \"apiKey\": , # sensitive value\n \"hostURL\": \n}\n```\n\n#### dynatrace\n\n`apiToken` is a sensitive value.\n\n`entity` must evaluate to one of the following fields and will default to `\"APPLICATION\"` if not explicitly defined:\n\n
\nClick to expand list of fields\n
\n\"APPLICATION\"
\n\"APPLICATION_METHOD\"
\n\"APPLICATION_METHOD_GROUP\"
\n\"AUTO_SCALING_GROUP\"
\n\"AUXILIARY_SYNTHETIC_TEST\"
\n\"AWS_APPLICATION_LOAD_BALANCER\"
\n\"AWS_AVAILABILITY_ZONE\"
\n\"AWS_CREDENTIALS\"
\n\"AWS_LAMBDA_FUNCTION\"
\n\"AWS_NETWORK_LOAD_BALANCER\"
\n\"AZURE_API_MANAGEMENT_SERVICE\"
\n\"AZURE_APPLICATION_GATEWAY\"
\n\"AZURE_COSMOS_DB\"
\n\"AZURE_CREDENTIALS\"
\n\"AZURE_EVENT_HUB\"
\n\"AZURE_EVENT_HUB_NAMESPACE\"
\n\"AZURE_FUNCTION_APP\"
\n\"AZURE_IOT_HUB\"
\n\"AZURE_LOAD_BALANCER\"
\n\"AZURE_MGMT_GROUP\"
\n\"AZURE_REDIS_CACHE\"
\n\"AZURE_REGION\"
\n\"AZURE_SERVICE_BUS_NAMESPACE\"
\n\"AZURE_SERVICE_BUS_QUEUE\"
\n\"AZURE_SERVICE_BUS_TOPIC\"
\n\"AZURE_SQL_DATABASE\"
\n\"AZURE_SQL_ELASTIC_POOL\"
\n\"AZURE_SQL_SERVER\"
\n\"AZURE_STORAGE_ACCOUNT\"
\n\"AZURE_SUBSCRIPTION\"
\n\"AZURE_TENANT\"
\n\"AZURE_VM\"
\n\"AZURE_VM_SCALE_SET\"
\n\"AZURE_WEB_APP\"
\n\"CF_APPLICATION\"
\n\"CF_FOUNDATION\"
\n\"CINDER_VOLUME\"
\n\"CLOUD_APPLICATION\"
\n\"CLOUD_APPLICATION_INSTANCE\"
\n\"CLOUD_APPLICATION_NAMESPACE\"
\n\"CONTAINER_GROUP\"
\n\"CONTAINER_GROUP_INSTANCE\"
\n\"CUSTOM_APPLICATION\"
\n\"CUSTOM_DEVICE\"
\n\"CUSTOM_DEVICE_GROUP\"
\n\"DCRUM_APPLICATION\"
\n\"DCRUM_SERVICE\"
\n\"DCRUM_SERVICE_INSTANCE\"
\n\"DEVICE_APPLICATION_METHOD\"
\n\"DISK\"
\n\"DOCKER_CONTAINER_GROUP_INSTANCE\"
\n\"DYNAMO_DB_TABLE\"
\n\"EBS_VOLUME\"
\n\"EC2_INSTANCE\"
\n\"ELASTIC_LOAD_BALANCER\"
\n\"ENVIRONMENT\"
\n\"EXTERNAL_SYNTHETIC_TEST_STEP\"
\n\"GCP_ZONE\"
\n\"GEOLOCATION\"
\n\"GEOLOC_SITE\"
\n\"GOOGLE_COMPUTE_ENGINE\"
\n\"HOST\"
\n\"HOST_GROUP\"
\n\"HTTP_CHECK\"
\n\"HTTP_CHECK_STEP\"
\n\"HYPERVISOR\"
\n\"KUBERNETES_CLUSTER\"
\n\"KUBERNETES_NODE\"
\n\"MOBILE_APPLICATION\"
\n\"NETWORK_INTERFACE\"
\n\"NEUTRON_SUBNET\"
\n\"OPENSTACK_PROJECT\"
\n\"OPENSTACK_REGION\"
\n\"OPENSTACK_VM\"
\n\"OS\"
\n\"PROCESS_GROUP\"
\n\"PROCESS_GROUP_INSTANCE\"
\n\"RELATIONAL_DATABASE_SERVICE\"
\n\"SERVICE\"
\n\"SERVICE_INSTANCE\"
\n\"SERVICE_METHOD\"
\n\"SERVICE_METHOD_GROUP\"
\n\"SWIFT_CONTAINER\"
\n\"SYNTHETIC_LOCATION\"
\n\"SYNTHETIC_TEST\"
\n\"SYNTHETIC_TEST_STEP\"
\n\"VIRTUALMACHINE\"
\n\"VMWARE_DATACENTER\"\n
\n\n```\n\"config\": {\n \"apiToken\": ,\n \"url\": ,\n \"entity\": \n}\n```\n\n#### elastic\n\n`token` is a sensitive field.\n\n```\n\"config\": {\n \"url\": ,\n \"token\": ,\n \"index\": \n}\n```\n\n#### honeycomb\n\n`apiKey` is a sensitive field.\n\n```\n\"config\": {\n \"datasetName\": ,\n \"apiKey\": \n}\n```\n\n#### logdna\n\n`ingestionKey` is a sensitive field.\n\n```\n\"config\": {\n \"ingestionKey\": ,\n \"level\": \n}\n```\n\n#### msteams\n\n```\n\"config\": {\n \"url\": \n}\n```\n\n#### new-relic-apm\n\n`apiKey` is a sensitive field.\n\n`domain` must evaluate to either `\"api.newrelic.com\"` or `\"api.eu.newrelic.com\"` and will default to the former if not explicitly defined.\n\n```\n\"config\": {\n \"apiKey\": ,\n \"applicationId\": ,\n \"domain\": \n}\n```\n\n#### signalfx\n\n`accessToken` is a sensitive field.\n\n```\n\"config\": {\n \"accessToken\": ,\n \"realm\": \n}\n```\n\n#### splunk\n\n`token` is a sensitive field.\n\n```\n\"config\": {\n \"base-url\": ,\n \"token\": ,\n \"skip-ca-verificiation\": \n}\n```\n" + }, + { + "name": "Integration delivery configurations (beta)", + "description": "\n> ### This feature is in beta\n>\n> To use this feature, pass in a header including the `LD-API-Version` key with value set to `beta`. Use this header with each call. To learn more, read [Beta resources](/#section/Overview/Beta-resources).\n>\n> Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible.\n\nThe integration delivery configurations API allow you to create, modify, validate, and delete delivery configurations.\n\nSeveral of the endpoints require a delivery configuration ID. The delivery configuration ID is returned as part of the [Create delivery configuration](/tag/Integration-delivery-configurations-(beta)#operation/createIntegrationDeliveryConfiguration) and [List all delivery configurations](/tag/Integration-delivery-configurations-(beta)#operation/getIntegrationDeliveryConfigurations) responses. It is the `_id` field, or the `_id` field of each element in the `items` array.\n" + }, + { + "name": "Integrations (beta)", + "description": "\n> ### This feature is in beta\n>\n> To use this feature, pass in a header including the `LD-API-Version` key with value set to `beta`. Use this header with each call. To learn more, read [Beta resources](/#section/Overview/Beta-resources).\n>\n> Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible.\n\nYou can use the integrations API to create, delete, and manage integrations between LaunchDarkly and third-party applications.\n\nSpecifically, the integrations API provides endpoints for managing the persistent store integrations, also called \"big segment\" store integrations, that are required when you use a server-side SDK and big segments.\n\n> ### Synced segments and larger list-based segments are an Enterprise feature\n>\n> Segments synced from external tools and larger list-based segments with more than 15,000 entries are the two kinds of \"big segment.\" LaunchDarkly uses different implementations for different types of segments so that all of your segments have good performance.\n>\n> These segments are available to customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\n[Segments synced from external tools](https://docs.launchdarkly.com/home/segments/synced-segments) and [larger list-based segments](https://docs.launchdarkly.com/home/segments/list-based-segments#larger-list-based-segments) are the two kinds of big segment. If you are using server-side SDKs, these segments require a persistent store within your infrastructure. LaunchDarkly keeps the persistent store up to date and consults it during flag evaluation.\n\nYou need either a persistent store integration or a [Relay Proxy](https://docs.launchdarkly.com/home/relay-proxy) to support these segments. The integrations API lets you manage the persistent store integrations.\n\nTo learn more about segments, read [Segments](https://docs.launchdarkly.com/home/segments) and [Segment configuration](https://docs.launchdarkly.com/home/segments/big-segment-configuration).\n\nSeveral of the endpoints in the integrations API require an integration ID. The integration ID is returned as part of the [Create big segment store integration](/tag/Integrations-(beta)#operation/createBigSegmentStoreIntegration) response, in the `_id` field. It is also returned as part of the [List all big segment store integrations](/tag/Integrations-(beta)#operation/getBigSegmentStoreIntegrations) response, in the `_id` field of each element in the `items` array.\n\nYou can find other APIs for working with big segments under [Segments](/tag/Segments) and [Segments (beta)](/tag/Segments-(beta)).\n" + }, + { + "name": "Metrics", + "description": "> ### Available for Pro and Enterprise plans\n>\n> Metrics is available to customers on a Pro or Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To add metrics to your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\nMetrics track flag behavior over time when an experiment is running. The data generated from experiments gives you more insight into the impact of a particular flag. To learn more, read [Metrics](https://docs.launchdarkly.com/home/metrics).\n\nUsing the metrics API, you can create, delete, and manage metrics.\n\n> ### Are you importing metric events?\n>\n> If you want to import metric events into LaunchDarkly from an existing data source, use the metric import API. To learn more, read [Importing metric events](/home/metrics/import-metric-events).\n\n> ### Metric keys and event keys are different\n>\n> LaunchDarkly automatically generates a metric key when you create a metric. You can use the metric key to identify the metric in API calls.\n>\n> Custom conversion/binary and custom numeric metrics also require an event key. You can set the event key to anything you want. Adding this event key to your codebase lets your SDK track actions customers take in your app as events. To learn more, read [Sending custom events](https://docs.launchdarkly.com/sdk/features/events).\n" + }, + { + "name": "Metrics (beta)", + "description": "> ### This feature is in beta\n>\n> To use this feature, pass in a header including the `LD-API-Version` key with value set to `beta`. Use this header with each call. To learn more, read [Beta resources](/#section/Overview/Beta-resources).\n>\n> Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible.\n\nMetrics measure audience behaviors affected by the flags in your experiments. Metric groups are reusable, ordered lists of metrics you can use to standardize metrics across multiple experiments. To learn more, read [Metrics](https://docs.launchdarkly.com/home/metrics) and [Metric groups](https://docs.launchdarkly.com/home/metrics/metric-groups).\n\nUsing the metrics API, you can create, delete, and manage metrics and metric groups.\n" + }, + { + "name": "OAuth2 Clients", + "description": "The OAuth2 client API allows you to register a LaunchDarkly OAuth client for use in your own custom integrations. Registering a LaunchDarkly OAuth client allows you to use LaunchDarkly as an identity provider so that account members can log into your application with their LaunchDarkly account.\n\nYou can create and manage LaunchDarkly OAuth clients using the LaunchDarkly OAuth client API. This API acknowledges creation of your client with a response containing a one-time, unique `_clientSecret`. If you lose your client secret, you will have to register a new client. LaunchDarkly does not store client secrets in plain text.\n\nSeveral of the endpoints in the OAuth2 client API require an OAuth client ID. The OAuth client ID is returned as part of the [Create a LaunchDarkly OAuth 2.0 client](/tag/OAuth2-Clients#operation/createOAuth2Client) and [Get clients](/tag/OAuth2-Clients#operation/getOAuthClients) responses. It is the `_clientId` field, or the `_clientId` field of each element in the `items` array.\n\nYou must have _Admin_ privileges or an access token created by a member with _Admin_ privileges in order to be able to use this feature.\n\nPlease note that `redirectUri`s must be absolute URIs that conform to the https URI scheme. If you wish to register a client with a different URI scheme, please contact LaunchDarkly Support.\n" + }, + { + "name": "Projects", + "description": "Projects allow you to manage multiple different software projects under one LaunchDarkly account. Each project has its own unique set of environments and feature flags. To learn more, read [Projects](https://docs.launchdarkly.com/home/organize/projects).\n\nUsing the projects API, you can create, destroy, and manage projects.\n" + }, + { + "name": "Relay Proxy configurations", + "description": "\n> ### Relay Proxy automatic configuration is an Enterprise feature\n>\n> Relay Proxy automatic configuration is available to customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\nThe Relay Proxy automatic configuration API provides access to all resources related to relay tokens. To learn more, read [Automatic configuration](https://docs.launchdarkly.com/home/relay-proxy/automatic-configuration).\n\nSeveral of the endpoints in the Relay Proxy automatic configuration API require a configuration ID. The Relay Proxy configuration ID is returned as part of the [Create a new Relay Proxy config](/tag/Relay-Proxy-configurations#operation/postRelayAutoConfig) and [List Relay Proxy configs](/tag/Relay-Proxy-configurations#operation/getRelayProxyConfigs) responses. It is the `_id` field, or the `_id` field of each element in the `items` array.\n" + }, + { + "name": "Release pipelines (beta)", + "description": "> ### This feature is in beta\n>\n> To use this feature, pass in a header including the `LD-API-Version` key with value set to `beta`. Use this header with each call. To learn more, read [Beta resources](#section/Overview/Beta-resources).\n>\n> Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible.\n\nRelease pipelines track the progression of a feature flag across a series of phases, where each phase consists of one or more environments. When you add a flag to a release pipeline, you create a \"release\" to track that flag's progress through the pipeline.\n\nYou can use release pipelines to ensure that you correctly roll out the flag in each environment before moving on to the next. You can also use them to view the status of ongoing releases across all flags within a project, enforcing a standardized process and ensuring they are following best practices. To learn more, read [Release pipelines](https://docs.launchdarkly.com/home/release-pipelines).\n\nWith the release pipelines API, you can view, create, and delete release pipelines.\n\nWith the related [releases API](/tag/Releases-(beta)), you can view and update the active releases for a given flag.\n\nTo add a feature flag to an existing release pipeline, use the [Update feature flag](/tag/Feature-flags#operation/patchFeatureFlag) endpoint.\n" + }, + { + "name": "Releases (beta)", + "description": "> ### This feature is in beta\n>\n> To use this feature, pass in a header including the `LD-API-Version` key with value set to `beta`. Use this header with each call. To learn more, read [Beta resources](#section/Overview/Beta-resources).\n>\n> Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible.\n\nRelease pipelines track the progression of a feature flag across a series of phases, where each phase consists of one or more environments. When you add a flag to a release pipeline, you create a \"release\" to track that flag's progress through the pipeline. To learn more, read [Release pipelines](https://docs.launchdarkly.com/home/release-pipelines).\n\nWith the releases API, you can view and update the active releases for a given flag.\n\nWith the related [release pipelines API](/tag/Release-pipelines-(beta)), you can view, create, and delete release pipelines.\n" + }, + { + "name": "Scheduled changes", + "description": "> ### Scheduled flag changes is an Enterprise feature\n>\n> Scheduled flag changes is available to customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\nSchedule the specified flag targeting changes to take effect at the selected time. You may schedule multiple changes for a flag each with a different `ExecutionDate`. To learn more, read [Scheduled flag changes](https://docs.launchdarkly.com/home/feature-workflows/scheduled-changes).\n\nSeveral of the endpoints in the scheduled changes API require a scheduled change ID. The scheduled change ID is returned as part of the [Create scheduled changes workflow](/tag/Scheduled-changes#operation/postFlagConfigScheduledChanges) and [List scheduled changes](/tag/Scheduled-changes#operation/getFlagConfigScheduledChanges) responses. It is the `_id` field, or the `_id` field of each element in the `items` array.\n" + }, + { + "name": "Segments", + "description": "\n> ### Synced segments and larger list-based segments are an Enterprise feature\n>\n> This section documents endpoints for rule-based, list-based, and synced segments.\n>\n> A \"big segment\" is a segment that is either a synced segment, or a list-based segment with more than 15,000 entries that includes only one targeted context kind. LaunchDarkly uses different implementations for different types of segments so that all of your segments have good performance.\n>\n> In the segments API, a big segment is indicated by the `unbounded` field being set to `true`.\n>\n> These segments are available to customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\nSegments are groups of contexts that you can use to manage flag targeting behavior in bulk. LaunchDarkly supports:\n\n* rule-based segments, which let you target groups of contexts individually or by attribute,\n* list-based segments, which let you target individual contexts or uploaded lists of contexts, and\n* synced segments, which let you target groups of contexts backed by an external data store.\n\nTo learn more, read [Segments](https://docs.launchdarkly.com/home/segments).\n\nThe segments API allows you to list, create, modify, and delete segments programmatically.\n\nYou can find other APIs for working with big segments under [Segments (beta)](/tag/Segments-(beta)) and [Integrations (beta)](/tag/Integrations-(beta)).\n" + }, + { + "name": "Segments (beta)", + "description": "> ### Synced segments and larger list-based segments are an Enterprise feature\n>\n> This section documents endpoints for rule-based, list-based, and synced segments.\n>\n> A \"big segment\" is a segment that is either a synced segment, or a list-based segment with more than 15,000 entries that includes only one targeted context kind. LaunchDarkly uses different implementations for different types of segments so that all of your segments have good performance.\n>\n> In the segments API, a big segment is indicated by the `unbounded` field being set to `true`.\n>\n> These segments are available to customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\n> ### This feature is in beta\n>\n> To use this feature, pass in a header including the `LD-API-Version` key with value set to `beta`. Use this header with each call. To learn more, read [Beta resources](/#section/Overview/Beta-resources).\n>\n> Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible.\n\nThe segments API allows you to create and retrieve exports and imports for big segments, which are synced segments or list-based segments with 15,000 or more entries. To learn more, read [Segments](https://docs.launchdarkly.com/home/segments).\n\nSeveral of the endpoints in the segments API require an import or export ID. The import ID is returned in the `Location` header as part of the [Create big segment import](/tag/Segments-(beta)#operation/createBigSegmentImport) request. The export ID is returned in the `Location` header as part of the [Create big segment export](/tag/Segments-(beta)#operation/createBigSegmentExport) request. In each case, the ID is the final element of the path returned in the `Location` header.\n\nYou can find other APIs for working with big segments under [Segments](/tag/Segments) and [Integrations (beta)](/tag/Integrations-(beta)).\n" + }, + { + "name": "Tags", + "description": "Tags are simple strings that you can attach to most resources in LaunchDarkly. Tags are useful for grouping resources into a set that you can name in a resource specifier. To learn more, read [Custom role concepts](https://docs.launchdarkly.com/home/members/role-concepts#tags).\n\nUsing the tags API, you can list existing tags for resources.\n" + }, + { + "name": "Teams", + "description": "> ### Teams is an Enterprise feature\n>\n> Teams is available to customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\nA team is a group of members in your LaunchDarkly account. A team can have maintainers who are able to add and remove team members. It also can have custom roles assigned to it that allows shared access to those roles for all team members. To learn more, read [Teams](https://docs.launchdarkly.com/home/teams).\n\nThe Teams API allows you to create, read, update, and delete a team.\n\nSeveral of the endpoints in the Teams API require one or more member IDs. The member ID is returned as part of the [List account members](/tag/Account-members#operation/getMembers) response. It is the `_id` field of each element in the `items` array.\n" + }, + { + "name": "Teams (beta)", + "description": "> ### This feature is in beta\n>\n> To use this feature, pass in a header including the `LD-API-Version` key with value set to `beta`. Use this header with each call. To learn more, read [Beta resources](/#section/Overview/Beta-resources).\n>\n> Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible.\n\n> ### Teams is an Enterprise feature\n>\n> Teams is available to customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\nA team is a group of members in your LaunchDarkly account. A team can have maintainers who are able to add and remove team members. It also can have custom roles assigned to it that allows shared access to those roles for all team members. To learn more, read [Teams](https://docs.launchdarkly.com/home/teams).\n" + }, + { + "name": "Users", + "description": "> ### Contexts are now available\n>\n> After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use [Contexts](/tag/Contexts) instead of these endpoints. To learn more, read [Contexts](https://docs.launchdarkly.com/home/contexts).\n\n\nLaunchDarkly creates a record for each user passed in to `variation` calls. This record powers the autocomplete functionality on the feature flag dashboard, as well as the Users page. To learn more, read [Users and user segments](https://docs.launchdarkly.com/home/users).\n\nLaunchDarkly also offers an API that lets you tap into this data. You can use the users API to see what user data is available to LaunchDarkly, as well as determine which flag values a user will receive. You can also explicitly set which flag value a user will receive via this API.\n\nUsers are always scoped within a project and environment. In other words, each environment has its own set of user records.\n" + }, + { + "name": "Users (beta)", + "description": "> ### Contexts are now available\n>\n> After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use [Contexts](/tag/Contexts) instead of these endpoints. To learn more, read [Contexts](https://docs.launchdarkly.com/home/contexts).\n\n> ### This feature is in beta\n>\n> To use this feature, pass in a header including the `LD-API-Version` key with value set to `beta`. Use this header with each call. To learn more, read [Beta resources](/#section/Overview/Beta-resources).\n>\n> Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible.\n\nLaunchDarkly creates a record for each user passed in to `variation` calls. This record powers the autocomplete functionality on the feature flag dashboard, as well as the Users page. To learn more, read [Users and user segments](https://docs.launchdarkly.com/home/users)\n\nLaunchDarkly also offers an API that lets you access this data. You can use the users API to see what user data is available to LaunchDarkly, as well as determine which flag values a user will receive. You can also explicitly set which flag value a user will receive with this API.\n\nUsers are always scoped within both a project and an environment. Each environment has its own set of user records.\n" + }, + { + "name": "User settings", + "description": "> ### Contexts are now available\n>\n> After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use [Contexts](/tag/Contexts) instead of the user settings API. To learn more, read [Contexts](https://docs.launchdarkly.com/home/contexts).\n\nLaunchDarkly's user settings API provides a picture of all feature flags and their current values for a specific user. This gives you instant visibility into how a particular user experiences your site or application. To learn more, read [Viewing and managing users](https://docs.launchdarkly.com/home/users/attributes#viewing-and-managing-users).\n\nYou can also use the user settings API to assign a user to a specific variation for any feature flag.\n" + }, + { + "name": "Webhooks", + "description": "The webhooks API lets you build your own integrations that subscribe to activities in LaunchDarkly. When you generate an activity in LaunchDarkly, such as when you change a flag or you create a project, LaunchDarkly sends an HTTP POST payload to the webhook's URL. Use webhooks to update external issue trackers, update support tickets, notify customers of new feature rollouts, and more.\n\nSeveral of the endpoints in the webhooks API require a webhook ID. The webhook ID is returned as part of the [Creates a webhook](/tag/Webhooks#operation/postWebhook) and [List webhooks](/tag/Webhooks#operation/getAllWebhooks) responses. It is the `_id` field, or the `_id` field of each element in the `items` array.\n\n## Designating the payload\n\nThe webhook payload is identical to an audit log entry. To learn more, read [Get audit log entry](/tag/Audit-log#operation/getAuditLogEntry).\n\nHere's a sample payload:\n\n> ### Webhook delivery order\n>\n> Webhooks may not be delivered in chronological order. We recommend using the payload's \"date\" field as a timestamp to reorder webhooks as they are received.\n\n```json\n{\n \"_links\": {\n \"canonical\": {\n \"href\": \"/api/v2/projects/alexis/environments/test\",\n \"type\": \"application/json\"\n },\n \"parent\": {\n \"href\": \"/api/v2/auditlog\",\n \"type\": \"application/json\"\n },\n \"self\": {\n \"href\": \"/api/v2/auditlog/57c0a8e29969090743529965\",\n \"type\": \"application/json\"\n },\n \"site\": {\n \"href\": \"/settings#/projects\",\n \"type\": \"text/html\"\n }\n },\n \"_id\": \"57c0a8e29969090743529965\",\n \"date\": 1472243938774,\n \"accesses\": [\n {\n \"action\": \"updateName\",\n \"resource\": \"proj/alexis:env/test\"\n }\n ],\n \"kind\": \"environment\",\n \"name\": \"Testing\",\n \"description\": \"- Changed the name from ~~Test~~ to *Testing*\",\n \"member\": {\n \"_links\": {\n \"parent\": {\n \"href\": \"/internal/account/members\",\n \"type\": \"application/json\"\n },\n \"self\": {\n \"href\": \"/internal/account/members/548f6741c1efad40031b18ae\",\n \"type\": \"application/json\"\n }\n },\n \"_id\": \"548f6741c1efad40031b18ae\",\n \"email\": \"ariel@acme.com\",\n \"firstName\": \"Ariel\",\n \"lastName\": \"Flores\"\n },\n \"titleVerb\": \"changed the name of\",\n \"title\": \"[Ariel Flores](mailto:ariel@acme.com) changed the name of [Testing](https://app.launchdarkly.com/settings#/projects)\",\n \"target\": {\n \"_links\": {\n \"canonical\": {\n \"href\": \"/api/v2/projects/alexis/environments/test\",\n \"type\": \"application/json\"\n },\n \"site\": {\n \"href\": \"/settings#/projects\",\n \"type\": \"text/html\"\n }\n },\n \"name\": \"Testing\",\n \"resources\": [\"proj/alexis:env/test\"]\n }\n}\n```\n\n## Signing the webhook\n\nOptionally, you can define a `secret` when you create a webhook. If you define the secret, the webhook `POST` request will include an `X-LD-Signature header`, whose value will contain an HMAC SHA256 hex digest of the webhook payload, using the `secret` as the key.\n\nCompute the signature of the payload using the same shared secret in your code to verify that the webhook was triggered by LaunchDarkly.\n\n## Understanding connection retries\n\nIf LaunchDarkly receives a non-`2xx` response to a webhook `POST`, it will retry the delivery one time. Webhook delivery is not guaranteed. If you build an integration on webhooks, make sure it is tolerant of delivery failures.\n" + }, + { + "name": "Workflows", + "description": "> ### Workflows is an Enterprise feature\n>\n> Workflows is available to customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\nA workflow is a set of actions that you can schedule in advance to make changes to a feature flag at a future date and time. You can also include approval requests at different stages of a workflow. To learn more, read [Workflows](https://docs.launchdarkly.com/home/feature-workflows/workflows).\n\nThe actions supported are as follows:\n\n- Turning targeting `ON` or `OFF`\n- Setting the default variation\n- Adding targets to a given variation\n- Creating a rule to target by segment\n- Modifying the rollout percentage for rules\n\nYou can create multiple stages of a flag release workflow. Unique stages are defined by their conditions: either approvals and/or scheduled changes.\n\nSeveral of the endpoints in the workflows API require a workflow ID or one or more member IDs. The workflow ID is returned as part of the [Create workflow](/tag/Workflows#operation/postWorkflow) and [Get workflows](/tag/Workflows#operation/getWorkflows) responses. It is the `_id` field, or the `_id` field of each element in the `items` array. The member ID is returned as part of the [List account members](/tag/Account-members#operation/getMembers) response. It is the `_id` field of each element in the `items` array.\n" + }, + { + "name": "Workflow templates", + "description": "> ### Workflow templates is an Enterprise feature\n>\n> Workflow templates are available to customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\nWorkflow templates allow you to define a set of workflow stages that you can use as a starting point for new workflows. You can create these workflows for any flag in any environment and any project, and you can create as many workflows as you like from a given template.\n\nYou can create workflow templates in two ways:\n* by specifying the desired stages, using the `stages` property of the request body\n* by specifying an existing workflow to save as a template, using the `workflowId` property of the request body\n\nYou can use templates to create a workflow in any project, environment, or flag. However, when you create a template, you must specify a particular project, environment, and flag. This means that when you create a template using the `stages` property, you must also include `projectKey`, `environmentKey`, and `flagKey` properties in the request body. When you create a template from an existing workflow, it will use the project, environment, and flag of the existing workflow, so those properties can be omitted from the request body.\n\nTo learn more, read [Workflows documentation](https://docs.launchdarkly.com/home/feature-workflows/workflows) and [Workflows API documentation](https://apidocs.launchdarkly.com/tag/Workflows).\n" + }, + { + "name": "Other", + "description": "Other requests available in the LaunchDarkly API. \n" + } + ], + "paths": { + "/api/v2": { + "get": { + "responses": { + "200": { + "description": "Root response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RootResponse" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Other" + ], + "summary": "Root resource", + "description": "Get all of the resource categories the API supports. In the sandbox, click 'Try it' and enter any string in the 'Authorization' field to test this endpoint.", + "operationId": "getRoot" + } + }, + "/api/v2/account/relay-auto-configs": { + "get": { + "responses": { + "200": { + "description": "Relay auto configs collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RelayAutoConfigCollectionRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Relay Proxy configurations" + ], + "summary": "List Relay Proxy configs", + "description": "Get a list of Relay Proxy configurations in the account.", + "operationId": "getRelayProxyConfigs" + }, + "post": { + "responses": { + "201": { + "description": "Relay auto config response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RelayAutoConfigRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Relay Proxy configurations" + ], + "summary": "Create a new Relay Proxy config", + "description": "Create a Relay Proxy config.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RelayAutoConfigPost" + }, + "example": { + "name": "Sample Relay Proxy config for all proj and env", + "policy": [ + { + "actions": [ + "*" + ], + "effect": "allow", + "resources": [ + "proj/*:env/*" + ] + } + ] + } + } + }, + "required": true + }, + "operationId": "postRelayAutoConfig" + } + }, + "/api/v2/account/relay-auto-configs/{id}": { + "get": { + "responses": { + "200": { + "description": "Relay auto config response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RelayAutoConfigRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Relay Proxy configurations" + ], + "summary": "Get Relay Proxy config", + "description": "Get a single Relay Proxy auto config by ID.", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The relay auto config id", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The relay auto config id" + } + } + ], + "operationId": "getRelayProxyConfig" + }, + "patch": { + "responses": { + "200": { + "description": "Relay auto config response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RelayAutoConfigRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "422": { + "description": "Invalid patch content", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchFailedErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Relay Proxy configurations" + ], + "summary": "Update a Relay Proxy config", + "description": "Update a Relay Proxy configuration. Updating a configuration 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](/#section/Overview/Updates).", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The relay auto config id", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The relay auto config id" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchWithComment" + }, + "example": { + "patch": [ + { + "op": "replace", + "path": "/policy/0", + "value": { + "actions": [ + "*" + ], + "effect": "allow", + "resources": [ + "proj/*:env/qa" + ] + } + } + ] + } + } + }, + "required": true + }, + "operationId": "patchRelayAutoConfig" + }, + "delete": { + "responses": { + "204": { + "description": "Action succeeded" + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Relay Proxy configurations" + ], + "summary": "Delete Relay Proxy config by ID", + "description": "Delete a Relay Proxy config.", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The relay auto config id", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The relay auto config id" + } + } + ], + "operationId": "deleteRelayAutoConfig" + } + }, + "/api/v2/account/relay-auto-configs/{id}/reset": { + "post": { + "responses": { + "200": { + "description": "Relay auto config response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RelayAutoConfigRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Relay Proxy configurations" + ], + "summary": "Reset Relay Proxy configuration key", + "description": "Reset a Relay Proxy configuration's secret key with an optional expiry time for the old key.", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The Relay Proxy configuration ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The Relay Proxy configuration ID" + } + }, + { + "name": "expiry", + "in": "query", + "description": "An expiration time for the old Relay Proxy configuration key, expressed as a Unix epoch time in milliseconds. By default, the Relay Proxy configuration will expire immediately.", + "schema": { + "type": "integer", + "format": "int64", + "description": "An expiration time for the old Relay Proxy configuration key, expressed as a Unix epoch time in milliseconds. By default, the Relay Proxy configuration will expire immediately." + } + } + ], + "operationId": "resetRelayAutoConfig" + } + }, + "/api/v2/applications": { + "get": { + "responses": { + "200": { + "description": "Applications response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationCollectionRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Applications (beta)" + ], + "summary": "Get applications", + "description": "\nGet a list of applications.\n\n### Expanding the applications response\n\nLaunchDarkly supports expanding the \"Get applications\" response to include additional fields.\n\nTo expand the response, append the `expand` query parameter and include the following:\n\n* `flags` includes details on the flags that have been evaluated by the application\n\nFor example, use `?expand=flags` to include the `flags` field in the response. By default, this field is **not** included in the response.\n", + "parameters": [ + { + "name": "filter", + "in": "query", + "description": "Accepts filter by `key`, `name`, `kind`, and `autoAdded`. Example: `filter=kind anyOf ['mobile', 'server'],key equals 'test-key'`. To learn more about the filter syntax, read [Filtering applications and application versions](/tag/Applications-(beta)#filtering-contexts-and-context-instances).", + "schema": { + "type": "string", + "format": "string", + "description": "Accepts filter by `key`, `name`, `kind`, and `autoAdded`. Example: `filter=kind anyOf ['mobile', 'server'],key equals 'test-key'`. To learn more about the filter syntax, read [Filtering applications and application versions](/tag/Applications-(beta)#filtering-contexts-and-context-instances)." + } + }, + { + "name": "limit", + "in": "query", + "description": "The number of applications to return. Defaults to 10.", + "schema": { + "type": "integer", + "format": "int64", + "description": "The number of applications to return. Defaults to 10." + } + }, + { + "name": "offset", + "in": "query", + "description": "Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.", + "schema": { + "type": "integer", + "format": "int64", + "description": "Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`." + } + }, + { + "name": "sort", + "in": "query", + "description": "Accepts sorting order and fields. Fields can be comma separated. Possible fields are `creationDate`, `name`. Examples: `sort=name` sort by names ascending, `sort=-name,creationDate` sort by names descending and creationDate ascending.", + "schema": { + "type": "string", + "format": "string", + "description": "Accepts sorting order and fields. Fields can be comma separated. Possible fields are `creationDate`, `name`. Examples: `sort=name` sort by names ascending, `sort=-name,creationDate` sort by names descending and creationDate ascending." + } + }, + { + "name": "expand", + "in": "query", + "description": "A comma-separated list of properties that can reveal additional information in the response. Options: `flags`.", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of properties that can reveal additional information in the response. Options: `flags`." + } + } + ], + "operationId": "getApplications" + } + }, + "/api/v2/applications/{applicationKey}": { + "get": { + "responses": { + "200": { + "description": "Application response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Applications (beta)" + ], + "summary": "Get application by key", + "description": "\nRetrieve an application by the application key.\n\n### Expanding the application response\n\nLaunchDarkly supports expanding the \"Get application\" response to include additional fields.\n\nTo expand the response, append the `expand` query parameter and include the following:\n\n* `flags` includes details on the flags that have been evaluated by the application\n\nFor example, use `?expand=flags` to include the `flags` field in the response. By default, this field is **not** included in the response.\n", + "parameters": [ + { + "name": "applicationKey", + "in": "path", + "description": "The application key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The application key" + } + }, + { + "name": "expand", + "in": "query", + "description": "A comma-separated list of properties that can reveal additional information in the response. Options: `flags`.", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of properties that can reveal additional information in the response. Options: `flags`." + } + } + ], + "operationId": "getApplication" + }, + "patch": { + "responses": { + "200": { + "description": "Application response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Applications (beta)" + ], + "summary": "Update application", + "description": "Update an application. You can update the `description` and `kind` fields. Requires a [JSON patch](https://datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes to the application. To learn more, read [Updates](/#section/Overview/Updates).", + "parameters": [ + { + "name": "applicationKey", + "in": "path", + "description": "The application key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The application key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JSONPatch" + }, + "example": [ + { + "op": "replace", + "path": "/description", + "value": "Updated description" + } + ] + } + }, + "required": true + }, + "operationId": "patchApplication" + }, + "delete": { + "responses": { + "204": { + "description": "Action succeeded" + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Applications (beta)" + ], + "summary": "Delete application", + "description": "Delete an application.", + "parameters": [ + { + "name": "applicationKey", + "in": "path", + "description": "The application key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The application key" + } + } + ], + "operationId": "deleteApplication" + } + }, + "/api/v2/applications/{applicationKey}/versions": { + "get": { + "responses": { + "200": { + "description": "Application versions response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationVersionsCollectionRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Applications (beta)" + ], + "summary": "Get application versions by application key", + "description": "Get a list of versions for a specific application in an account.", + "parameters": [ + { + "name": "filter", + "in": "query", + "description": "Accepts filter by `key`, `name`, `supported`, and `autoAdded`. Example: `filter=key equals 'test-key'`. To learn more about the filter syntax, read [Filtering applications and application versions](/tag/Applications-(beta)#filtering-contexts-and-context-instances).", + "schema": { + "type": "string", + "format": "string", + "description": "Accepts filter by `key`, `name`, `supported`, and `autoAdded`. Example: `filter=key equals 'test-key'`. To learn more about the filter syntax, read [Filtering applications and application versions](/tag/Applications-(beta)#filtering-contexts-and-context-instances)." + } + }, + { + "name": "applicationKey", + "in": "path", + "description": "The application key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The application key" + } + }, + { + "name": "limit", + "in": "query", + "description": "The number of versions to return. Defaults to 50.", + "schema": { + "type": "integer", + "format": "int64", + "description": "The number of versions to return. Defaults to 50." + } + }, + { + "name": "offset", + "in": "query", + "description": "Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.", + "schema": { + "type": "integer", + "format": "int64", + "description": "Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`." + } + }, + { + "name": "sort", + "in": "query", + "description": "Accepts sorting order and fields. Fields can be comma separated. Possible fields are `creationDate`, `name`. Examples: `sort=name` sort by names ascending, `sort=-name,creationDate` sort by names descending and creationDate ascending.", + "schema": { + "type": "string", + "format": "string", + "description": "Accepts sorting order and fields. Fields can be comma separated. Possible fields are `creationDate`, `name`. Examples: `sort=name` sort by names ascending, `sort=-name,creationDate` sort by names descending and creationDate ascending." + } + } + ], + "operationId": "getApplicationVersions" + } + }, + "/api/v2/applications/{applicationKey}/versions/{versionKey}": { + "patch": { + "responses": { + "200": { + "description": "Application version response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationVersionRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Applications (beta)" + ], + "summary": "Update application version", + "description": "Update an application version. You can update the `supported` field. Requires a [JSON patch](https://datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes to the application version. To learn more, read [Updates](/#section/Overview/Updates).", + "parameters": [ + { + "name": "applicationKey", + "in": "path", + "description": "The application key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The application key" + } + }, + { + "name": "versionKey", + "in": "path", + "description": "The application version key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The application version key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JSONPatch" + }, + "example": [ + { + "op": "replace", + "path": "/supported", + "value": "false" + } + ] + } + }, + "required": true + }, + "operationId": "patchApplicationVersion" + }, + "delete": { + "responses": { + "204": { + "description": "Action succeeded" + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Applications (beta)" + ], + "summary": "Delete application version", + "description": "Delete an application version.", + "parameters": [ + { + "name": "applicationKey", + "in": "path", + "description": "The application key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The application key" + } + }, + { + "name": "versionKey", + "in": "path", + "description": "The application version key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The application version key" + } + } + ], + "operationId": "deleteApplicationVersion" + } + }, + "/api/v2/approval-requests": { + "get": { + "responses": { + "200": { + "description": "Approval request collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExpandableApprovalRequestsResponse" + } + } + } + }, + "400": { + "description": "Unsupported filter field. Filter field must be one of: requestorId, projectKey, notifyMemberIds, reviewStatus, or status", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Approvals" + ], + "summary": "List approval requests", + "description": "Get all approval requests.\n\n### Filtering approvals\n\nLaunchDarkly supports the `filter` query param for filtering, with the following fields:\n\n- `notifyMemberIds` filters for only approvals that are assigned to a member in the specified list. For example: `filter=notifyMemberIds anyOf [\"memberId1\", \"memberId2\"]`.\n- `requestorId` filters for only approvals that correspond to the ID of the member who requested the approval. For example: `filter=requestorId equals 457034721476302714390214`.\n- `resourceId` filters for only approvals that correspond to the the specified resource identifier. For example: `filter=resourceId equals proj/my-project:env/my-environment:flag/my-flag`.\n- `reviewStatus` filters for only approvals which correspond to the review status in the specified list. The possible values are `approved`, `declined`, and `pending`. For example: `filter=reviewStatus anyOf [\"pending\", \"approved\"]`.\n- `status` filters for only approvals which correspond to the status in the specified list. The possible values are `pending`, `scheduled`, `failed`, and `completed`. For example: `filter=status anyOf [\"pending\", \"scheduled\"]`.\n\nYou can also apply multiple filters at once. For example, setting `filter=projectKey equals my-project, reviewStatus anyOf [\"pending\",\"approved\"]` matches approval requests which correspond to the `my-project` project key, and a review status of either `pending` or `approved`.\n\n### Expanding approval response\n\nLaunchDarkly supports the `expand` query param to include additional fields in the response, with the following fields:\n\n- `flag` includes the flag the approval request belongs to\n- `project` includes the project the approval request belongs to\n- `environments` includes the environments the approval request relates to\n\nFor example, `expand=project,flag` includes the `project` and `flag` fields in the response.\n", + "parameters": [ + { + "name": "filter", + "in": "query", + "description": "A comma-separated list of filters. Each filter is of the form `field operator value`. Supported fields are explained above.", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of filters. Each filter is of the form `field operator value`. Supported fields are explained above." + } + }, + { + "name": "expand", + "in": "query", + "description": "A comma-separated list of fields to expand in the response. Supported fields are explained above.", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of fields to expand in the response. Supported fields are explained above." + } + }, + { + "name": "limit", + "in": "query", + "description": "The number of approvals to return. Defaults to 20. Maximum limit is 200.", + "schema": { + "type": "integer", + "format": "int64", + "description": "The number of approvals to return. Defaults to 20. Maximum limit is 200." + } + }, + { + "name": "offset", + "in": "query", + "description": "Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.", + "schema": { + "type": "integer", + "format": "int64", + "description": "Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`." + } + } + ], + "operationId": "getApprovalRequests" + }, + "post": { + "responses": { + "201": { + "description": "Approval request response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApprovalRequestResponse" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Approvals" + ], + "summary": "Create approval request", + "description": "Create an approval request.\n\nThis endpoint currently supports creating an approval request for a flag across all environments with the following instructions:\n\n- `addVariation`\n- `removeVariation`\n- `updateVariation`\n- `updateDefaultVariation`\n\nFor details on using these instructions, read [Update feature flag](/tag/Feature-flags#operation/patchFeatureFlag).\n\nTo create an approval for a flag specific to an environment, use [Create approval request for a flag](/tag/Approvals#operation/postApprovalRequestForFlag).\n", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/createApprovalRequestRequest" + } + } + }, + "required": true + }, + "operationId": "postApprovalRequest" + } + }, + "/api/v2/approval-requests/{id}": { + "get": { + "responses": { + "200": { + "description": "Approval request response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExpandableApprovalRequestResponse" + } + } + } + }, + "400": { + "description": "Invalid Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Unable to find approval request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Approvals" + ], + "summary": "Get approval request", + "description": "Get an approval request by approval request ID.\n\n### Expanding approval response\n\nLaunchDarkly supports the `expand` query param to include additional fields in the response, with the following fields:\n\n- `flag` includes the flag the approval request belongs to\n- `project` includes the project the approval request belongs to\n- `environments` includes the environments the approval request relates to\n\nFor example, `expand=project,flag` includes the `project` and `flag` fields in the response.\n", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The approval request ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The approval request ID" + } + }, + { + "name": "expand", + "in": "query", + "description": "A comma-separated list of fields to expand in the response. Supported fields are explained above.", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of fields to expand in the response. Supported fields are explained above." + } + } + ], + "operationId": "getApprovalRequest" + }, + "delete": { + "responses": { + "204": { + "description": "Action succeeded" + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Approvals" + ], + "summary": "Delete approval request", + "description": "Delete an approval request.", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The approval request ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The approval request ID" + } + } + ], + "operationId": "deleteApprovalRequest" + } + }, + "/api/v2/approval-requests/{id}/apply": { + "post": { + "responses": { + "200": { + "description": "Approval request apply response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApprovalRequestResponse" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Approvals" + ], + "summary": "Apply approval request", + "description": "Apply an approval request that has been approved.", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The feature flag approval request ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag approval request ID" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/postApprovalRequestApplyRequest" + } + } + }, + "required": true + }, + "operationId": "postApprovalRequestApply" + } + }, + "/api/v2/approval-requests/{id}/reviews": { + "post": { + "responses": { + "200": { + "description": "Approval request review response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApprovalRequestResponse" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "405": { + "description": "Method not allowed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MethodNotAllowedErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Approvals" + ], + "summary": "Review approval request", + "description": "Review an approval request by approving or denying changes.", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The approval request ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The approval request ID" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/postApprovalRequestReviewRequest" + } + } + }, + "required": true + }, + "operationId": "postApprovalRequestReview" + } + }, + "/api/v2/auditlog": { + "get": { + "responses": { + "200": { + "description": "Audit log entries response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuditLogEntryListingRepCollection" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Audit log" + ], + "summary": "List audit log entries", + "description": "Get a list of all audit log entries. The query parameters let you restrict the results that return by date ranges, resource specifiers, or a full-text search query.\n\nLaunchDarkly uses a resource specifier syntax to name resources or collections of resources. To learn more, read [Understanding the resource specifier syntax](https://docs.launchdarkly.com/home/members/role-resources#understanding-the-resource-specifier-syntax).\n", + "parameters": [ + { + "name": "before", + "in": "query", + "description": "A timestamp filter, expressed as a Unix epoch time in milliseconds. All entries this returns occurred before the timestamp.", + "schema": { + "type": "integer", + "format": "int64", + "description": "A timestamp filter, expressed as a Unix epoch time in milliseconds. All entries this returns occurred before the timestamp." + } + }, + { + "name": "after", + "in": "query", + "description": "A timestamp filter, expressed as a Unix epoch time in milliseconds. All entries this returns occurred after the timestamp.", + "schema": { + "type": "integer", + "format": "int64", + "description": "A timestamp filter, expressed as a Unix epoch time in milliseconds. All entries this returns occurred after the timestamp." + } + }, + { + "name": "q", + "in": "query", + "description": "Text to search for. You can search for the full or partial name of the resource.", + "schema": { + "type": "string", + "format": "string", + "description": "Text to search for. You can search for the full or partial name of the resource." + } + }, + { + "name": "limit", + "in": "query", + "description": "A limit on the number of audit log entries that return. Set between 1 and 20. The default is 10.", + "schema": { + "type": "integer", + "format": "int64", + "description": "A limit on the number of audit log entries that return. Set between 1 and 20. The default is 10." + } + }, + { + "name": "spec", + "in": "query", + "description": "A resource specifier that lets you filter audit log listings by resource", + "schema": { + "type": "string", + "format": "string", + "description": "A resource specifier that lets you filter audit log listings by resource" + } + } + ], + "operationId": "getAuditLogEntries" + } + }, + "/api/v2/auditlog/{id}": { + "get": { + "responses": { + "200": { + "description": "Audit log entry response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuditLogEntryRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Audit log" + ], + "summary": "Get audit log entry", + "description": "Fetch a detailed audit log entry representation. The detailed representation includes several fields that are not present in the summary representation, including:\n\n- `delta`: the JSON patch body that was used in the request to update the entity\n- `previousVersion`: a JSON representation of the previous version of the entity\n- `currentVersion`: a JSON representation of the current version of the entity\n", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID of the audit log entry", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The ID of the audit log entry" + } + } + ], + "operationId": "getAuditLogEntry" + } + }, + "/api/v2/code-refs/extinctions": { + "get": { + "responses": { + "200": { + "description": "Extinction collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExtinctionCollectionRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Code references" + ], + "summary": "List extinctions", + "description": "Get a list of all extinctions. LaunchDarkly creates an extinction event after you remove all code references to a flag. To learn more, read [Understanding extinction events](https://docs.launchdarkly.com/home/code/code-references#understanding-extinction-events).", + "parameters": [ + { + "name": "repoName", + "in": "query", + "description": "Filter results to a specific repository", + "schema": { + "type": "string", + "format": "string", + "description": "Filter results to a specific repository" + } + }, + { + "name": "branchName", + "in": "query", + "description": "Filter results to a specific branch. By default, only the default branch will be queried for extinctions.", + "schema": { + "type": "string", + "format": "string", + "description": "Filter results to a specific branch. By default, only the default branch will be queried for extinctions." + } + }, + { + "name": "projKey", + "in": "query", + "description": "Filter results to a specific project", + "schema": { + "type": "string", + "format": "string", + "description": "Filter results to a specific project" + } + }, + { + "name": "flagKey", + "in": "query", + "description": "Filter results to a specific flag key", + "schema": { + "type": "string", + "format": "string", + "description": "Filter results to a specific flag key" + } + }, + { + "name": "from", + "in": "query", + "description": "Filter results to a specific timeframe based on commit time, expressed as a Unix epoch time in milliseconds. Must be used with `to`.", + "schema": { + "type": "integer", + "format": "int64", + "description": "Filter results to a specific timeframe based on commit time, expressed as a Unix epoch time in milliseconds. Must be used with `to`." + } + }, + { + "name": "to", + "in": "query", + "description": "Filter results to a specific timeframe based on commit time, expressed as a Unix epoch time in milliseconds. Must be used with `from`.", + "schema": { + "type": "integer", + "format": "int64", + "description": "Filter results to a specific timeframe based on commit time, expressed as a Unix epoch time in milliseconds. Must be used with `from`." + } + } + ], + "operationId": "getExtinctions" + } + }, + "/api/v2/code-refs/repositories": { + "get": { + "responses": { + "200": { + "description": "Repository collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RepositoryCollectionRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Code references" + ], + "summary": "List repositories", + "description": "Get a list of connected repositories. Optionally, you can include branch metadata with the `withBranches` query parameter. Embed references for the default branch with `ReferencesForDefaultBranch`. You can also filter the list of code references by project key and flag key.", + "parameters": [ + { + "name": "withBranches", + "in": "query", + "description": "If set to any value, the endpoint returns repositories with associated branch data", + "schema": { + "type": "string", + "format": "string", + "description": "If set to any value, the endpoint returns repositories with associated branch data" + } + }, + { + "name": "withReferencesForDefaultBranch", + "in": "query", + "description": "If set to any value, the endpoint returns repositories with associated branch data, as well as code references for the default git branch", + "schema": { + "type": "string", + "format": "string", + "description": "If set to any value, the endpoint returns repositories with associated branch data, as well as code references for the default git branch" + } + }, + { + "name": "projKey", + "in": "query", + "description": "A LaunchDarkly project key. If provided, this filters code reference results to the specified project.", + "schema": { + "type": "string", + "format": "string", + "description": "A LaunchDarkly project key. If provided, this filters code reference results to the specified project." + } + }, + { + "name": "flagKey", + "in": "query", + "description": "If set to any value, the endpoint returns repositories with associated branch data, as well as code references for the default git branch", + "schema": { + "type": "string", + "format": "string", + "description": "If set to any value, the endpoint returns repositories with associated branch data, as well as code references for the default git branch" + } + } + ], + "operationId": "getRepositories" + }, + "post": { + "responses": { + "200": { + "description": "Repository response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RepositoryRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Code references" + ], + "summary": "Create repository", + "description": "Create a repository with the specified name.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/repositoryPost" + } + } + }, + "required": true + }, + "operationId": "postRepository" + } + }, + "/api/v2/code-refs/repositories/{repo}": { + "get": { + "responses": { + "200": { + "description": "Repository response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RepositoryRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Code references" + ], + "summary": "Get repository", + "description": "Get a single repository by name.", + "parameters": [ + { + "name": "repo", + "in": "path", + "description": "The repository name", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The repository name" + } + } + ], + "operationId": "getRepository" + }, + "patch": { + "responses": { + "200": { + "description": "Repository response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RepositoryRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Code references" + ], + "summary": "Update repository", + "description": "Update a repository's settings. Updating repository settings 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](/#section/Overview/Updates).", + "parameters": [ + { + "name": "repo", + "in": "path", + "description": "The repository name", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The repository name" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JSONPatch" + }, + "example": [ + { + "op": "replace", + "path": "/defaultBranch", + "value": "main" + } + ] + } + }, + "required": true + }, + "operationId": "patchRepository" + }, + "delete": { + "responses": { + "204": { + "description": "Action succeeded" + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Code references" + ], + "summary": "Delete repository", + "description": "Delete a repository with the specified name.", + "parameters": [ + { + "name": "repo", + "in": "path", + "description": "The repository name", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The repository name" + } + } + ], + "operationId": "deleteRepository" + } + }, + "/api/v2/code-refs/repositories/{repo}/branch-delete-tasks": { + "post": { + "responses": { + "200": { + "description": "Action succeeded" + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Code references" + ], + "summary": "Delete branches", + "description": "Asynchronously delete a number of branches.", + "parameters": [ + { + "name": "repo", + "in": "path", + "description": "The repository name to delete branches for.", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The repository name to delete branches for." + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + }, + "example": [ + "branch-to-be-deleted", + "another-branch-to-be-deleted" + ] + } + }, + "required": true + }, + "operationId": "deleteBranches" + } + }, + "/api/v2/code-refs/repositories/{repo}/branches": { + "get": { + "responses": { + "200": { + "description": "Branch collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BranchCollectionRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Code references" + ], + "summary": "List branches", + "description": "Get a list of branches.", + "parameters": [ + { + "name": "repo", + "in": "path", + "description": "The repository name", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The repository name" + } + } + ], + "operationId": "getBranches" + } + }, + "/api/v2/code-refs/repositories/{repo}/branches/{branch}": { + "get": { + "responses": { + "200": { + "description": "Branch response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BranchRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Code references" + ], + "summary": "Get branch", + "description": "Get a specific branch in a repository.", + "parameters": [ + { + "name": "repo", + "in": "path", + "description": "The repository name", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The repository name" + } + }, + { + "name": "branch", + "in": "path", + "description": "The url-encoded branch name", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The url-encoded branch name" + } + }, + { + "name": "projKey", + "in": "query", + "description": "Filter results to a specific project", + "schema": { + "type": "string", + "format": "string", + "description": "Filter results to a specific project" + } + }, + { + "name": "flagKey", + "in": "query", + "description": "Filter results to a specific flag key", + "schema": { + "type": "string", + "format": "string", + "description": "Filter results to a specific flag key" + } + } + ], + "operationId": "getBranch" + }, + "put": { + "responses": { + "200": { + "description": "Action succeeded" + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Code references" + ], + "summary": "Upsert branch", + "description": "Create a new branch if it doesn't exist, or update the branch if it already exists.", + "parameters": [ + { + "name": "repo", + "in": "path", + "description": "The repository name", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The repository name" + } + }, + { + "name": "branch", + "in": "path", + "description": "The URL-encoded branch name", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The URL-encoded branch name" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/putBranch" + } + } + }, + "required": true + }, + "operationId": "putBranch" + } + }, + "/api/v2/code-refs/repositories/{repo}/branches/{branch}/extinction-events": { + "post": { + "responses": { + "200": { + "description": "Action succeeded" + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Code references" + ], + "summary": "Create extinction", + "description": "Create a new extinction.", + "parameters": [ + { + "name": "repo", + "in": "path", + "description": "The repository name", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The repository name" + } + }, + { + "name": "branch", + "in": "path", + "description": "The URL-encoded branch name", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The URL-encoded branch name" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExtinctionListPost" + } + } + }, + "required": true + }, + "operationId": "postExtinction" + } + }, + "/api/v2/code-refs/statistics": { + "get": { + "responses": { + "200": { + "description": "Statistic root response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatisticsRoot" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Code references" + ], + "summary": "Get links to code reference repositories for each project", + "description": "Get links for all projects that have code references.", + "operationId": "getRootStatistic" + } + }, + "/api/v2/code-refs/statistics/{projectKey}": { + "get": { + "responses": { + "200": { + "description": "Statistic collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatisticCollectionRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Code references" + ], + "summary": "Get code references statistics for flags", + "description": "Get statistics about all the code references across repositories for all flags in your project that have code references in the default branch, for example, `main`. Optionally, you can include the `flagKey` query parameter to limit your request to statistics about code references for a single flag. This endpoint returns the number of references to your flag keys in your repositories, as well as a link to each repository.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "flagKey", + "in": "query", + "description": "Filter results to a specific flag key", + "schema": { + "type": "string", + "format": "string", + "description": "Filter results to a specific flag key" + } + } + ], + "operationId": "getStatistics" + } + }, + "/api/v2/destinations": { + "get": { + "responses": { + "200": { + "description": "Destination collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Destinations" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Data Export destinations" + ], + "summary": "List destinations", + "description": "Get a list of Data Export destinations configured across all projects and environments.", + "operationId": "getDestinations" + } + }, + "/api/v2/destinations/{projectKey}/{environmentKey}": { + "post": { + "responses": { + "201": { + "description": "Destination response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Destination" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Data Export destinations" + ], + "summary": "Create Data Export destination", + "description": "\nCreate a new Data Export destination.\n\nIn the `config` request body parameter, the fields required depend on the type of Data Export destination.\n\n
\nClick to expand config parameter details\n\n#### Azure Event Hubs\n\nTo create a Data Export destination with a `kind` of `azure-event-hubs`, the `config` object requires the following fields:\n\n* `namespace`: The Event Hub Namespace name\n* `name`: The Event Hub name\n* `policyName`: The shared access signature policy name. You can find your policy name in the settings of your Azure Event Hubs Namespace.\n* `policyKey`: The shared access signature key. You can find your policy key in the settings of your Azure Event Hubs Namespace.\n\n#### Google Cloud Pub/Sub\n\nTo create a Data Export destination with a `kind` of `google-pubsub`, the `config` object requires the following fields:\n\n* `project`: The Google PubSub project ID for the project to publish to\n* `topic`: The Google PubSub topic ID for the topic to publish to\n\n#### Amazon Kinesis\n\nTo create a Data Export destination with a `kind` of `kinesis`, the `config` object requires the following fields:\n\n* `region`: The Kinesis stream's AWS region key\n* `roleArn`: The Amazon Resource Name (ARN) of the AWS role that will be writing to Kinesis\n* `streamName`: The name of the Kinesis stream that LaunchDarkly is sending events to. This is not the ARN of the stream.\n\n#### mParticle\n\nTo create a Data Export destination with a `kind` of `mparticle`, the `config` object requires the following fields:\n\n* `apiKey`: The mParticle API key\n* `secret`: The mParticle API secret\n* `userIdentity`: The type of identifier you use to identify your end users in mParticle\n* `anonymousUserIdentity`: The type of identifier you use to identify your anonymous end users in mParticle\n\n#### Segment\n\nTo create a Data Export destination with a `kind` of `segment`, the `config` object requires the following fields:\n\n* `writeKey`: The Segment write key. This is used to authenticate LaunchDarkly's calls to Segment.\n\n
\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DestinationPost" + }, + "example": { + "config": { + "project": "test-prod", + "topic": "ld-pubsub-test-192301" + }, + "kind": "google-pubsub" + } + } + }, + "required": true + }, + "operationId": "postDestination" + } + }, + "/api/v2/destinations/{projectKey}/{environmentKey}/{id}": { + "get": { + "responses": { + "200": { + "description": "Destination response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Destination" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Data Export destinations" + ], + "summary": "Get destination", + "description": "Get a single Data Export destination by ID.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "id", + "in": "path", + "description": "The Data Export destination ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The Data Export destination ID" + } + } + ], + "operationId": "getDestination" + }, + "patch": { + "responses": { + "200": { + "description": "Destination response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Destination" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Data Export destinations" + ], + "summary": "Update Data Export destination", + "description": "Update a Data Export destination. Updating a destination 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](/#section/Overview/Updates).", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "id", + "in": "path", + "description": "The Data Export destination ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The Data Export destination ID" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JSONPatch" + }, + "example": [ + { + "op": "replace", + "path": "/config/topic", + "value": "ld-pubsub-test-192302" + } + ] + } + }, + "required": true + }, + "operationId": "patchDestination" + }, + "delete": { + "responses": { + "204": { + "description": "Destination response" + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Data Export destinations" + ], + "summary": "Delete Data Export destination", + "description": "Delete a Data Export destination by ID.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "id", + "in": "path", + "description": "The Data Export destination ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The Data Export destination ID" + } + } + ], + "operationId": "deleteDestination" + } + }, + "/api/v2/flag-links/projects/{projectKey}/flags/{featureFlagKey}": { + "get": { + "responses": { + "200": { + "description": "Flag link collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FlagLinkCollectionRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Flag links (beta)" + ], + "summary": "List flag links", + "description": "Get a list of all flag links.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + } + ], + "operationId": "getFlagLinks" + }, + "post": { + "responses": { + "201": { + "description": "Flag link response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FlagLinkRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Flag links (beta)" + ], + "summary": "Create flag link", + "description": "Create a new flag link. Flag links let you reference external resources and associate them with your flags.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/flagLinkPost" + }, + "example": { + "deepLink": "https://example.com/archives/123123123", + "description": "Example link description", + "key": "flag-link-key-123abc", + "title": "Example link title" + } + } + }, + "required": true + }, + "operationId": "createFlagLink" + } + }, + "/api/v2/flag-links/projects/{projectKey}/flags/{featureFlagKey}/{id}": { + "patch": { + "responses": { + "200": { + "description": "Flag link response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FlagLinkRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Flag links (beta)" + ], + "summary": "Update flag link", + "description": "Update a flag link. Updating a flag link uses a [JSON patch](https://datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes. To learn more, read [Updates](/#section/Overview/Updates).", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + }, + { + "name": "id", + "in": "path", + "description": "The flag link ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The flag link ID" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JSONPatch" + }, + "example": [ + { + "op": "replace", + "path": "/title", + "value": "Updated flag link title" + } + ] + } + }, + "required": true + }, + "operationId": "updateFlagLink" + }, + "delete": { + "responses": { + "204": { + "description": "Action succeeded" + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Flag links (beta)" + ], + "summary": "Delete flag link", + "description": "Delete a flag link by ID or key.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + }, + { + "name": "id", + "in": "path", + "description": "The flag link ID or Key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The flag link ID or Key" + } + } + ], + "operationId": "deleteFlagLink" + } + }, + "/api/v2/flag-status/{projectKey}/{featureFlagKey}": { + "get": { + "responses": { + "200": { + "description": "Flag status across environments response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeatureFlagStatusAcrossEnvironments" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Feature flags" + ], + "summary": "Get flag status across environments", + "description": "Get the status for a particular feature flag across environments.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + }, + { + "name": "env", + "in": "query", + "description": "Optional environment filter", + "schema": { + "type": "string", + "format": "string", + "description": "Optional environment filter" + } + } + ], + "operationId": "getFeatureFlagStatusAcrossEnvironments" + } + }, + "/api/v2/flag-statuses/{projectKey}/{environmentKey}": { + "get": { + "responses": { + "200": { + "description": "Flag Statuses collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeatureFlagStatuses" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Feature flags" + ], + "summary": "List feature flag statuses", + "description": "Get a list of statuses for all feature flags. The status includes the last time the feature flag was requested, as well as a state, which is one of the following:\n\n- `new`: You created the flag fewer than seven days ago and it has never been requested.\n- `active`: LaunchDarkly is receiving requests for this flag, but there are either multiple variations configured, or it is toggled off, or there have been changes to configuration in the past seven days.\n- `inactive`: You created the feature flag more than seven days ago, and hasn't been requested within the past seven days.\n- `launched`: LaunchDarkly is receiving requests for this flag, it is toggled on, there is only one variation configured, and there have been no changes to configuration in the past seven days.\n\nTo learn more, read [Flag statuses](https://docs.launchdarkly.com/home/code/flag-status).\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + } + ], + "operationId": "getFeatureFlagStatuses" + } + }, + "/api/v2/flag-statuses/{projectKey}/{environmentKey}/{featureFlagKey}": { + "get": { + "responses": { + "200": { + "description": "Flag status response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FlagStatusRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Feature flags" + ], + "summary": "Get feature flag status", + "description": "Get the status for a particular feature flag.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + } + ], + "operationId": "getFeatureFlagStatus" + } + }, + "/api/v2/flags/{projectKey}": { + "get": { + "responses": { + "200": { + "description": "Global flags collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeatureFlags" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Feature flags" + ], + "summary": "List feature flags", + "description": "Get a list of all feature flags in the given project. By default, each flag includes configurations for each environment. You can filter environments with the `env` query parameter. For example, setting `env=production` restricts the returned configurations to just your production environment. You can also filter feature flags by tag with the `tag` query parameter.\n\n> #### Recommended use\n>\n> This endpoint can return a large amount of information. We recommend using some or all of these query parameters to decrease response time and overall payload size: `limit`, `env`, `query`, and `filter=creationDate`.\n\n### Filtering flags\n\nYou can filter on certain fields using the `filter` query parameter. For example, setting `filter=query:dark-mode,tags:beta+test` matches flags with the string `dark-mode` in their key or name, ignoring case, which also have the tags `beta` and `test`.\n\nThe `filter` query parameter supports the following arguments:\n\n| Filter argument | Description | Example |\n|-----------------------|-------------|----------------------|\n| `applicationEvaluated` | A string. It filters the list to flags that are evaluated in the application with the given key. | `filter=applicationEvaluated:com.launchdarkly.cafe` |\n| `archived` | (deprecated) A boolean value. It filters the list to archived flags. | Use `filter=state:archived` instead |\n| `contextKindsEvaluated` | A `+`-separated list of context kind keys. It filters the list to flags which have been evaluated in the past 30 days for all of the context kinds in the list. | `filter=contextKindsEvaluated:user+application` |\n| `codeReferences.max` | An integer value. Use `0` to return flags that do not have code references. | `filter=codeReferences.max:0` |\n| `codeReferences.min` | An integer value. Use `1` to return flags that do have code references. | `filter=codeReferences.min:1` |\n| `creationDate` | An object with an optional `before` field whose value is Unix time in milliseconds. It filters the list to flags created before the date. | `filter=creationDate:{\"before\":1690527600000}` |\n| `evaluated` | An object that contains a key of `after` and a value in Unix time in milliseconds. It filters the list to all flags that have been evaluated since the time you specify, in the environment provided. This filter requires the `filterEnv` filter. | `filter=evaluated:{\"after\":1690527600000},filterEnv:production` |\n| `filterEnv` | A string with a list of comma-separated keys of valid environments. You must use this field for filters that are environment-specific. If there are multiple environment-specific filters, you only need to include this field once. You can filter for a maximum of three environments. | `filter=evaluated:{\"after\": 1590768455282},filterEnv:production,status:active` |\n| `hasExperiment` | A boolean value. It filters the list to flags that are used in an experiment. | `filter=hasExperiment:true` |\n| `maintainerId` | A valid member ID. It filters the list to flags that are maintained by this member. | `filter=maintainerId:12ab3c45de678910abc12345` |\n| `maintainerTeamKey` | A string. It filters the list to flags that are maintained by the team with this key. | `filter=maintainerTeamKey:example-team-key` |\n| `query` | A string. It filters the list to flags that include the specified string in their key or name. It is not case sensitive. | `filter=query:example` |\n| `state` | A string, either `live`, `deprecated`, or `archived`. It filters the list to flags in this state. | `filter=state:archived` |\n| `sdkAvailability` | A string, one of `client`, `mobile`, `anyClient`, `server`. Using `client` filters the list to flags whose client-side SDK availability is set to use the client-side ID. Using `mobile` filters to flags set to use the mobile key. Using `anyClient` filters to flags set to use either the client-side ID or the mobile key. Using `server` filters to flags set to use neither, that is, to flags only available in server-side SDKs. | `filter=sdkAvailability:client` |\n| `tags` | A `+`-separated list of tags. It filters the list to flags that have all of the tags in the list. | `filter=tags:beta+test` |\n| `type` | A string, either `temporary` or `permanent`. It filters the list to flags with the specified type. | `filter=type:permanent` |\n\nThe documented values for the `filter` query are prior to URL encoding. For example, the `+` in `filter=tags:beta+test` must be encoded to `%2B`.\n\nBy default, this endpoint returns all flags. You can page through the list with the `limit` parameter and by following the `first`, `prev`, `next`, and `last` links in the returned `_links` field. These links will not be present if the pages they refer to don't exist. For example, the `first` and `prev` links will be missing from the response on the first page.\n\n### Sorting flags\n\nYou can sort flags based on the following fields:\n\n- `creationDate` sorts by the creation date of the flag.\n- `key` sorts by the key of the flag.\n- `maintainerId` sorts by the flag maintainer.\n- `name` sorts by flag name.\n- `tags` sorts by tags.\n- `targetingModifiedDate` sorts by the date that the flag's targeting rules were last modified in a given environment. It must be used with `env` parameter and it can not be combined with any other sort. If multiple `env` values are provided, it will perform sort using the first one. For example, `sort=-targetingModifiedDate&env=production&env=staging` returns results sorted by `targetingModifiedDate` for the `production` environment.\n- `type` sorts by flag type\n\nAll fields are sorted in ascending order by default. To sort in descending order, prefix the field with a dash ( - ). For example, `sort=-name` sorts the response by flag name in descending order.\n\n### Expanding response\n\nLaunchDarkly supports the `expand` query param to include additional fields in the response, with the following fields:\n\n- `codeReferences` includes code references for the feature flag\n- `evaluation` includes evaluation information within returned environments, including which context kinds the flag has been evaluated for in the past 30 days\n- `migrationSettings` includes migration settings information within the flag and within returned environments. These settings are only included for migration flags, that is, where `purpose` is `migration`.\n\nFor example, `expand=evaluation` includes the `evaluation` field in the response.\n\n### Migration flags\nFor migration flags, the cohort information is included in the `rules` property of a flag's response, and default cohort information is included in the `fallthrough` property of a flag's response.\nTo learn more, read [Migration Flags](https://docs.launchdarkly.com/home/flag-types/migration-flags).\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "env", + "in": "query", + "description": "Filter configurations by environment", + "schema": { + "type": "string", + "format": "string", + "description": "Filter configurations by environment" + } + }, + { + "name": "tag", + "in": "query", + "description": "Filter feature flags by tag", + "schema": { + "type": "string", + "format": "string", + "description": "Filter feature flags by tag" + } + }, + { + "name": "limit", + "in": "query", + "description": "The number of feature flags to return. Defaults to 20.", + "schema": { + "type": "integer", + "format": "int64", + "description": "The number of feature flags to return. Defaults to 20." + } + }, + { + "name": "offset", + "in": "query", + "description": "Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.", + "schema": { + "type": "integer", + "format": "int64", + "description": "Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`." + } + }, + { + "name": "archived", + "in": "query", + "description": "Deprecated, use `filter=archived:true` instead. A boolean to filter the list to archived flags. When this is absent, only unarchived flags will be returned", + "deprecated": true, + "schema": { + "type": "boolean", + "description": "Deprecated, use `filter=archived:true` instead. A boolean to filter the list to archived flags. When this is absent, only unarchived flags will be returned" + } + }, + { + "name": "summary", + "in": "query", + "description": "By default, flags do _not_ include their lists of prerequisites, targets, or rules for each environment. Set `summary=0` to include these fields for each flag returned.", + "schema": { + "type": "boolean", + "description": "By default, flags do _not_ include their lists of prerequisites, targets, or rules for each environment. Set `summary=0` to include these fields for each flag returned." + } + }, + { + "name": "filter", + "in": "query", + "description": "A comma-separated list of filters. Each filter is of the form field:value. Read the endpoint description for a full list of available filter fields.", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of filters. Each filter is of the form field:value. Read the endpoint description for a full list of available filter fields." + } + }, + { + "name": "sort", + "in": "query", + "description": "A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order. Read the endpoint description for a full list of available sort fields.", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order. Read the endpoint description for a full list of available sort fields." + } + }, + { + "name": "compare", + "in": "query", + "description": "A boolean to filter results by only flags that have differences between environments", + "schema": { + "type": "boolean", + "description": "A boolean to filter results by only flags that have differences between environments" + } + }, + { + "name": "expand", + "in": "query", + "description": "A comma-separated list of fields to expand in the response. Supported fields are explained above.", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of fields to expand in the response. Supported fields are explained above." + } + } + ], + "operationId": "getFeatureFlags" + }, + "post": { + "responses": { + "201": { + "description": "Global flag response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeatureFlag" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Feature flags" + ], + "summary": "Create a feature flag", + "description": "Create a feature flag with the given name, key, and variations.\n\n
\nClick to expand instructions for creating a migration flag\n\n### Creating a migration flag\n\nWhen you create a migration flag, the variations are pre-determined based on the number of stages in the migration.\n\nTo create a migration flag, omit the `variations` and `defaults` information. Instead, provide a `purpose` of `migration`, and `migrationSettings`. If you create a migration flag with six stages, `contextKind` is required. Otherwise, it should be omitted.\n\nHere's an example:\n\n```json\n{\n \"key\": \"flag-key-123\",\n \"purpose\": \"migration\",\n \"migrationSettings\": {\n \"stageCount\": 6,\n \"contextKind\": \"account\"\n }\n}\n```\n\nTo learn more, read [Migration Flags](https://docs.launchdarkly.com/home/flag-types/migration-flags).\n\n
\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "clone", + "in": "query", + "description": "The key of the feature flag to be cloned. The key identifies the flag in your code. For example, setting `clone=flagKey` copies the full targeting configuration for all environments, including `on/off` state, from the original flag to the new flag.", + "schema": { + "type": "string", + "format": "string", + "description": "The key of the feature flag to be cloned. The key identifies the flag in your code. For example, setting `clone=flagKey` copies the full targeting configuration for all environments, including `on/off` state, from the original flag to the new flag." + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeatureFlagBody" + }, + "example": { + "clientSideAvailability": { + "usingEnvironmentId": true, + "usingMobileKey": true + }, + "key": "flag-key-123abc", + "name": "My Flag" + } + } + }, + "required": true + }, + "operationId": "postFeatureFlag" + } + }, + "/api/v2/flags/{projectKey}/{environmentKey}/{featureFlagKey}/dependent-flags": { + "get": { + "responses": { + "200": { + "description": "Dependent flags collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DependentFlagsByEnvironment" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Feature flags (beta)" + ], + "summary": "List dependent feature flags by environment", + "description": "> ### Flag prerequisites is an Enterprise feature\n>\n> Flag prerequisites is available to customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\nList dependent flags across all environments for the flag specified in the path parameters. A dependent flag is a flag that uses another flag as a prerequisite. To learn more, read [Flag prerequisites](https://docs.launchdarkly.com/home/targeting-flags/prerequisites).\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + } + ], + "operationId": "getDependentFlagsByEnv" + } + }, + "/api/v2/flags/{projectKey}/{featureFlagKey}": { + "get": { + "responses": { + "200": { + "description": "Global flag response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeatureFlag" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Feature flags" + ], + "summary": "Get feature flag", + "description": "Get a single feature flag by key. By default, this returns the configurations for all environments. You can filter environments with the `env` query parameter. For example, setting `env=production` restricts the returned configurations to just the `production` environment.\n\n> #### Recommended use\n>\n> This endpoint can return a large amount of information. Specifying one or multiple environments with the `env` parameter can decrease response time and overall payload size. We recommend using this parameter to return only the environments relevant to your query.\n\n### Expanding response\n\nLaunchDarkly supports the `expand` query param to include additional fields in the response, with the following fields:\n\n- `evaluation` includes evaluation information within returned environments, including which context kinds the flag has been evaluated for in the past 30 days \n- `migrationSettings` includes migration settings information within the flag and within returned environments. These settings are only included for migration flags, that is, where `purpose` is `migration`.\n\nFor example, `expand=evaluation` includes the `evaluation` field in the response.\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + }, + { + "name": "env", + "in": "query", + "description": "Filter configurations by environment", + "schema": { + "type": "string", + "format": "string", + "description": "Filter configurations by environment" + } + }, + { + "name": "expand", + "in": "query", + "description": "A comma-separated list of fields to expand in the response. Supported fields are explained above.", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of fields to expand in the response. Supported fields are explained above." + } + } + ], + "operationId": "getFeatureFlag" + }, + "patch": { + "responses": { + "200": { + "description": "Global flag response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeatureFlag" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "405": { + "description": "Approval is required to make this request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MethodNotAllowedErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Feature flags" + ], + "summary": "Update feature flag", + "description": "Perform a partial update to a feature flag. The request body must be a valid semantic patch, JSON patch, or JSON merge patch. To learn more the different formats, read [Updates](/#section/Overview/Updates).\n\n### Using semantic patches on a feature flag\n\nTo make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch).\n\nThe body of a semantic patch request for updating feature flags takes the following properties:\n\n* `comment` (string): (Optional) A description of the update.\n* `environmentKey` (string): (Required for some instructions only) The key of the LaunchDarkly environment.\n* `instructions` (array): (Required) A list of actions the update should perform. Each action in the list must be an object with a `kind` property that indicates the instruction. If the action requires parameters, you must include those parameters as additional fields in the object. The body of a single semantic patch can contain many different instructions.\n\n### Instructions\n\nSemantic patch requests support the following `kind` instructions for updating feature flags.\n\n
\nClick to expand instructions for turning flags on and off\n\nThese instructions require the `environmentKey` parameter.\n\n#### turnFlagOff\n\nSets the flag's targeting state to **Off**.\n\nHere's an example:\n\n```json\n{\n \"environmentKey\": \"environment-key-123abc\",\n \"instructions\": [ { \"kind\": \"turnFlagOff\" } ]\n}\n```\n\n#### turnFlagOn\n\nSets the flag's targeting state to **On**.\n\nHere's an example:\n\n```json\n{\n \"environmentKey\": \"environment-key-123abc\",\n \"instructions\": [ { \"kind\": \"turnFlagOn\" } ]\n}\n```\n\n

\n\n
\nClick to expand instructions for working with targeting and variations\n\nThese instructions require the `environmentKey` parameter.\n\nSeveral of the instructions for working with targeting and variations require flag rule IDs, variation IDs, or clause IDs as parameters. Each of these are returned as part of the [Get feature flag](/tag/Feature-flags#operation/getFeatureFlag) response. The flag rule ID is the `_id` field of each element in the `rules` array within each environment listed in the `environments` object. The variation ID is the `_id` field in each element of the `variations` array. The clause ID is the `_id` field of each element of the `clauses` array within the `rules` array within each environment listed in the `environments` object.\n\n#### addClauses\n\nAdds the given clauses to the rule indicated by `ruleId`.\n\n##### Parameters\n\n- `ruleId`: ID of a rule in the flag.\n- `clauses`: Array of clause objects, with `contextKind` (string), `attribute` (string), `op` (string), `negate` (boolean), and `values` (array of strings, numbers, or dates) properties. The `contextKind`, `attribute`, and `values` are case sensitive. The `op` must be lower-case.\n\nHere's an example:\n\n```json\n{\n\t\"environmentKey\": \"environment-key-123abc\",\n\t\"instructions\": [{\n\t\t\"kind\": \"addClauses\",\n\t\t\"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\",\n\t\t\"clauses\": [{\n\t\t\t\"contextKind\": \"user\",\n\t\t\t\"attribute\": \"country\",\n\t\t\t\"op\": \"in\",\n\t\t\t\"negate\": false,\n\t\t\t\"values\": [\"USA\", \"Canada\"]\n\t\t}]\n\t}]\n}\n```\n\n#### addPrerequisite\n\nAdds the flag indicated by `key` with variation `variationId` as a prerequisite to the flag in the path parameter.\n\n##### Parameters\n\n- `key`: Flag key of the prerequisite flag.\n- `variationId`: ID of a variation of the prerequisite flag.\n\nHere's an example:\n\n```json\n{\n\t\"environmentKey\": \"environment-key-123abc\",\n\t\"instructions\": [{\n\t\t\"kind\": \"addPrerequisite\",\n\t\t\"key\": \"example-prereq-flag-key\",\n\t\t\"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\"\n\t}]\n}\n```\n\n#### addRule\n\nAdds a new targeting rule to the flag. The rule may contain `clauses` and serve the variation that `variationId` indicates, or serve a percentage rollout that `rolloutWeights`, `rolloutBucketBy`, and `rolloutContextKind` indicate.\n\nIf you set `beforeRuleId`, this adds the new rule before the indicated rule. Otherwise, adds the new rule to the end of the list.\n\n##### Parameters\n\n- `clauses`: Array of clause objects, with `contextKind` (string), `attribute` (string), `op` (string), `negate` (boolean), and `values` (array of strings, numbers, or dates) properties. The `contextKind`, `attribute`, and `values` are case sensitive. The `op` must be lower-case.\n- `beforeRuleId`: (Optional) ID of a flag rule.\n- Either\n - `variationId`: ID of a variation of the flag.\n\n or\n\n - `rolloutWeights`: (Optional) Map of `variationId` to weight, in thousandths of a percent (0-100000).\n - `rolloutBucketBy`: (Optional) Context attribute available in the specified `rolloutContextKind`.\n - `rolloutContextKind`: (Optional) Context kind, defaults to `user`\n\nHere's an example that uses a `variationId`:\n\n```json\n{\n \"environmentKey\": \"environment-key-123abc\",\n \"instructions\": [{\n \"kind\": \"addRule\",\n \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\",\n \"clauses\": [{\n \"contextKind\": \"organization\",\n \"attribute\": \"located_in\",\n \"op\": \"in\",\n \"negate\": false,\n \"values\": [\"Sweden\", \"Norway\"]\n }]\n }]\n}\n```\n\nHere's an example that uses a percentage rollout:\n\n```json\n{\n \"environmentKey\": \"environment-key-123abc\",\n \"instructions\": [{\n \"kind\": \"addRule\",\n \"clauses\": [{\n \"contextKind\": \"organization\",\n \"attribute\": \"located_in\",\n \"op\": \"in\",\n \"negate\": false,\n \"values\": [\"Sweden\", \"Norway\"]\n }],\n \"rolloutContextKind\": \"organization\",\n \"rolloutWeights\": {\n \"2f43f67c-3e4e-4945-a18a-26559378ca00\": 15000, // serve 15% this variation\n \"e5830889-1ec5-4b0c-9cc9-c48790090c43\": 85000 // serve 85% this variation\n }\n }]\n}\n```\n\n#### addTargets\n\nAdds context keys to the individual context targets for the context kind that `contextKind` specifies and the variation that `variationId` specifies. Returns an error if this causes the flag to target the same context key in multiple variations.\n\n##### Parameters\n\n- `values`: List of context keys.\n- `contextKind`: (Optional) Context kind to target, defaults to `user`\n- `variationId`: ID of a variation on the flag.\n\nHere's an example:\n\n```json\n{\n\t\"environmentKey\": \"environment-key-123abc\",\n\t\"instructions\": [{\n\t\t\"kind\": \"addTargets\",\n\t\t\"values\": [\"context-key-123abc\", \"context-key-456def\"],\n\t\t\"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\"\n\t}]\n}\n```\n\n#### addUserTargets\n\nAdds user keys to the individual user targets for the variation that `variationId` specifies. Returns an error if this causes the flag to target the same user key in multiple variations. If you are working with contexts, use `addTargets` instead of this instruction.\n\n##### Parameters\n\n- `values`: List of user keys.\n- `variationId`: ID of a variation on the flag.\n\nHere's an example:\n\n```json\n{\n\t\"environmentKey\": \"environment-key-123abc\",\n\t\"instructions\": [{\n\t\t\"kind\": \"addUserTargets\",\n\t\t\"values\": [\"user-key-123abc\", \"user-key-456def\"],\n\t\t\"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\"\n\t}]\n}\n```\n\n#### addValuesToClause\n\nAdds `values` to the values of the clause that `ruleId` and `clauseId` indicate. Does not update the context kind, attribute, or operator.\n\n##### Parameters\n\n- `ruleId`: ID of a rule in the flag.\n- `clauseId`: ID of a clause in that rule.\n- `values`: Array of strings, case sensitive.\n\nHere's an example:\n\n```json\n{\n\t\"environmentKey\": \"environment-key-123abc\",\n\t\"instructions\": [{\n\t\t\"kind\": \"addValuesToClause\",\n\t\t\"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\",\n\t\t\"clauseId\": \"10a58772-3121-400f-846b-b8a04e8944ed\",\n\t\t\"values\": [\"beta_testers\"]\n\t}]\n}\n```\n\n#### addVariation\n\nAdds a variation to the flag.\n\n##### Parameters\n\n- `value`: The variation value.\n- `name`: (Optional) The variation name.\n- `description`: (Optional) A description for the variation.\n\nHere's an example:\n\n```json\n{\n\t\"instructions\": [ { \"kind\": \"addVariation\", \"value\": 20, \"name\": \"New variation\" } ]\n}\n```\n\n#### clearTargets\n\nRemoves all individual targets from the variation that `variationId` specifies. This includes both user and non-user targets.\n\n##### Parameters\n\n- `variationId`: ID of a variation on the flag.\n\nHere's an example:\n\n```json\n{\n \"environmentKey\": \"environment-key-123abc\",\n \"instructions\": [ { \"kind\": \"clearTargets\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" } ]\n}\n```\n\n#### clearUserTargets\n\nRemoves all individual user targets from the variation that `variationId` specifies. If you are working with contexts, use `clearTargets` instead of this instruction.\n\n##### Parameters\n\n- `variationId`: ID of a variation on the flag.\n\nHere's an example:\n\n```json\n{\n \"environmentKey\": \"environment-key-123abc\",\n \"instructions\": [ { \"kind\": \"clearUserTargets\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" } ]\n}\n```\n\n#### removeClauses\n\nRemoves the clauses specified by `clauseIds` from the rule indicated by `ruleId`.\n\n##### Parameters\n\n- `ruleId`: ID of a rule in the flag.\n- `clauseIds`: Array of IDs of clauses in the rule.\n\nHere's an example:\n\n```json\n{\n\t\"environmentKey\": \"environment-key-123abc\",\n\t\"instructions\": [{\n\t\t\"kind\": \"removeClauses\",\n\t\t\"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\",\n\t\t\"clauseIds\": [\"10a58772-3121-400f-846b-b8a04e8944ed\", \"36a461dc-235e-4b08-97b9-73ce9365873e\"]\n\t}]\n}\n```\n\n#### removePrerequisite\n\nRemoves the prerequisite flag indicated by `key`. Does nothing if this prerequisite does not exist.\n\n##### Parameters\n\n- `key`: Flag key of an existing prerequisite flag.\n\nHere's an example:\n\n```json\n{\n \"environmentKey\": \"environment-key-123abc\",\n \"instructions\": [ { \"kind\": \"removePrerequisite\", \"key\": \"prereq-flag-key-123abc\" } ]\n}\n```\n\n#### removeRule\n\nRemoves the targeting rule specified by `ruleId`. Does nothing if the rule does not exist.\n\n##### Parameters\n\n- `ruleId`: ID of a rule in the flag.\n\nHere's an example:\n\n```json\n{\n \"environmentKey\": \"environment-key-123abc\",\n \"instructions\": [ { \"kind\": \"removeRule\", \"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\" } ]\n}\n```\n\n#### removeTargets\n\nRemoves context keys from the individual context targets for the context kind that `contextKind` specifies and the variation that `variationId` specifies. Does nothing if the flag does not target the context keys.\n\n##### Parameters\n\n- `values`: List of context keys.\n- `contextKind`: (Optional) Context kind to target, defaults to `user`\n- `variationId`: ID of a flag variation.\n\nHere's an example:\n\n```json\n{\n\t\"environmentKey\": \"environment-key-123abc\",\n\t\"instructions\": [{\n\t\t\"kind\": \"removeTargets\",\n\t\t\"values\": [\"context-key-123abc\", \"context-key-456def\"],\n\t\t\"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\"\n\t}]\n}\n```\n\n#### removeUserTargets\n\nRemoves user keys from the individual user targets for the variation that `variationId` specifies. Does nothing if the flag does not target the user keys. If you are working with contexts, use `removeTargets` instead of this instruction.\n\n##### Parameters\n\n- `values`: List of user keys.\n- `variationId`: ID of a flag variation.\n\nHere's an example:\n\n```json\n{\n\t\"environmentKey\": \"environment-key-123abc\",\n\t\"instructions\": [{\n\t\t\"kind\": \"removeUserTargets\",\n\t\t\"values\": [\"user-key-123abc\", \"user-key-456def\"],\n\t\t\"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\"\n\t}]\n}\n```\n\n#### removeValuesFromClause\n\nRemoves `values` from the values of the clause indicated by `ruleId` and `clauseId`. Does not update the context kind, attribute, or operator.\n\n##### Parameters\n\n- `ruleId`: ID of a rule in the flag.\n- `clauseId`: ID of a clause in that rule.\n- `values`: Array of strings, case sensitive.\n\nHere's an example:\n\n```json\n{\n\t\"environmentKey\": \"environment-key-123abc\",\n\t\"instructions\": [{\n\t\t\"kind\": \"removeValuesFromClause\",\n\t\t\"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\",\n\t\t\"clauseId\": \"10a58772-3121-400f-846b-b8a04e8944ed\",\n\t\t\"values\": [\"beta_testers\"]\n\t}]\n}\n```\n\n#### removeVariation\n\nRemoves a variation from the flag.\n\n##### Parameters\n\n- `variationId`: ID of a variation of the flag to remove.\n\nHere's an example:\n\n```json\n{\n\t\"instructions\": [ { \"kind\": \"removeVariation\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" } ]\n}\n```\n\n#### reorderRules\n\nRearranges the rules to match the order given in `ruleIds`. Returns an error if `ruleIds` does not match the current set of rules on the flag.\n\n##### Parameters\n\n- `ruleIds`: Array of IDs of all rules in the flag.\n\nHere's an example:\n\n```json\n{\n\t\"environmentKey\": \"environment-key-123abc\",\n\t\"instructions\": [{\n\t\t\"kind\": \"reorderRules\",\n\t\t\"ruleIds\": [\"a902ef4a-2faf-4eaf-88e1-ecc356708a29\", \"63c238d1-835d-435e-8f21-c8d5e40b2a3d\"]\n\t}]\n}\n```\n\n#### replacePrerequisites\n\nRemoves all existing prerequisites and replaces them with the list you provide.\n\n##### Parameters\n\n- `prerequisites`: A list of prerequisites. Each item in the list must include a flag `key` and `variationId`.\n\nHere's an example:\n\n```json\n{\n \"environmentKey\": \"environment-key-123abc\",\n \"instructions\": [\n {\n \"kind\": \"replacePrerequisites\",\n \"prerequisites\": [\n {\n \"key\": \"prereq-flag-key-123abc\",\n \"variationId\": \"10a58772-3121-400f-846b-b8a04e8944ed\"\n },\n {\n \"key\": \"another-prereq-flag-key-456def\",\n \"variationId\": \"e5830889-1ec5-4b0c-9cc9-c48790090c43\"\n }\n ]\n }\n ]\n}\n```\n\n#### replaceRules\n\nRemoves all targeting rules for the flag and replaces them with the list you provide.\n\n##### Parameters\n\n- `rules`: A list of rules.\n\nHere's an example:\n\n```json\n{\n \"environmentKey\": \"environment-key-123abc\",\n \"instructions\": [\n {\n \"kind\": \"replaceRules\",\n \"rules\": [\n {\n \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\",\n \"description\": \"My new rule\",\n \"clauses\": [\n {\n \"contextKind\": \"user\",\n \"attribute\": \"segmentMatch\",\n \"op\": \"segmentMatch\",\n \"values\": [\"test\"]\n }\n ],\n \"trackEvents\": true\n }\n ]\n }\n ]\n}\n```\n\n#### replaceTargets\n\nRemoves all existing targeting and replaces it with the list of targets you provide.\n\n##### Parameters\n\n- `targets`: A list of context targeting. Each item in the list includes an optional `contextKind` that defaults to `user`, a required `variationId`, and a required list of `values`.\n\nHere's an example:\n\n```json\n{\n \"environmentKey\": \"environment-key-123abc\",\n \"instructions\": [\n {\n \"kind\": \"replaceTargets\",\n \"targets\": [\n {\n \"contextKind\": \"user\",\n \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\",\n \"values\": [\"user-key-123abc\"]\n },\n {\n \"contextKind\": \"device\",\n \"variationId\": \"e5830889-1ec5-4b0c-9cc9-c48790090c43\",\n \"values\": [\"device-key-456def\"]\n }\n ]\n } \n ]\n}\n```\n\n#### replaceUserTargets\n\nRemoves all existing user targeting and replaces it with the list of targets you provide. In the list of targets, you must include a target for each of the flag's variations. If you are working with contexts, use `replaceTargets` instead of this instruction.\n\n##### Parameters\n\n- `targets`: A list of user targeting. Each item in the list must include a `variationId` and a list of `values`.\n\nHere's an example:\n\n```json\n{\n \"environmentKey\": \"environment-key-123abc\",\n \"instructions\": [\n {\n \"kind\": \"replaceUserTargets\",\n \"targets\": [\n {\n \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\",\n \"values\": [\"user-key-123abc\", \"user-key-456def\"]\n },\n {\n \"variationId\": \"e5830889-1ec5-4b0c-9cc9-c48790090c43\",\n \"values\": [\"user-key-789ghi\"]\n }\n ]\n }\n ]\n}\n```\n\n#### updateClause\n\nReplaces the clause indicated by `ruleId` and `clauseId` with `clause`.\n\n##### Parameters\n\n- `ruleId`: ID of a rule in the flag.\n- `clauseId`: ID of a clause in that rule.\n- `clause`: New `clause` object, with `contextKind` (string), `attribute` (string), `op` (string), `negate` (boolean), and `values` (array of strings, numbers, or dates) properties. The `contextKind`, `attribute`, and `values` are case sensitive. The `op` must be lower-case.\n\nHere's an example:\n\n```json\n{\n \"environmentKey\": \"environment-key-123abc\",\n \"instructions\": [{\n \"kind\": \"updateClause\",\n \"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\",\n \"clauseId\": \"10c7462a-2062-45ba-a8bb-dfb3de0f8af5\",\n \"clause\": {\n \"contextKind\": \"user\",\n \"attribute\": \"country\",\n \"op\": \"in\",\n \"negate\": false,\n \"values\": [\"Mexico\", \"Canada\"]\n }\n }]\n}\n```\n\n#### updateDefaultVariation\n\nUpdates the default on or off variation of the flag.\n\n##### Parameters\n\n- `onVariationValue`: (Optional) The value of the variation of the new on variation.\n- `offVariationValue`: (Optional) The value of the variation of the new off variation\n\nHere's an example:\n\n```json\n{\n\t\"instructions\": [ { \"kind\": \"updateDefaultVariation\", \"OnVariationValue\": true, \"OffVariationValue\": false } ]\n}\n```\n\n#### updateFallthroughVariationOrRollout\n\nUpdates the default or \"fallthrough\" rule for the flag, which the flag serves when a context matches none of the targeting rules. The rule can serve either the variation that `variationId` indicates, or a percentage rollout that `rolloutWeights` and `rolloutBucketBy` indicate.\n\n##### Parameters\n\n- `variationId`: ID of a variation of the flag.\n\nor\n\n- `rolloutWeights`: Map of `variationId` to weight, in thousandths of a percent (0-100000).\n- `rolloutBucketBy`: (Optional) Context attribute available in the specified `rolloutContextKind`.\n- `rolloutContextKind`: (Optional) Context kind, defaults to `user`\n\nHere's an example that uses a `variationId`:\n\n```json\n{\n\t\"environmentKey\": \"environment-key-123abc\",\n\t\"instructions\": [{\n\t\t\"kind\": \"updateFallthroughVariationOrRollout\",\n\t\t\"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\"\n\t}]\n}\n```\n\nHere's an example that uses a percentage rollout:\n\n```json\n{\n\t\"environmentKey\": \"environment-key-123abc\",\n\t\"instructions\": [{\n\t\t\"kind\": \"updateFallthroughVariationOrRollout\",\n\t\t\"rolloutContextKind\": \"user\",\n\t\t\"rolloutWeights\": {\n\t\t\t\"2f43f67c-3e4e-4945-a18a-26559378ca00\": 15000, // serve 15% this variation\n\t\t\t\"e5830889-1ec5-4b0c-9cc9-c48790090c43\": 85000 // serve 85% this variation\n\t\t}\n\t}]\n}\n```\n\n#### updateOffVariation\n\nUpdates the default off variation to `variationId`. The flag serves the default off variation when the flag's targeting is **Off**.\n\n##### Parameters\n\n- `variationId`: ID of a variation of the flag.\n\nHere's an example:\n\n```json\n{\n \"environmentKey\": \"environment-key-123abc\",\n \"instructions\": [ { \"kind\": \"updateOffVariation\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\" } ]\n}\n```\n\n#### updatePrerequisite\n\nChanges the prerequisite flag that `key` indicates to use the variation that `variationId` indicates. Returns an error if this prerequisite does not exist.\n\n##### Parameters\n\n- `key`: Flag key of an existing prerequisite flag.\n- `variationId`: ID of a variation of the prerequisite flag.\n\nHere's an example:\n\n```json\n{\n\t\"environmentKey\": \"environment-key-123abc\",\n\t\"instructions\": [{\n\t\t\"kind\": \"updatePrerequisite\",\n\t\t\"key\": \"example-prereq-flag-key\",\n\t\t\"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\"\n\t}]\n}\n```\n\n#### updateRuleDescription\n\nUpdates the description of the feature flag rule.\n\n##### Parameters\n\n- `description`: The new human-readable description for this rule.\n- `ruleId`: The ID of the rule. You can retrieve this by making a GET request for the flag.\n\nHere's an example:\n\n```json\n{\n\t\"environmentKey\": \"environment-key-123abc\",\n\t\"instructions\": [{\n\t\t\"kind\": \"updateRuleDescription\",\n\t\t\"description\": \"New rule description\",\n\t\t\"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\"\n\t}]\n}\n```\n\n#### updateRuleTrackEvents\n\nUpdates whether or not LaunchDarkly tracks events for the feature flag associated with this rule.\n\n##### Parameters\n\n- `ruleId`: The ID of the rule. You can retrieve this by making a GET request for the flag.\n- `trackEvents`: Whether or not events are tracked.\n\nHere's an example:\n\n```json\n{\n\t\"environmentKey\": \"environment-key-123abc\",\n\t\"instructions\": [{\n\t\t\"kind\": \"updateRuleTrackEvents\",\n\t\t\"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\",\n\t\t\"trackEvents\": true\n\t}]\n}\n```\n\n#### updateRuleVariationOrRollout\n\nUpdates what `ruleId` serves when its clauses evaluate to true. The rule can serve either the variation that `variationId` indicates, or a percent rollout that `rolloutWeights` and `rolloutBucketBy` indicate.\n\n##### Parameters\n\n- `ruleId`: ID of a rule in the flag.\n- `variationId`: ID of a variation of the flag.\n\n or\n\n- `rolloutWeights`: Map of `variationId` to weight, in thousandths of a percent (0-100000).\n- `rolloutBucketBy`: (Optional) Context attribute available in the specified `rolloutContextKind`.\n- `rolloutContextKind`: (Optional) Context kind, defaults to `user`\n\nHere's an example:\n\n```json\n{\n\t\"environmentKey\": \"environment-key-123abc\",\n\t\"instructions\": [{\n\t\t\"kind\": \"updateRuleVariationOrRollout\",\n\t\t\"ruleId\": \"a902ef4a-2faf-4eaf-88e1-ecc356708a29\",\n\t\t\"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\"\n\t}]\n}\n```\n\n#### updateTrackEvents\n\nUpdates whether or not LaunchDarkly tracks events for the feature flag, for all rules.\n\n##### Parameters\n\n- `trackEvents`: Whether or not events are tracked.\n\nHere's an example:\n\n```json\n{\n \"environmentKey\": \"environment-key-123abc\",\n \"instructions\": [ { \"kind\": \"updateTrackEvents\", \"trackEvents\": true } ]\n}\n```\n\n#### updateTrackEventsFallthrough\n\nUpdates whether or not LaunchDarkly tracks events for the feature flag, for the default rule.\n\n##### Parameters\n\n- `trackEvents`: Whether or not events are tracked.\n\nHere's an example:\n\n```json\n{\n \"environmentKey\": \"environment-key-123abc\",\n \"instructions\": [ { \"kind\": \"updateTrackEventsFallthrough\", \"trackEvents\": true } ]\n}\n```\n\n#### updateVariation\n\nUpdates a variation of the flag.\n\n##### Parameters\n\n- `variationId`: The ID of the variation to update.\n- `name`: (Optional) The updated variation name.\n- `value`: (Optional) The updated variation value.\n- `description`: (Optional) The updated variation description.\n\nHere's an example:\n\n```json\n{\n\t\"instructions\": [ { \"kind\": \"updateVariation\", \"variationId\": \"2f43f67c-3e4e-4945-a18a-26559378ca00\", \"value\": 20 } ]\n}\n```\n\n

\n\n
\nClick to expand instructions for updating flag settings\n\nThese instructions do not require the `environmentKey` parameter. They make changes that apply to the flag across all environments.\n\n#### addCustomProperties\n\nAdds a new custom property to the feature flag. Custom properties are used to associate feature flags with LaunchDarkly integrations. For example, if you create an integration with an issue tracking service, you may want to associate a flag with a list of issues related to a feature's development.\n\n##### Parameters\n\n - `key`: The custom property key.\n - `name`: The custom property name.\n - `values`: A list of the associated values for the custom property.\n\nHere's an example:\n\n```json\n{\n\t\"instructions\": [{\n\t\t\"kind\": \"addCustomProperties\",\n\t\t\"key\": \"example-custom-property\",\n\t\t\"name\": \"Example custom property\",\n\t\t\"values\": [\"value1\", \"value2\"]\n\t}]\n}\n```\n\n#### addTags\n\nAdds tags to the feature flag.\n\n##### Parameters\n\n- `values`: A list of tags to add.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [ { \"kind\": \"addTags\", \"values\": [\"tag1\", \"tag2\"] } ]\n}\n```\n\n#### makeFlagPermanent\n\nMarks the feature flag as permanent. LaunchDarkly does not prompt you to remove permanent flags, even if one variation is rolled out to all your customers.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [ { \"kind\": \"makeFlagPermanent\" } ]\n}\n```\n\n#### makeFlagTemporary\n\nMarks the feature flag as temporary.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [ { \"kind\": \"makeFlagTemporary\" } ]\n}\n```\n\n#### removeCustomProperties\n\nRemoves the associated values from a custom property. If all the associated values are removed, this instruction also removes the custom property.\n\n##### Parameters\n\n - `key`: The custom property key.\n - `values`: A list of the associated values to remove from the custom property.\n\n```json\n{\n\t\"instructions\": [{\n\t\t\"kind\": \"replaceCustomProperties\",\n\t\t\"key\": \"example-custom-property\",\n\t\t\"values\": [\"value1\", \"value2\"]\n\t}]\n}\n```\n\n#### removeMaintainer\n\nRemoves the flag's maintainer. To set a new maintainer, use the flag's **Settings** tab in the LaunchDarkly user interface.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [ { \"kind\": \"removeMaintainer\" } ]\n}\n```\n\n#### removeTags\n\nRemoves tags from the feature flag.\n\n##### Parameters\n\n- `values`: A list of tags to remove.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [ { \"kind\": \"removeTags\", \"values\": [\"tag1\", \"tag2\"] } ]\n}\n```\n\n#### replaceCustomProperties\n\nReplaces the existing associated values for a custom property with the new values.\n\n##### Parameters\n\n - `key`: The custom property key.\n - `name`: The custom property name.\n - `values`: A list of the new associated values for the custom property.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"replaceCustomProperties\",\n \"key\": \"example-custom-property\",\n \"name\": \"Example custom property\",\n \"values\": [\"value1\", \"value2\"]\n }]\n}\n```\n\n#### turnOffClientSideAvailability\n\nTurns off client-side SDK availability for the flag. This is equivalent to unchecking the **SDKs using Mobile Key** and/or **SDKs using client-side ID** boxes for the flag. If you're using a client-side or mobile SDK, you must expose your feature flags in order for the client-side or mobile SDKs to evaluate them.\n\n##### Parameters\n\n- `value`: Use \"usingMobileKey\" to turn off availability for mobile SDKs. Use \"usingEnvironmentId\" to turn on availability for client-side SDKs.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [ { \"kind\": \"turnOffClientSideAvailability\", \"value\": \"usingMobileKey\" } ]\n}\n```\n\n#### turnOnClientSideAvailability\n\nTurns on client-side SDK availability for the flag. This is equivalent to unchecking the **SDKs using Mobile Key** and/or **SDKs using client-side ID** boxes for the flag. If you're using a client-side or mobile SDK, you must expose your feature flags in order for the client-side or mobile SDKs to evaluate them.\n\n##### Parameters\n\n- `value`: Use \"usingMobileKey\" to turn on availability for mobile SDKs. Use \"usingEnvironmentId\" to turn on availability for client-side SDKs.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [ { \"kind\": \"turnOnClientSideAvailability\", \"value\": \"usingMobileKey\" } ]\n}\n```\n\n#### updateDescription\n\nUpdates the feature flag description.\n\n##### Parameters\n\n- `value`: The new description.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [ { \"kind\": \"updateDescription\", \"value\": \"Updated flag description\" } ]\n}\n```\n#### updateMaintainerMember\n\nUpdates the maintainer of the flag to an existing member and removes the existing maintainer.\n\n##### Parameters\n\n- `value`: The ID of the member.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [ { \"kind\": \"updateMaintainerMember\", \"value\": \"61e9b714fd47591727db558a\" } ]\n}\n```\n\n#### updateMaintainerTeam\n\nUpdates the maintainer of the flag to an existing team and removes the existing maintainer.\n\n##### Parameters\n\n- `value`: The key of the team.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [ { \"kind\": \"updateMaintainerTeam\", \"value\": \"example-team-key\" } ]\n}\n```\n\n#### updateName\n\nUpdates the feature flag name.\n\n##### Parameters\n\n- `value`: The new name.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [ { \"kind\": \"updateName\", \"value\": \"Updated flag name\" } ]\n}\n```\n\n

\n\n
\nClick to expand instructions for updating the flag lifecycle\n\nThese instructions do not require the `environmentKey` parameter. They make changes that apply to the flag across all environments.\n\n#### archiveFlag\n\nArchives the feature flag. This retires it from LaunchDarkly without deleting it. You cannot archive a flag that is a prerequisite of other flags.\n\n```json\n{\n \"instructions\": [ { \"kind\": \"archiveFlag\" } ]\n}\n```\n\n#### deleteFlag\n\nDeletes the feature flag and its rules. You cannot restore a deleted flag. If this flag is requested again, the flag value defined in code will be returned for all contexts.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [ { \"kind\": \"deleteFlag\" } ]\n}\n```\n\n#### deprecateFlag\n\nDeprecates the feature flag. This hides it from the live flags list without archiving or deleting it.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [ { \"kind\": \"deprecateFlag\" } ]\n}\n```\n\n#### restoreDeprecatedFlag\n\nRestores the feature flag if it was previously deprecated.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [ { \"kind\": \"restoreDeprecatedFlag\" } ]\n}\n```\n\n#### restoreFlag\n\nRestores the feature flag if it was previously archived.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [ { \"kind\": \"restoreFlag\" } ]\n}\n```\n\n
\n\n### Using JSON patches on a feature flag\n\nIf you do not include the semantic patch header described above, you can use a [JSON patch](/reference#updates-using-json-patch) or [JSON merge patch](https://datatracker.ietf.org/doc/html/rfc7386) representation of the desired changes.\n\nIn the JSON patch representation, use a JSON pointer in the `path` element to describe what field to change. Use the [Get feature flag](/tag/Feature-flags#operation/getFeatureFlag) endpoint to find the field you want to update.\n\nThere are a few special cases to keep in mind when determining the value of the `path` element:\n\n * To add an individual target to a specific variation if the flag variation already has individual targets, the path for the JSON patch operation is:\n\n ```json\n [\n {\n \"op\": \"add\",\n \"path\": \"/environments/devint/targets/0/values/-\",\n \"value\": \"TestClient10\"\n }\n ]\n ```\n\n * To add an individual target to a specific variation if the flag variation does not already have individual targets, the path for the JSON patch operation is:\n\n ```json\n [\n {\n \"op\": \"add\",\n \"path\": \"/environments/devint/targets/-\",\n \"value\": { \"variation\": 0, \"values\": [\"TestClient10\"] }\n }\n ]\n ```\n\n * To add a flag to a release pipeline, the path for the JSON patch operation is:\n\n ```json\n [\n {\n \"op\": \"add\",\n \"path\": \"/releasePipelineKey\",\n \"value\": \"example-release-pipeline-key\"\n }\n ]\n ```\n\n### Required approvals\nIf a request attempts to alter a flag configuration in an environment where approvals are required for the flag, the request will fail with a 405. Changes to the flag configuration in that environment will require creating an [approval request](/tag/Approvals) or a [workflow](/tag/Workflows).\n\n### Conflicts\nIf a flag configuration change made through this endpoint would cause a pending scheduled change or approval request to fail, this endpoint will return a 400. You can ignore this check by adding an `ignoreConflicts` query parameter set to `true`.\n\n### Migration flags\nFor migration flags, the cohort information is included in the `rules` property of a flag's response. You can update cohorts by updating `rules`. Default cohort information is included in the `fallthrough` property of a flag's response. You can update the default cohort by updating `fallthrough`.\nWhen you update the rollout for a cohort or the default cohort through the API, provide a rollout instead of a single `variationId`.\nTo learn more, read [Migration Flags](https://docs.launchdarkly.com/home/flag-types/migration-flags).\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key. The key identifies the flag in your code.", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key. The key identifies the flag in your code." + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchWithComment" + }, + "example": { + "patch": [ + { + "op": "replace", + "path": "/description", + "value": "New description for this flag" + } + ] + } + } + }, + "required": true + }, + "operationId": "patchFeatureFlag" + }, + "delete": { + "responses": { + "204": { + "description": "Action succeeded" + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Feature flags" + ], + "summary": "Delete feature flag", + "description": "Delete a feature flag in all environments. Use with caution: only delete feature flags your application no longer uses.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key. The key identifies the flag in your code.", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key. The key identifies the flag in your code." + } + } + ], + "operationId": "deleteFeatureFlag" + } + }, + "/api/v2/flags/{projectKey}/{featureFlagKey}/copy": { + "post": { + "responses": { + "201": { + "description": "Global flag response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeatureFlag" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "405": { + "description": "Method not allowed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MethodNotAllowedErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Feature flags" + ], + "summary": "Copy feature flag", + "description": "\n> ### Copying flag settings is an Enterprise feature\n>\n> Copying flag settings is available to customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\nCopy flag settings from a source environment to a target environment.\n\nBy default, this operation copies the entire flag configuration. You can use the `includedActions` or `excludedActions` to specify that only part of the flag configuration is copied.\n\nIf you provide the optional `currentVersion` of a flag, this operation tests to ensure that the current flag version in the environment matches the version you've specified. The operation rejects attempts to copy flag settings if the environment's current version of the flag does not match the version you've specified. You can use this to enforce optimistic locking on copy attempts.\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key. The key identifies the flag in your code.", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key. The key identifies the flag in your code." + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FlagCopyConfigPost" + }, + "example": { + "comment": "optional comment", + "source": { + "currentVersion": 1, + "key": "source-env-key-123abc" + }, + "target": { + "currentVersion": 1, + "key": "target-env-key-123abc" + } + } + } + }, + "required": true + }, + "operationId": "copyFeatureFlag" + } + }, + "/api/v2/flags/{projectKey}/{featureFlagKey}/dependent-flags": { + "get": { + "responses": { + "200": { + "description": "Multi environment dependent flags collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MultiEnvironmentDependentFlags" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Feature flags (beta)" + ], + "summary": "List dependent feature flags", + "description": "> ### Flag prerequisites is an Enterprise feature\n>\n> Flag prerequisites is available to customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\nList dependent flags across all environments for the flag specified in the path parameters. A dependent flag is a flag that uses another flag as a prerequisite. To learn more, read [Flag prerequisites](https://docs.launchdarkly.com/home/targeting-flags/prerequisites).\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + } + ], + "operationId": "getDependentFlags" + } + }, + "/api/v2/flags/{projectKey}/{featureFlagKey}/experiments/{environmentKey}/{metricKey}": { + "get": { + "responses": { + "200": { + "description": "Experiment results response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExperimentResults" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Experiments (beta)" + ], + "summary": "Get legacy experiment results (deprecated)", + "description": "Get detailed experiment result data for legacy experiments.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "metricKey", + "in": "path", + "description": "The metric key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The metric key" + } + }, + { + "name": "from", + "in": "query", + "description": "A timestamp denoting the start of the data collection period, expressed as a Unix epoch time in milliseconds.", + "schema": { + "type": "integer", + "format": "int64", + "description": "A timestamp denoting the start of the data collection period, expressed as a Unix epoch time in milliseconds." + } + }, + { + "name": "to", + "in": "query", + "description": "A timestamp denoting the end of the data collection period, expressed as a Unix epoch time in milliseconds.", + "schema": { + "type": "integer", + "format": "int64", + "description": "A timestamp denoting the end of the data collection period, expressed as a Unix epoch time in milliseconds." + } + } + ], + "operationId": "getLegacyExperimentResults", + "deprecated": true + } + }, + "/api/v2/flags/{projectKey}/{featureFlagKey}/expiring-targets/{environmentKey}": { + "get": { + "responses": { + "200": { + "description": "Expiring target response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExpiringTargetGetResponse" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Feature flags" + ], + "summary": "Get expiring context targets for feature flag", + "description": "Get a list of context targets on a feature flag that are scheduled for removal.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + } + ], + "operationId": "getExpiringContextTargets" + }, + "patch": { + "responses": { + "200": { + "description": "Expiring target response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExpiringTargetPatchResponse" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Feature flags" + ], + "summary": "Update expiring context targets on feature flag", + "description": "Schedule a context for removal from individual targeting on a feature flag. The flag must already individually target the context.\n\nYou can add, update, or remove a scheduled removal date. You can only schedule a context for removal on a single variation per flag.\n\nUpdating an expiring target uses the semantic patch format. To make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch).\n\n### Instructions\n\nSemantic patch requests support the following `kind` instructions for updating expiring targets.\n\n
\nClick to expand instructions for updating expiring targets\n\n#### addExpiringTarget\n\nAdds a date and time that LaunchDarkly will remove the context from the flag's individual targeting.\n\n##### Parameters\n\n* `value`: The time, in Unix milliseconds, when LaunchDarkly should remove the context from individual targeting for this flag\n* `variationId`: ID of a variation on the flag\n* `contextKey`: The context key for the context to remove from individual targeting\n* `contextKind`: The kind of context represented by the `contextKey`\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"addExpiringTarget\",\n \"value\": 1754006460000,\n \"variationId\": \"4254742c-71ae-411f-a992-43b18a51afe0\",\n \"contextKey\": \"user-key-123abc\",\n \"contextKind\": \"user\"\n }]\n}\n```\n\n#### updateExpiringTarget\n\nUpdates the date and time that LaunchDarkly will remove the context from the flag's individual targeting\n\n##### Parameters\n\n* `value`: The time, in Unix milliseconds, when LaunchDarkly should remove the context from individual targeting for this flag\n* `variationId`: ID of a variation on the flag\n* `contextKey`: The context key for the context to remove from individual targeting\n* `contextKind`: The kind of context represented by the `contextKey`\n* `version`: (Optional) The version of the expiring target to update. If included, update will fail if version doesn't match current version of the expiring target.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"updateExpiringTarget\",\n \"value\": 1754006460000,\n \"variationId\": \"4254742c-71ae-411f-a992-43b18a51afe0\",\n \"contextKey\": \"user-key-123abc\",\n \"contextKind\": \"user\"\n }]\n}\n```\n\n#### removeExpiringTarget\n\nRemoves the scheduled removal of the context from the flag's individual targeting. The context will remain part of the flag's individual targeting until you explicitly remove it, or until you schedule another removal.\n\n##### Parameters\n\n* `variationId`: ID of a variation on the flag\n* `contextKey`: The context key for the context to remove from individual targeting\n* `contextKind`: The kind of context represented by the `contextKey`\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"removeExpiringTarget\",\n \"variationId\": \"4254742c-71ae-411f-a992-43b18a51afe0\",\n \"contextKey\": \"user-key-123abc\",\n \"contextKind\": \"user\"\n }]\n}\n```\n\n
\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/patchFlagsRequest" + } + } + }, + "required": true + }, + "operationId": "patchExpiringTargets" + } + }, + "/api/v2/flags/{projectKey}/{featureFlagKey}/expiring-user-targets/{environmentKey}": { + "get": { + "responses": { + "200": { + "description": "Expiring user target response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExpiringUserTargetGetResponse" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Feature flags" + ], + "summary": "Get expiring user targets for feature flag", + "description": "\n> ### Contexts are now available\n>\n> After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use [Get expiring context targets for feature flag](/tag/Feature-flags#operation/getExpiringContextTargets) instead of this endpoint. To learn more, read [Contexts](https://docs.launchdarkly.com/home/contexts).\n\nGet a list of user targets on a feature flag that are scheduled for removal.\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + } + ], + "operationId": "getExpiringUserTargets" + }, + "patch": { + "responses": { + "200": { + "description": "Expiring user target response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExpiringUserTargetPatchResponse" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Feature flags" + ], + "summary": "Update expiring user targets on feature flag", + "description": "> ### Contexts are now available\n>\n> After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use [Update expiring context targets on feature flag](/tag/Feature-flags#operation/patchExpiringTargets) instead of this endpoint. To learn more, read [Contexts](https://docs.launchdarkly.com/home/contexts).\n\nSchedule a target for removal from individual targeting on a feature flag. The flag must already serve a variation to specific targets based on their key.\n\nYou can add, update, or remove a scheduled removal date. You can only schedule a target for removal on a single variation per flag.\n\nUpdating an expiring target uses the semantic patch format. To make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch).\n\n### Instructions\n\nSemantic patch requests support the following `kind` instructions for updating expiring user targets.\n\n
\nClick to expand instructions for updating expiring user targets\n\n#### addExpireUserTargetDate\n\nAdds a date and time that LaunchDarkly will remove the user from the flag's individual targeting.\n\n##### Parameters\n\n* `value`: The time, in Unix milliseconds, when LaunchDarkly should remove the user from individual targeting for this flag\n* `variationId`: ID of a variation on the flag\n* `userKey`: The user key for the user to remove from individual targeting\n\n#### updateExpireUserTargetDate\n\nUpdates the date and time that LaunchDarkly will remove the user from the flag's individual targeting.\n\n##### Parameters\n\n* `value`: The time, in Unix milliseconds, when LaunchDarkly should remove the user from individual targeting for this flag\n* `variationId`: ID of a variation on the flag\n* `userKey`: The user key for the user to remove from individual targeting\n* `version`: (Optional) The version of the expiring user target to update. If included, update will fail if version doesn't match current version of the expiring user target.\n\n#### removeExpireUserTargetDate\n\nRemoves the scheduled removal of the user from the flag's individual targeting. The user will remain part of the flag's individual targeting until you explicitly remove them, or until you schedule another removal.\n\n##### Parameters\n\n* `variationId`: ID of a variation on the flag\n* `userKey`: The user key for the user to remove from individual targeting\n\n
\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/patchFlagsRequest" + } + } + }, + "required": true + }, + "operationId": "patchExpiringUserTargets" + } + }, + "/api/v2/flags/{projectKey}/{featureFlagKey}/triggers/{environmentKey}": { + "get": { + "responses": { + "200": { + "description": "Flag trigger collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TriggerWorkflowCollectionRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Flag triggers" + ], + "summary": "List flag triggers", + "description": "Get a list of all flag triggers.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + } + ], + "operationId": "getTriggerWorkflows" + }, + "post": { + "responses": { + "201": { + "description": "Flag trigger response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TriggerWorkflowRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Flag triggers" + ], + "summary": "Create flag trigger", + "description": "Create a new flag trigger.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/triggerPost" + } + } + }, + "required": true + }, + "operationId": "createTriggerWorkflow" + } + }, + "/api/v2/flags/{projectKey}/{featureFlagKey}/triggers/{environmentKey}/{id}": { + "get": { + "responses": { + "200": { + "description": "Flag trigger response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TriggerWorkflowRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Flag triggers" + ], + "summary": "Get flag trigger by ID", + "description": "Get a flag trigger by ID.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "id", + "in": "path", + "description": "The flag trigger ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The flag trigger ID" + } + } + ], + "operationId": "getTriggerWorkflowById" + }, + "patch": { + "responses": { + "200": { + "description": "Flag trigger response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TriggerWorkflowRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Flag triggers" + ], + "summary": "Update flag trigger", + "description": "Update a flag trigger. Updating a flag trigger uses the semantic patch format.\n\nTo make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch).\n\n### Instructions\n\nSemantic patch requests support the following `kind` instructions for updating flag triggers.\n\n
\nClick to expand instructions for updating flag triggers\n\n#### replaceTriggerActionInstructions\n\nRemoves the existing trigger action and replaces it with the new instructions.\n\n##### Parameters\n\n- `value`: An array of the new `kind`s of actions to perform when triggering. Supported flag actions are `turnFlagOn` and `turnFlagOff`.\n\nHere's an example that replaces the existing action with new instructions to turn flag targeting off:\n\n```json\n{\n \"instructions\": [\n {\n \"kind\": \"replaceTriggerActionInstructions\",\n \"value\": [ {\"kind\": \"turnFlagOff\"} ]\n }\n ]\n}\n```\n\n#### cycleTriggerUrl\n\nGenerates a new URL for this trigger. You must update any clients using the trigger to use this new URL.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{ \"kind\": \"cycleTriggerUrl\" }]\n}\n```\n\n#### disableTrigger\n\nDisables the trigger. This saves the trigger configuration, but the trigger stops running. To re-enable, use `enableTrigger`.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{ \"kind\": \"disableTrigger\" }]\n}\n```\n\n#### enableTrigger\n\nEnables the trigger. If you previously disabled the trigger, it begins running again.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{ \"kind\": \"enableTrigger\" }]\n}\n```\n\n
\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + }, + { + "name": "id", + "in": "path", + "description": "The flag trigger ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The flag trigger ID" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FlagTriggerInput" + } + } + }, + "required": true + }, + "operationId": "patchTriggerWorkflow" + }, + "delete": { + "responses": { + "204": { + "description": "Action succeeded" + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Flag triggers" + ], + "summary": "Delete flag trigger", + "description": "Delete a flag trigger by ID.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + }, + { + "name": "id", + "in": "path", + "description": "The flag trigger ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The flag trigger ID" + } + } + ], + "operationId": "deleteTriggerWorkflow" + } + }, + "/api/v2/flags/{projectKey}/{flagKey}/release": { + "get": { + "responses": { + "200": { + "description": "Release response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Release" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + } + }, + "tags": [ + "Releases (beta)" + ], + "summary": "Get release for flag", + "description": "Get currently active release for a flag", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "flagKey", + "in": "path", + "description": "The flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The flag key" + } + } + ], + "operationId": "getReleaseByFlagKey" + }, + "patch": { + "responses": { + "200": { + "description": "Release response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Release" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Releases (beta)" + ], + "summary": "Patch release for flag", + "description": "Update currently active release for a flag. Updating releases requires the [JSON patch](https://datatracker.ietf.org/doc/html/rfc6902) format. To learn more, read [Updates](/#section/Overview/Updates).\n\nYou can only use this endpoint to mark a release phase complete or incomplete. To indicate which phase to update, use the array index in the `path`. For example, to mark the first phase of a release as complete, use the following request body:\n\n```\n [\n {\n \"op\": \"replace\",\n \"path\": \"/phase/0/complete\",\n \"value\": true\n }\n ]\n```\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "flagKey", + "in": "path", + "description": "The flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The flag key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JSONPatch" + }, + "example": [ + { + "op": "replace", + "path": "/phases/0/complete", + "value": true + } + ] + } + }, + "required": true + }, + "operationId": "patchReleaseByFlagKey" + } + }, + "/api/v2/integration-capabilities/big-segment-store": { + "get": { + "responses": { + "200": { + "description": "Big segment store collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BigSegmentStoreIntegrationCollection" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Environment or project not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Integrations (beta)" + ], + "summary": "List all big segment store integrations", + "description": "List all big segment store integrations.", + "operationId": "getBigSegmentStoreIntegrations" + } + }, + "/api/v2/integration-capabilities/big-segment-store/{projectKey}/{environmentKey}/{integrationKey}": { + "post": { + "responses": { + "201": { + "description": "Big segment store response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BigSegmentStoreIntegration" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Environment or project not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Integrations (beta)" + ], + "summary": "Create big segment store integration", + "description": "\nCreate a persistent store integration.\n\nIf you are using server-side SDKs, segments synced from external tools and larger list-based segments require a persistent store within your infrastructure. LaunchDarkly keeps the persistent store up to date and consults it during flag evaluation.\n\nYou can use either Redis or DynamoDB as your persistent store. When you create a persistent store integration, the fields in the `config` object in the request vary depending on which persistent store you use.\n\nIf you are using Redis to create your persistent store integration, you will need to know:\n\n* Your Redis host\n* Your Redis port\n* Your Redis username\n* Your Redis password\n* Whether or not LaunchDarkly should connect using TLS\n\nIf you are using DynamoDB to create your persistent store integration, you will need to know:\n\n* Your DynamoDB table name. The table must have the following schema:\n * Partition key: `namespace` (string)\n * Sort key: `key` (string)\n* Your DynamoDB Amazon Web Services (AWS) region.\n* Your AWS role Amazon Resource Name (ARN). This is the role that LaunchDarkly will assume to manage your DynamoDB table.\n* The External ID you specified when creating your Amazon Resource Name (ARN).\n\nTo learn more, read [Segment configuration](https://docs.launchdarkly.com/home/segments/big-segment-configuration).\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "integrationKey", + "in": "path", + "description": "The integration key, either `redis` or `dynamodb`", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The integration key, either `redis` or `dynamodb`" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IntegrationDeliveryConfigurationPost" + }, + "example": { + "config": { + "optional": "example value for optional formVariables property for sample-integration", + "required": "example value for required formVariables property for sample-integration" + }, + "name": "Example persistent store integration", + "on": false, + "tags": [ + "example-tag" + ] + } + } + }, + "required": true + }, + "operationId": "createBigSegmentStoreIntegration" + } + }, + "/api/v2/integration-capabilities/big-segment-store/{projectKey}/{environmentKey}/{integrationKey}/{integrationId}": { + "get": { + "responses": { + "200": { + "description": "Big segment store response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BigSegmentStoreIntegration" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Environment or project not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Integrations (beta)" + ], + "summary": "Get big segment store integration by ID", + "description": "Get a big segment store integration by ID.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "integrationKey", + "in": "path", + "description": "The integration key, either `redis` or `dynamodb`", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The integration key, either `redis` or `dynamodb`" + } + }, + { + "name": "integrationId", + "in": "path", + "description": "The integration ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The integration ID" + } + } + ], + "operationId": "getBigSegmentStoreIntegration" + }, + "patch": { + "responses": { + "200": { + "description": "Big segment store response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BigSegmentStoreIntegration" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Environment or project not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Integrations (beta)" + ], + "summary": "Update big segment store integration", + "description": "Update a big segment store integration. Updating a big segment store requires a [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes. To learn more, read [Updates](/#section/Overview/Updates).", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "integrationKey", + "in": "path", + "description": "The integration key, either `redis` or `dynamodb`", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The integration key, either `redis` or `dynamodb`" + } + }, + { + "name": "integrationId", + "in": "path", + "description": "The integration ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The integration ID" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JSONPatch" + } + } + }, + "required": true + }, + "operationId": "patchBigSegmentStoreIntegration" + }, + "delete": { + "responses": { + "204": { + "description": "Action completed successfully" + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Environment or project not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Integrations (beta)" + ], + "summary": "Delete big segment store integration", + "description": "Delete a persistent store integration. Each integration uses either Redis or DynamoDB.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "integrationKey", + "in": "path", + "description": "The integration key, either `redis` or `dynamodb`", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The integration key, either `redis` or `dynamodb`" + } + }, + { + "name": "integrationId", + "in": "path", + "description": "The integration ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The integration ID" + } + } + ], + "operationId": "deleteBigSegmentStoreIntegration" + } + }, + "/api/v2/integration-capabilities/featureStore": { + "get": { + "responses": { + "200": { + "description": "Integration delivery configuration collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IntegrationDeliveryConfigurationCollection" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Integration delivery configurations (beta)" + ], + "summary": "List all delivery configurations", + "description": "List all delivery configurations.", + "operationId": "getIntegrationDeliveryConfigurations" + } + }, + "/api/v2/integration-capabilities/featureStore/{projectKey}/{environmentKey}": { + "get": { + "responses": { + "200": { + "description": "Integration delivery configuration collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IntegrationDeliveryConfigurationCollection" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Integration delivery configurations (beta)" + ], + "summary": "Get delivery configurations by environment", + "description": "Get delivery configurations by environment.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + } + ], + "operationId": "getIntegrationDeliveryConfigurationByEnvironment" + } + }, + "/api/v2/integration-capabilities/featureStore/{projectKey}/{environmentKey}/{integrationKey}": { + "post": { + "responses": { + "201": { + "description": "Integration delivery configuration response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IntegrationDeliveryConfiguration" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Integration delivery configurations (beta)" + ], + "summary": "Create delivery configuration", + "description": "Create a delivery configuration.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "integrationKey", + "in": "path", + "description": "The integration key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The integration key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IntegrationDeliveryConfigurationPost" + }, + "example": { + "config": { + "optional": "example value for optional formVariables property for sample-integration", + "required": "example value for required formVariables property for sample-integration" + }, + "name": "Sample integration", + "on": false, + "tags": [ + "example-tag" + ] + } + } + }, + "required": true + }, + "operationId": "createIntegrationDeliveryConfiguration" + } + }, + "/api/v2/integration-capabilities/featureStore/{projectKey}/{environmentKey}/{integrationKey}/{id}": { + "get": { + "responses": { + "200": { + "description": "Integration delivery configuration response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IntegrationDeliveryConfiguration" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Integration delivery configurations (beta)" + ], + "summary": "Get delivery configuration by ID", + "description": "Get delivery configuration by ID.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "integrationKey", + "in": "path", + "description": "The integration key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The integration key" + } + }, + { + "name": "id", + "in": "path", + "description": "The configuration ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The configuration ID" + } + } + ], + "operationId": "getIntegrationDeliveryConfigurationById" + }, + "patch": { + "responses": { + "200": { + "description": "Integration delivery configuration response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IntegrationDeliveryConfiguration" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "422": { + "description": "Invalid patch content", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchFailedErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Integration delivery configurations (beta)" + ], + "summary": "Update delivery configuration", + "description": "Update an integration delivery configuration. Updating an integration delivery configuration uses a [JSON patch](https://datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes. To learn more, read [Updates](/#section/Overview/Updates).", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "integrationKey", + "in": "path", + "description": "The integration key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The integration key" + } + }, + { + "name": "id", + "in": "path", + "description": "The configuration ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The configuration ID" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JSONPatch" + }, + "example": [ + { + "op": "replace", + "path": "/on", + "value": true + } + ] + } + }, + "required": true + }, + "operationId": "patchIntegrationDeliveryConfiguration" + }, + "delete": { + "responses": { + "204": { + "description": "Action succeeded" + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Integration delivery configurations (beta)" + ], + "summary": "Delete delivery configuration", + "description": "Delete a delivery configuration.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "integrationKey", + "in": "path", + "description": "The integration key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The integration key" + } + }, + { + "name": "id", + "in": "path", + "description": "The configuration ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The configuration ID" + } + } + ], + "operationId": "deleteIntegrationDeliveryConfiguration" + } + }, + "/api/v2/integration-capabilities/featureStore/{projectKey}/{environmentKey}/{integrationKey}/{id}/validate": { + "post": { + "responses": { + "200": { + "description": "Integration delivery configuration validation response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IntegrationDeliveryConfigurationResponse" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Integration delivery configurations (beta)" + ], + "summary": "Validate delivery configuration", + "description": "Validate the saved delivery configuration, using the `validationRequest` in the integration's `manifest.json` file.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "integrationKey", + "in": "path", + "description": "The integration key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The integration key" + } + }, + { + "name": "id", + "in": "path", + "description": "The configuration ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The configuration ID" + } + } + ], + "operationId": "validateIntegrationDeliveryConfiguration" + } + }, + "/api/v2/integrations/{integrationKey}": { + "get": { + "responses": { + "200": { + "description": "Integrations collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Integrations" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Integration audit log subscriptions" + ], + "summary": "Get audit log subscriptions by integration", + "description": "Get all audit log subscriptions associated with a given integration.", + "parameters": [ + { + "name": "integrationKey", + "in": "path", + "description": "The integration key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The integration key" + } + } + ], + "operationId": "getSubscriptions" + }, + "post": { + "responses": { + "201": { + "description": "Integration response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Integration" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Integration audit log subscriptions" + ], + "summary": "Create audit log subscription", + "description": "Create an audit log subscription.

For each subscription, you must specify the set of resources you wish to subscribe to audit log notifications for. You can describe these resources using a custom role policy. To learn more, read [Custom role concepts](https://docs.launchdarkly.com/home/members/role-concepts).", + "parameters": [ + { + "name": "integrationKey", + "in": "path", + "description": "The integration key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The integration key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/subscriptionPost" + }, + "example": { + "config": { + "optional": "an optional property", + "required": "the required property", + "url": "https://example.com" + }, + "name": "Example audit log subscription.", + "on": false, + "statements": [ + { + "actions": [ + "*" + ], + "effect": "allow", + "resources": [ + "proj/*:env/*:flag/*;testing-tag" + ] + } + ], + "tags": [ + "testing-tag" + ] + } + } + }, + "required": true + }, + "operationId": "createSubscription" + } + }, + "/api/v2/integrations/{integrationKey}/{id}": { + "get": { + "responses": { + "200": { + "description": "Integration response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Integration" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Integration audit log subscriptions" + ], + "summary": "Get audit log subscription by ID", + "description": "Get an audit log subscription by ID.", + "parameters": [ + { + "name": "integrationKey", + "in": "path", + "description": "The integration key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The integration key" + } + }, + { + "name": "id", + "in": "path", + "description": "The subscription ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The subscription ID" + } + } + ], + "operationId": "getSubscriptionByID" + }, + "patch": { + "responses": { + "200": { + "description": "Integration response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Integration" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Integration audit log subscriptions" + ], + "summary": "Update audit log subscription", + "description": "Update an audit log subscription configuration. Updating an audit log subscription uses a [JSON patch](https://datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes. To learn more, read [Updates](/#section/Overview/Updates).", + "parameters": [ + { + "name": "integrationKey", + "in": "path", + "description": "The integration key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The integration key" + } + }, + { + "name": "id", + "in": "path", + "description": "The ID of the audit log subscription", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The ID of the audit log subscription" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JSONPatch" + }, + "example": [ + { + "op": "replace", + "path": "/on", + "value": false + } + ] + } + }, + "required": true + }, + "operationId": "updateSubscription" + }, + "delete": { + "responses": { + "204": { + "description": "Action succeeded" + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Integration audit log subscriptions" + ], + "summary": "Delete audit log subscription", + "description": "Delete an audit log subscription.", + "parameters": [ + { + "name": "integrationKey", + "in": "path", + "description": "The integration key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The integration key" + } + }, + { + "name": "id", + "in": "path", + "description": "The subscription ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The subscription ID" + } + } + ], + "operationId": "deleteSubscription" + } + }, + "/api/v2/members": { + "get": { + "responses": { + "200": { + "description": "Members collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Members" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Account members" + ], + "summary": "List account members", + "description": "Return a list of account members.\n\nBy default, this returns the first 20 members. Page through this list with the `limit` parameter and by following the `first`, `prev`, `next`, and `last` links in the returned `_links` field. These links are not present if the pages they refer to don't exist. For example, the `first` and `prev` links will be missing from the response on the first page.\n\n### Filtering members\n\nLaunchDarkly supports the following fields for filters:\n\n- `query` is a string that matches against the members' emails and names. It is not case sensitive.\n- `role` is a `|` separated list of roles and custom roles. It filters the list to members who have any of the roles in the list. For the purposes of this filtering, `Owner` counts as `Admin`.\n- `team` is a string that matches against the key of the teams the members belong to. It is not case sensitive.\n- `noteam` is a boolean that filters the list of members who are not on a team if true and members on a team if false.\n- `lastSeen` is a JSON object in one of the following formats:\n - `{\"never\": true}` - Members that have never been active, such as those who have not accepted their invitation to LaunchDarkly, or have not logged in after being provisioned via SCIM.\n - `{\"noData\": true}` - Members that have not been active since LaunchDarkly began recording last seen timestamps.\n - `{\"before\": 1608672063611}` - Members that have not been active since the provided value, which should be a timestamp in Unix epoch milliseconds.\n- `accessCheck` is a string that represents a specific action on a specific resource and is in the format `:`. It filters the list to members who have the ability to perform that action on that resource. Note: `accessCheck` is only supported in API version `20220603` and earlier. To learn more, read [Versioning](https://apidocs.launchdarkly.com/#section/Overview/Versioning).\n - For example, the filter `accessCheck:createApprovalRequest:proj/default:env/test:flag/alternate-page` matches members with the ability to create an approval request for the `alternate-page` flag in the `test` environment of the `default` project.\n - Wildcard and tag filters are not supported when filtering for access.\n\nFor example, the filter `query:abc,role:admin|customrole` matches members with the string `abc` in their email or name, ignoring case, who also are either an `Owner` or `Admin` or have the custom role `customrole`.\n\n### Sorting members\n\nLaunchDarkly supports two fields for sorting: `displayName` and `lastSeen`:\n\n- `displayName` sorts by first + last name, using the member's email if no name is set.\n- `lastSeen` sorts by the `_lastSeen` property. LaunchDarkly considers members that have never been seen or have no data the oldest.\n", + "parameters": [ + { + "name": "limit", + "in": "query", + "description": "The number of members to return in the response. Defaults to 20.", + "schema": { + "type": "integer", + "format": "int64", + "description": "The number of members to return in the response. Defaults to 20." + } + }, + { + "name": "offset", + "in": "query", + "description": "Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.", + "schema": { + "type": "integer", + "format": "int64", + "description": "Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`." + } + }, + { + "name": "filter", + "in": "query", + "description": "A comma-separated list of filters. Each filter is of the form `field:value`. Supported fields are explained above.", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of filters. Each filter is of the form `field:value`. Supported fields are explained above." + } + }, + { + "name": "sort", + "in": "query", + "description": "A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order.", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order." + } + } + ], + "operationId": "getMembers" + }, + "post": { + "responses": { + "201": { + "description": "Member collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Members" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Account members" + ], + "summary": "Invite new members", + "description": "Invite one or more new members to join an account. Each member is sent an invitation. Members with \"admin\" or \"owner\" roles may create new members, as well as anyone with a \"createMember\" permission for \"member/\\*\". If a member cannot be invited, the entire request is rejected and no members are invited from that request.\n\nEach member _must_ have an `email` field and either a `role` or a `customRoles` field. If any of the fields are not populated correctly, the request is rejected with the reason specified in the \"message\" field of the response.\n\nRequests to create account members will not work if SCIM is enabled for the account.\n\n_No more than 50 members may be created per request._\n\nA request may also fail because of conflicts with existing members. These conflicts are reported using the additional `code` and `invalid_emails` response fields with the following possible values for `code`:\n\n- **email_already_exists_in_account**: A member with this email address already exists in this account.\n- **email_taken_in_different_account**: A member with this email address exists in another account.\n- **duplicate_email**s: This request contains two or more members with the same email address.\n\nA request that fails for one of the above reasons returns an HTTP response code of 400 (Bad Request).\n", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NewMemberFormListPost" + } + } + }, + "required": true + }, + "operationId": "postMembers" + }, + "patch": { + "responses": { + "200": { + "description": "Members response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkEditMembersRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Account members (beta)" + ], + "summary": "Modify account members", + "description": "> ### Full use of this API resource is an Enterprise feature\n>\n> The ability to perform a partial update to multiple members is available to customers on an Enterprise plan. If you are on a Pro plan, you can update members individually. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\nPerform a partial update to multiple members. Updating members uses the semantic patch format.\n\nTo make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch).\n\n### Instructions\n\nSemantic patch requests support the following `kind` instructions for updating members.\n\n
\nClick to expand instructions for updating members\n\n#### replaceMembersRoles\n\nReplaces the roles of the specified members. This also removes all custom roles assigned to the specified members.\n\n##### Parameters\n\n- `value`: The new role. Must be a valid built-in role. To learn more about built-in roles, read [LaunchDarkly's built-in roles](https://docs.launchdarkly.com/home/members/built-in-roles).\n- `memberIDs`: List of member IDs.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"replaceMemberRoles\",\n \"value\": \"reader\",\n \"memberIDs\": [\n \"1234a56b7c89d012345e678f\",\n \"507f1f77bcf86cd799439011\"\n ]\n }]\n}\n```\n\n#### replaceAllMembersRoles\n\nReplaces the roles of all members. This also removes all custom roles assigned to the specified members.\n\nMembers that match any of the filters are **excluded** from the update.\n\n##### Parameters\n\n- `value`: The new role. Must be a valid built-in role. To learn more about built-in roles, read [LaunchDarkly's built-in roles](https://docs.launchdarkly.com/home/members/built-in-roles).\n- `filterLastSeen`: (Optional) A JSON object with one of the following formats:\n - `{\"never\": true}` - Members that have never been active, such as those who have not accepted their invitation to LaunchDarkly, or have not logged in after being provisioned via SCIM.\n - `{\"noData\": true}` - Members that have not been active since LaunchDarkly began recording last seen timestamps.\n - `{\"before\": 1608672063611}` - Members that have not been active since the provided value, which should be a timestamp in Unix epoch milliseconds.\n- `filterQuery`: (Optional) A string that matches against the members' emails and names. It is not case sensitive.\n- `filterRoles`: (Optional) A `|` separated list of roles and custom roles. For the purposes of this filtering, `Owner` counts as `Admin`.\n- `filterTeamKey`: (Optional) A string that matches against the key of the team the members belong to. It is not case sensitive.\n- `ignoredMemberIDs`: (Optional) A list of member IDs.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"replaceAllMembersRoles\",\n \"value\": \"reader\",\n \"filterLastSeen\": { \"never\": true }\n }]\n}\n```\n\n#### replaceMembersCustomRoles\n\nReplaces the custom roles of the specified members.\n\n##### Parameters\n\n- `values`: List of new custom roles. Must be a valid custom role key or ID.\n- `memberIDs`: List of member IDs.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"replaceMembersCustomRoles\",\n \"values\": [ \"example-custom-role\" ],\n \"memberIDs\": [\n \"1234a56b7c89d012345e678f\",\n \"507f1f77bcf86cd799439011\"\n ]\n }]\n}\n```\n\n#### replaceAllMembersCustomRoles\n\nReplaces the custom roles of all members. Members that match any of the filters are **excluded** from the update.\n\n##### Parameters\n\n- `values`: List of new roles. Must be a valid custom role key or ID.\n- `filterLastSeen`: (Optional) A JSON object with one of the following formats:\n - `{\"never\": true}` - Members that have never been active, such as those who have not accepted their invitation to LaunchDarkly, or have not logged in after being provisioned via SCIM.\n - `{\"noData\": true}` - Members that have not been active since LaunchDarkly began recording last seen timestamps.\n - `{\"before\": 1608672063611}` - Members that have not been active since the provided value, which should be a timestamp in Unix epoch milliseconds.\n- `filterQuery`: (Optional) A string that matches against the members' emails and names. It is not case sensitive.\n- `filterRoles`: (Optional) A `|` separated list of roles and custom roles. For the purposes of this filtering, `Owner` counts as `Admin`.\n- `filterTeamKey`: (Optional) A string that matches against the key of the team the members belong to. It is not case sensitive.\n- `ignoredMemberIDs`: (Optional) A list of member IDs.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"replaceAllMembersCustomRoles\",\n \"values\": [ \"example-custom-role\" ],\n \"filterLastSeen\": { \"never\": true }\n }]\n}\n```\n\n
\n", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/membersPatchInput" + }, + "example": { + "comment": "Optional comment about the update", + "instructions": [ + { + "kind": "replaceMembersRoles", + "memberIDs": [ + "1234a56b7c89d012345e678f", + "507f1f77bcf86cd799439011" + ], + "value": "reader" + } + ] + } + } + }, + "required": true + }, + "operationId": "patchMembers" + } + }, + "/api/v2/members/{id}": { + "get": { + "responses": { + "200": { + "description": "Member response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Member" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Account members" + ], + "summary": "Get account member", + "description": "Get a single account member by member ID.\n\n`me` is a reserved value for the `id` parameter that returns the caller's member information.\n", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The member ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The member ID" + } + } + ], + "operationId": "getMember" + }, + "patch": { + "responses": { + "200": { + "description": "Member response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Member" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Account members" + ], + "summary": "Modify an account member", + "description": "\nUpdate a single account member. Updating a member uses a [JSON patch](https://datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes. To learn more, read [Updates](/#section/Overview/Updates).\n\nTo update fields in the account member object that are arrays, set the `path` to the name of the field and then append `/`. Use `/0` to add to the beginning of the array. Use `/-` to add to the end of the array. For example, to add a new custom role to a member, use the following request body:\n\n```\n [\n {\n \"op\": \"add\",\n \"path\": \"/customRoles/0\",\n \"value\": \"some-role-id\"\n }\n ]\n```\n\nYou can update only an account member's role or custom role using a JSON patch. Members can update their own names and email addresses though the LaunchDarkly UI.\n\nWhen SAML SSO or SCIM is enabled for the account, account members are managed in the Identity Provider (IdP). Requests to update account members will succeed, but the IdP will override the update shortly afterwards.\n", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The member ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The member ID" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JSONPatch" + }, + "example": [ + { + "op": "add", + "path": "/role", + "value": "writer" + } + ] + } + }, + "required": true + }, + "operationId": "patchMember" + }, + "delete": { + "responses": { + "204": { + "description": "Action succeeded" + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Account members" + ], + "summary": "Delete account member", + "description": "Delete a single account member by ID. Requests to delete account members will not work if SCIM is enabled for the account.", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The member ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The member ID" + } + } + ], + "operationId": "deleteMember" + } + }, + "/api/v2/members/{id}/teams": { + "post": { + "responses": { + "201": { + "description": "Member response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Member" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Member not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Account members" + ], + "summary": "Add a member to teams", + "description": "Add one member to one or more teams.", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The member ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The member ID" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MemberTeamsPostInput" + } + } + }, + "required": true + }, + "operationId": "postMemberTeams" + } + }, + "/api/v2/metrics/{projectKey}": { + "get": { + "responses": { + "200": { + "description": "Metrics collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetricCollectionRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + } + }, + "tags": [ + "Metrics" + ], + "summary": "List metrics", + "description": "Get a list of all metrics for the specified project.\n\n### Expanding the metric list response\nLaunchDarkly supports expanding the \"List metrics\" response. By default, the expandable field is **not** included in the response.\n\nTo expand the response, append the `expand` query parameter and add the following supported field:\n\n- `experimentCount` includes the number of experiments from the specific project that use the metric\n\nFor example, `expand=experimentCount` includes the `experimentCount` field for each metric in the response.\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "expand", + "in": "query", + "description": "A comma-separated list of properties that can reveal additional information in the response.", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of properties that can reveal additional information in the response." + } + } + ], + "operationId": "getMetrics" + }, + "post": { + "responses": { + "201": { + "description": "Metric response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetricRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Metrics" + ], + "summary": "Create metric", + "description": "Create a new metric in the specified project. The expected `POST` body differs depending on the specified `kind` property.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetricPost" + }, + "example": { + "eventKey": "trackedClick", + "isActive": true, + "isNumeric": false, + "key": "metric-key-123abc", + "kind": "custom" + } + } + }, + "required": true + }, + "operationId": "postMetric" + } + }, + "/api/v2/metrics/{projectKey}/{metricKey}": { + "get": { + "responses": { + "200": { + "description": "Metric response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetricRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Metrics" + ], + "summary": "Get metric", + "description": "Get information for a single metric from the specific project.\n\n### Expanding the metric response\nLaunchDarkly supports four fields for expanding the \"Get metric\" response. By default, these fields are **not** included in the response.\n\nTo expand the response, append the `expand` query parameter and add a comma-separated list with any of the following fields:\n\n- `experiments` includes all experiments from the specific project that use the metric\n- `experimentCount` includes the number of experiments from the specific project that use the metric\n- `metricGroups` includes all metric groups from the specific project that use the metric\n- `metricGroupCount` includes the number of metric groups from the specific project that use the metric\n\nFor example, `expand=experiments` includes the `experiments` field in the response.\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "metricKey", + "in": "path", + "description": "The metric key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The metric key" + } + }, + { + "name": "expand", + "in": "query", + "description": "A comma-separated list of properties that can reveal additional information in the response.", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of properties that can reveal additional information in the response." + } + }, + { + "name": "versionId", + "in": "query", + "description": "The specific version ID of the metric", + "schema": { + "type": "string", + "format": "string", + "description": "The specific version ID of the metric" + } + } + ], + "operationId": "getMetric" + }, + "patch": { + "responses": { + "200": { + "description": "Metric response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetricRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Metrics" + ], + "summary": "Update metric", + "description": "Patch a metric by key. Updating a metric uses a [JSON patch](https://datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes. To learn more, read [Updates](/#section/Overview/Updates).", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "metricKey", + "in": "path", + "description": "The metric key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The metric key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JSONPatch" + }, + "example": [ + { + "op": "replace", + "path": "/name", + "value": "my-updated-metric" + } + ] + } + }, + "required": true + }, + "operationId": "patchMetric" + }, + "delete": { + "responses": { + "204": { + "description": "Action succeeded" + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Metrics" + ], + "summary": "Delete metric", + "description": "Delete a metric by key.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "metricKey", + "in": "path", + "description": "The metric key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The metric key" + } + } + ], + "operationId": "deleteMetric" + } + }, + "/api/v2/oauth/clients": { + "get": { + "responses": { + "200": { + "description": "OAuth 2.0 client collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClientCollection" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + } + }, + "tags": [ + "OAuth2 Clients" + ], + "summary": "Get clients", + "description": "Get all OAuth 2.0 clients registered by your account.", + "operationId": "getOAuthClients" + }, + "post": { + "responses": { + "201": { + "description": "OAuth 2.0 client response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Client" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + } + }, + "tags": [ + "OAuth2 Clients" + ], + "summary": "Create a LaunchDarkly OAuth 2.0 client", + "description": "Create (register) a LaunchDarkly OAuth2 client. OAuth2 clients allow you to build custom integrations using LaunchDarkly as your identity provider.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/oauthClientPost" + } + } + }, + "required": true + }, + "operationId": "createOAuth2Client" + } + }, + "/api/v2/oauth/clients/{clientId}": { + "get": { + "responses": { + "200": { + "description": "OAuth 2.0 client response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Client" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + } + }, + "tags": [ + "OAuth2 Clients" + ], + "summary": "Get client by ID", + "description": "Get a registered OAuth 2.0 client by unique client ID.", + "parameters": [ + { + "name": "clientId", + "in": "path", + "description": "The client ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The client ID" + } + } + ], + "operationId": "getOAuthClientById" + }, + "patch": { + "responses": { + "200": { + "description": "OAuth 2.0 client response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Client" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + } + }, + "tags": [ + "OAuth2 Clients" + ], + "summary": "Patch client by ID", + "description": "Patch an existing OAuth 2.0 client by client ID. Updating an OAuth2 client uses a [JSON patch](https://datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes. To learn more, read [Updates](/#section/Overview/Updates). Only `name`, `description`, and `redirectUri` may be patched.", + "parameters": [ + { + "name": "clientId", + "in": "path", + "description": "The client ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The client ID" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JSONPatch" + }, + "example": [ + { + "op": "replace", + "path": "/name", + "value": "Example Client V2" + } + ] + } + }, + "required": true + }, + "operationId": "patchOAuthClient" + }, + "delete": { + "responses": { + "204": { + "description": "Action succeeded" + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + } + }, + "tags": [ + "OAuth2 Clients" + ], + "summary": "Delete OAuth 2.0 client", + "description": "Delete an existing OAuth 2.0 client by unique client ID.", + "parameters": [ + { + "name": "clientId", + "in": "path", + "description": "The client ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The client ID" + } + } + ], + "operationId": "deleteOAuthClient" + } + }, + "/api/v2/openapi.json": { + "get": { + "responses": { + "200": { + "description": "OpenAPI Spec" + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Other" + ], + "summary": "Gets the OpenAPI spec in json", + "description": "Get the latest version of the OpenAPI specification for LaunchDarkly's API in JSON format. In the sandbox, click 'Try it' and enter any string in the 'Authorization' field to test this endpoint.", + "operationId": "getOpenapiSpec" + } + }, + "/api/v2/projects": { + "get": { + "responses": { + "200": { + "description": "Project collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Projects" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Projects" + ], + "summary": "List projects", + "description": "Return a list of projects.\n\nBy default, this returns the first 20 projects. Page through this list with the `limit` parameter and by following the `first`, `prev`, `next`, and `last` links in the `_links` field that returns. If those links do not appear, the pages they refer to don't exist. For example, the `first` and `prev` links will be missing from the response on the first page, because there is no previous page and you cannot return to the first page when you are already on the first page.\n\n### Filtering projects\n\nLaunchDarkly supports two fields for filters:\n- `query` is a string that matches against the projects' names and keys. It is not case sensitive.\n- `tags` is a `+`-separated list of project tags. It filters the list of projects that have all of the tags in the list.\n\nFor example, the filter `filter=query:abc,tags:tag-1+tag-2` matches projects with the string `abc` in their name or key and also are tagged with `tag-1` and `tag-2`. The filter is not case-sensitive.\n\nThe documented values for `filter` query parameters are prior to URL encoding. For example, the `+` in `filter=tags:tag-1+tag-2` must be encoded to `%2B`.\n\n### Sorting projects\n\nLaunchDarkly supports two fields for sorting:\n- `name` sorts by project name.\n- `createdOn` sorts by the creation date of the project.\n\nFor example, `sort=name` sorts the response by project name in ascending order.\n\n### Expanding the projects response\n\nLaunchDarkly supports one field for expanding the \"List projects\" response. By default, these fields are **not** included in the response.\n\nTo expand the response, append the `expand` query parameter and add a comma-separated list with the `environments` field.\n\n`Environments` includes a paginated list of the project environments.\n* `environments` includes a paginated list of the project environments.\n\nFor example, `expand=environments` includes the `environments` field for each project in the response.\n", + "parameters": [ + { + "name": "limit", + "in": "query", + "description": "The number of projects to return in the response. Defaults to 20.", + "schema": { + "type": "integer", + "format": "int64", + "description": "The number of projects to return in the response. Defaults to 20." + } + }, + { + "name": "offset", + "in": "query", + "description": "Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and returns the next `limit` items.", + "schema": { + "type": "integer", + "format": "int64", + "description": "Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and returns the next `limit` items." + } + }, + { + "name": "filter", + "in": "query", + "description": "A comma-separated list of filters. Each filter is constructed as `field:value`.", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of filters. Each filter is constructed as `field:value`." + } + }, + { + "name": "sort", + "in": "query", + "description": "A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order.", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order." + } + }, + { + "name": "expand", + "in": "query", + "description": "A comma-separated list of properties that can reveal additional information in the response.", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of properties that can reveal additional information in the response." + } + } + ], + "operationId": "getProjects" + }, + "post": { + "responses": { + "201": { + "description": "Project response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Projects" + ], + "summary": "Create project", + "description": "Create a new project with the given key and name. Project keys must be unique within an account.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectPost" + }, + "example": { + "key": "project-key-123abc", + "name": "My Project" + } + } + }, + "required": true + }, + "operationId": "postProject" + } + }, + "/api/v2/projects/{projectKey}": { + "get": { + "responses": { + "200": { + "description": "Project response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Project" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Projects" + ], + "summary": "Get project", + "description": "Get a single project by key.\n\n### Expanding the project response\n\nLaunchDarkly supports one field for expanding the \"Get project\" response. By default, these fields are **not** included in the response.\n\nTo expand the response, append the `expand` query parameter and add a comma-separated list with any of the following fields:\n* `environments` includes a paginated list of the project environments.\n\nFor example, `expand=environments` includes the `environments` field for the project in the response.\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key.", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key." + } + }, + { + "name": "expand", + "in": "query", + "description": "A comma-separated list of properties that can reveal additional information in the response.", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of properties that can reveal additional information in the response." + } + } + ], + "operationId": "getProject" + }, + "patch": { + "responses": { + "200": { + "description": "Project response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Projects" + ], + "summary": "Update project", + "description": "Update a project. Updating a project uses a [JSON patch](https://datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes. To learn more, read [Updates](/#section/Overview/Updates).

To add an element to the project fields that are arrays, set the `path` to the name of the field and then append `/`. Use `/0` to add to the beginning of the array. Use `/-` to add to the end of the array.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JSONPatch" + }, + "example": [ + { + "op": "add", + "path": "/tags/0", + "value": "another-tag" + } + ] + } + }, + "required": true + }, + "operationId": "patchProject" + }, + "delete": { + "responses": { + "204": { + "description": "Action succeeded" + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Projects" + ], + "summary": "Delete project", + "description": "Delete a project by key. Use this endpoint with caution. Deleting a project will delete all associated environments and feature flags. You cannot delete the last project in an account.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + } + ], + "operationId": "deleteProject" + } + }, + "/api/v2/projects/{projectKey}/context-kinds": { + "get": { + "responses": { + "200": { + "description": "Context kinds collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContextKindsCollectionRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + } + }, + "tags": [ + "Contexts" + ], + "summary": "Get context kinds", + "description": "Get all context kinds for a given project.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + } + ], + "operationId": "getContextKindsByProjectKey" + } + }, + "/api/v2/projects/{projectKey}/context-kinds/{key}": { + "put": { + "responses": { + "200": { + "description": "Context kind upsert response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpsertResponseRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + } + }, + "tags": [ + "Contexts" + ], + "summary": "Create or update context kind", + "description": "Create or update a context kind by key. Only the included fields will be updated.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "key", + "in": "path", + "description": "The context kind key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The context kind key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpsertContextKindPayload" + } + } + }, + "required": true + }, + "operationId": "putContextKind" + } + }, + "/api/v2/projects/{projectKey}/environments": { + "get": { + "responses": { + "200": { + "description": "Environments collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Environments" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "405": { + "description": "Method not allowed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MethodNotAllowedErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Environments" + ], + "summary": "List environments", + "description": "Return a list of environments for the specified project.\n\nBy default, this returns the first 20 environments. Page through this list with the `limit` parameter and by following the `first`, `prev`, `next`, and `last` links in the `_links` field that returns. If those links do not appear, the pages they refer to don't exist. For example, the `first` and `prev` links will be missing from the response on the first page, because there is no previous page and you cannot return to the first page when you are already on the first page.\n\n### Filtering environments\n\nLaunchDarkly supports two fields for filters:\n- `query` is a string that matches against the environments' names and keys. It is not case sensitive.\n- `tags` is a `+`-separated list of environment tags. It filters the list of environments that have all of the tags in the list.\n\nFor example, the filter `filter=query:abc,tags:tag-1+tag-2` matches environments with the string `abc` in their name or key and also are tagged with `tag-1` and `tag-2`. The filter is not case-sensitive.\n\nThe documented values for `filter` query parameters are prior to URL encoding. For example, the `+` in `filter=tags:tag-1+tag-2` must be encoded to `%2B`.\n\n### Sorting environments\n\nLaunchDarkly supports the following fields for sorting:\n\n- `createdOn` sorts by the creation date of the environment.\n- `critical` sorts by whether the environments are marked as critical.\n- `name` sorts by environment name.\n\nFor example, `sort=name` sorts the response by environment name in ascending order.\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "limit", + "in": "query", + "description": "The number of environments to return in the response. Defaults to 20.", + "schema": { + "type": "integer", + "format": "int64", + "description": "The number of environments to return in the response. Defaults to 20." + } + }, + { + "name": "offset", + "in": "query", + "description": "Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.", + "schema": { + "type": "integer", + "format": "int64", + "description": "Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`." + } + }, + { + "name": "filter", + "in": "query", + "description": "A comma-separated list of filters. Each filter is of the form `field:value`.", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of filters. Each filter is of the form `field:value`." + } + }, + { + "name": "sort", + "in": "query", + "description": "A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order.", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order." + } + } + ], + "operationId": "getEnvironmentsByProject" + }, + "post": { + "responses": { + "201": { + "description": "Environment response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Environment" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Environments" + ], + "summary": "Create environment", + "description": "> ### Approval settings\n>\n> The `approvalSettings` key is only returned when the Flag Approvals feature is enabled.\n>\n> You cannot update approval settings when creating new environments. Update approval settings with the PATCH Environment API.\n\nCreate a new environment in a specified project with a given name, key, swatch color, and default TTL.\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EnvironmentPost" + }, + "example": { + "color": "DADBEE", + "key": "environment-key-123abc", + "name": "My Environment" + } + } + }, + "required": true + }, + "operationId": "postEnvironment" + } + }, + "/api/v2/projects/{projectKey}/environments/{environmentKey}": { + "get": { + "responses": { + "200": { + "description": "Environment response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Environment" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Environments" + ], + "summary": "Get environment", + "description": "> ### Approval settings\n>\n> The `approvalSettings` key is only returned when the Flag Approvals feature is enabled.\n\nGet an environment given a project and key.\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + } + ], + "operationId": "getEnvironment" + }, + "patch": { + "responses": { + "200": { + "description": "Environment response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Environment" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Environments" + ], + "summary": "Update environment", + "description": "\nUpdate an environment. Updating an environment uses a [JSON patch](https://datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes. To learn more, read [Updates](/#section/Overview/Updates).\n\nTo update fields in the environment object that are arrays, set the `path` to the name of the field and then append `/`. Using `/0` appends to the beginning of the array.\n\n### Approval settings\n\nThis request only returns the `approvalSettings` key if the [Flag Approvals](https://docs.launchdarkly.com/home/feature-workflows/approvals) feature is enabled.\n\nOnly the `canReviewOwnRequest`, `canApplyDeclinedChanges`, `minNumApprovals`, `required` and `requiredApprovalTagsfields` are editable.\n\nIf you try to patch the environment by setting both `required` and `requiredApprovalTags`, the request fails and an error appears. You can specify either required approvals for all flags in an environment or those with specific tags, but not both.\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JSONPatch" + }, + "example": [ + { + "op": "replace", + "path": "/requireComments", + "value": true + } + ] + } + }, + "required": true + }, + "operationId": "patchEnvironment" + }, + "delete": { + "responses": { + "204": { + "description": "Action succeeded" + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Environments" + ], + "summary": "Delete environment", + "description": "Delete a environment by key.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + } + ], + "operationId": "deleteEnvironment" + } + }, + "/api/v2/projects/{projectKey}/environments/{environmentKey}/apiKey": { + "post": { + "responses": { + "200": { + "description": "Environment response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Environment" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Environments" + ], + "summary": "Reset environment SDK key", + "description": "Reset an environment's SDK key with an optional expiry time for the old key.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "expiry", + "in": "query", + "description": "The time at which you want the old SDK key to expire, in UNIX milliseconds. By default, the key expires immediately. During the period between this call and the time when the old SDK key expires, both the old SDK key and the new SDK key will work.", + "schema": { + "type": "integer", + "format": "int64", + "description": "The time at which you want the old SDK key to expire, in UNIX milliseconds. By default, the key expires immediately. During the period between this call and the time when the old SDK key expires, both the old SDK key and the new SDK key will work." + } + } + ], + "operationId": "resetEnvironmentSDKKey" + } + }, + "/api/v2/projects/{projectKey}/environments/{environmentKey}/context-attributes": { + "get": { + "responses": { + "200": { + "description": "Context attribute names collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContextAttributeNamesCollection" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Contexts" + ], + "summary": "Get context attribute names", + "description": "Get context attribute names. Returns only the first 100 attribute names per context.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "filter", + "in": "query", + "description": "A comma-separated list of context filters. This endpoint only accepts `kind` filters, with the `equals` operator, and `name` filters, with the `startsWith` operator. To learn more about the filter syntax, read [Filtering contexts and context instances](/tag/Contexts#filtering-contexts-and-context-instances).", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of context filters. This endpoint only accepts `kind` filters, with the `equals` operator, and `name` filters, with the `startsWith` operator. To learn more about the filter syntax, read [Filtering contexts and context instances](/tag/Contexts#filtering-contexts-and-context-instances)." + } + } + ], + "operationId": "getContextAttributeNames" + } + }, + "/api/v2/projects/{projectKey}/environments/{environmentKey}/context-attributes/{attributeName}": { + "get": { + "responses": { + "200": { + "description": "Context attribute values collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContextAttributeValuesCollection" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Contexts" + ], + "summary": "Get context attribute values", + "description": "Get context attribute values.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "attributeName", + "in": "path", + "description": "The attribute name", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The attribute name" + } + }, + { + "name": "filter", + "in": "query", + "description": "A comma-separated list of context filters. This endpoint only accepts `kind` filters, with the `equals` operator, and `value` filters, with the `startsWith` operator. To learn more about the filter syntax, read [Filtering contexts and context instances](/tag/Contexts#filtering-contexts-and-context-instances).", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of context filters. This endpoint only accepts `kind` filters, with the `equals` operator, and `value` filters, with the `startsWith` operator. To learn more about the filter syntax, read [Filtering contexts and context instances](/tag/Contexts#filtering-contexts-and-context-instances)." + } + } + ], + "operationId": "getContextAttributeValues" + } + }, + "/api/v2/projects/{projectKey}/environments/{environmentKey}/context-instances/search": { + "post": { + "responses": { + "200": { + "description": "Context instances collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContextInstances" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Contexts" + ], + "summary": "Search for context instances", + "description": "\nSearch for context instances.\n\nYou can use either the query parameters or the request body parameters. If both are provided, there is an error.\n\nTo learn more about the filter syntax, read [Filtering contexts and context instances](/tag/Contexts#filtering-contexts-and-context-instances). To learn more about context instances, read [Understanding context instances](https://docs.launchdarkly.com/home/contexts#understanding-context-instances).\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "limit", + "in": "query", + "description": "Specifies the maximum number of items in the collection to return (max: 50, default: 20)", + "schema": { + "type": "integer", + "format": "int64", + "description": "Specifies the maximum number of items in the collection to return (max: 50, default: 20)" + } + }, + { + "name": "continuationToken", + "in": "query", + "description": "Limits results to context instances with sort values after the value specified. You can use this for pagination, however, we recommend using the `next` link we provide instead.", + "schema": { + "type": "string", + "format": "string", + "description": "Limits results to context instances with sort values after the value specified. You can use this for pagination, however, we recommend using the `next` link we provide instead." + } + }, + { + "name": "sort", + "in": "query", + "description": "Specifies a field by which to sort. LaunchDarkly supports sorting by timestamp in ascending order by specifying `ts` for this value, or descending order by specifying `-ts`.", + "schema": { + "type": "string", + "format": "string", + "description": "Specifies a field by which to sort. LaunchDarkly supports sorting by timestamp in ascending order by specifying `ts` for this value, or descending order by specifying `-ts`." + } + }, + { + "name": "filter", + "in": "query", + "description": "A comma-separated list of context filters. This endpoint only accepts an `applicationId` filter. To learn more about the filter syntax, read [Filtering contexts and context instances](/tag/Contexts#filtering-contexts-and-context-instances).", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of context filters. This endpoint only accepts an `applicationId` filter. To learn more about the filter syntax, read [Filtering contexts and context instances](/tag/Contexts#filtering-contexts-and-context-instances)." + } + }, + { + "name": "includeTotalCount", + "in": "query", + "description": "Specifies whether to include or omit the total count of matching context instances. Defaults to true.", + "schema": { + "type": "boolean", + "description": "Specifies whether to include or omit the total count of matching context instances. Defaults to true." + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContextInstanceSearch" + } + } + }, + "required": true + }, + "operationId": "searchContextInstances" + } + }, + "/api/v2/projects/{projectKey}/environments/{environmentKey}/context-instances/{id}": { + "get": { + "responses": { + "200": { + "description": "Context instances collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContextInstances" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Contexts" + ], + "summary": "Get context instances", + "description": "Get context instances by ID.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "id", + "in": "path", + "description": "The context instance ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The context instance ID" + } + }, + { + "name": "limit", + "in": "query", + "description": "Specifies the maximum number of context instances to return (max: 50, default: 20)", + "schema": { + "type": "integer", + "format": "int64", + "description": "Specifies the maximum number of context instances to return (max: 50, default: 20)" + } + }, + { + "name": "continuationToken", + "in": "query", + "description": "Limits results to context instances with sort values after the value specified. You can use this for pagination, however, we recommend using the `next` link we provide instead.", + "schema": { + "type": "string", + "format": "string", + "description": "Limits results to context instances with sort values after the value specified. You can use this for pagination, however, we recommend using the `next` link we provide instead." + } + }, + { + "name": "sort", + "in": "query", + "description": "Specifies a field by which to sort. LaunchDarkly supports sorting by timestamp in ascending order by specifying `ts` for this value, or descending order by specifying `-ts`.", + "schema": { + "type": "string", + "format": "string", + "description": "Specifies a field by which to sort. LaunchDarkly supports sorting by timestamp in ascending order by specifying `ts` for this value, or descending order by specifying `-ts`." + } + }, + { + "name": "filter", + "in": "query", + "description": "A comma-separated list of context filters. This endpoint only accepts an `applicationId` filter. To learn more about the filter syntax, read [Filtering contexts and context instances](/tag/Contexts#filtering-contexts-and-context-instances).", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of context filters. This endpoint only accepts an `applicationId` filter. To learn more about the filter syntax, read [Filtering contexts and context instances](/tag/Contexts#filtering-contexts-and-context-instances)." + } + }, + { + "name": "includeTotalCount", + "in": "query", + "description": "Specifies whether to include or omit the total count of matching context instances. Defaults to true.", + "schema": { + "type": "boolean", + "description": "Specifies whether to include or omit the total count of matching context instances. Defaults to true." + } + } + ], + "operationId": "getContextInstances" + }, + "delete": { + "responses": { + "204": { + "description": "Action succeeded" + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Contexts" + ], + "summary": "Delete context instances", + "description": "Delete context instances by ID.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "id", + "in": "path", + "description": "The context instance ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The context instance ID" + } + } + ], + "operationId": "deleteContextInstances" + } + }, + "/api/v2/projects/{projectKey}/environments/{environmentKey}/contexts/search": { + "post": { + "responses": { + "200": { + "description": "Contexts collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contexts" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Contexts" + ], + "summary": "Search for contexts", + "description": "\nSearch for contexts.\n\nYou can use either the query parameters or the request body parameters. If both are provided, there is an error.\n\nTo learn more about the filter syntax, read [Filtering contexts and context instances](/tag/Contexts#filtering-contexts-and-context-instances). To learn more about contexts, read [Understanding contexts and context kinds](https://docs.launchdarkly.com/home/contexts#understanding-contexts-and-context-kinds).\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "limit", + "in": "query", + "description": "Specifies the maximum number of items in the collection to return (max: 50, default: 20)", + "schema": { + "type": "integer", + "format": "int64", + "description": "Specifies the maximum number of items in the collection to return (max: 50, default: 20)" + } + }, + { + "name": "continuationToken", + "in": "query", + "description": "Limits results to contexts with sort values after the value specified. You can use this for pagination, however, we recommend using the `next` link we provide instead.", + "schema": { + "type": "string", + "format": "string", + "description": "Limits results to contexts with sort values after the value specified. You can use this for pagination, however, we recommend using the `next` link we provide instead." + } + }, + { + "name": "sort", + "in": "query", + "description": "Specifies a field by which to sort. LaunchDarkly supports sorting by timestamp in ascending order by specifying `ts` for this value, or descending order by specifying `-ts`.", + "schema": { + "type": "string", + "format": "string", + "description": "Specifies a field by which to sort. LaunchDarkly supports sorting by timestamp in ascending order by specifying `ts` for this value, or descending order by specifying `-ts`." + } + }, + { + "name": "filter", + "in": "query", + "description": "A comma-separated list of context filters. To learn more about the filter syntax, read [Filtering contexts and context instances](/tag/Contexts#filtering-contexts-and-context-instances).", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of context filters. To learn more about the filter syntax, read [Filtering contexts and context instances](/tag/Contexts#filtering-contexts-and-context-instances)." + } + }, + { + "name": "includeTotalCount", + "in": "query", + "description": "Specifies whether to include or omit the total count of matching contexts. Defaults to true.", + "schema": { + "type": "boolean", + "description": "Specifies whether to include or omit the total count of matching contexts. Defaults to true." + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContextSearch" + } + } + }, + "required": true + }, + "operationId": "searchContexts" + } + }, + "/api/v2/projects/{projectKey}/environments/{environmentKey}/contexts/{contextKind}/{contextKey}/flags/{featureFlagKey}": { + "put": { + "responses": { + "204": { + "description": "Action succeeded" + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Context settings" + ], + "summary": "Update flag settings for context", + "description": "\nEnable or disable a feature flag for a context based on its context kind and key.\n\nOmitting the `setting` attribute from the request body, or including a `setting` of `null`, erases the current setting for a context.\n\nIf you previously patched the flag, and the patch included the context's data, LaunchDarkly continues to use that data. If LaunchDarkly has never encountered the combination of the context's key and kind before, it calculates the flag values based on the context kind and key.\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "contextKind", + "in": "path", + "description": "The context kind", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The context kind" + } + }, + { + "name": "contextKey", + "in": "path", + "description": "The context key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The context key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValuePut" + } + } + }, + "required": true + }, + "operationId": "putContextFlagSetting" + } + }, + "/api/v2/projects/{projectKey}/environments/{environmentKey}/contexts/{kind}/{key}": { + "get": { + "responses": { + "200": { + "description": "Contexts collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contexts" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Contexts" + ], + "summary": "Get contexts", + "description": "Get contexts based on kind and key.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "kind", + "in": "path", + "description": "The context kind", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The context kind" + } + }, + { + "name": "key", + "in": "path", + "description": "The context key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The context key" + } + }, + { + "name": "limit", + "in": "query", + "description": "Specifies the maximum number of items in the collection to return (max: 50, default: 20)", + "schema": { + "type": "integer", + "format": "int64", + "description": "Specifies the maximum number of items in the collection to return (max: 50, default: 20)" + } + }, + { + "name": "continuationToken", + "in": "query", + "description": "Limits results to contexts with sort values after the value specified. You can use this for pagination, however, we recommend using the `next` link we provide instead.", + "schema": { + "type": "string", + "format": "string", + "description": "Limits results to contexts with sort values after the value specified. You can use this for pagination, however, we recommend using the `next` link we provide instead." + } + }, + { + "name": "sort", + "in": "query", + "description": "Specifies a field by which to sort. LaunchDarkly supports sorting by timestamp in ascending order by specifying `ts` for this value, or descending order by specifying `-ts`.", + "schema": { + "type": "string", + "format": "string", + "description": "Specifies a field by which to sort. LaunchDarkly supports sorting by timestamp in ascending order by specifying `ts` for this value, or descending order by specifying `-ts`." + } + }, + { + "name": "filter", + "in": "query", + "description": "A comma-separated list of context filters. This endpoint only accepts an `applicationId` filter. To learn more about the filter syntax, read [Filtering contexts and context instances](/tag/Contexts#filtering-contexts-and-context-instances).", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of context filters. This endpoint only accepts an `applicationId` filter. To learn more about the filter syntax, read [Filtering contexts and context instances](/tag/Contexts#filtering-contexts-and-context-instances)." + } + }, + { + "name": "includeTotalCount", + "in": "query", + "description": "Specifies whether to include or omit the total count of matching contexts. Defaults to true.", + "schema": { + "type": "boolean", + "description": "Specifies whether to include or omit the total count of matching contexts. Defaults to true." + } + } + ], + "operationId": "getContexts" + } + }, + "/api/v2/projects/{projectKey}/environments/{environmentKey}/experiments": { + "get": { + "responses": { + "200": { + "description": "Experiment collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExperimentCollectionRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "405": { + "description": "Method not allowed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MethodNotAllowedErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Experiments (beta)" + ], + "summary": "Get experiments", + "description": "Get details about all experiments in an environment.\n\n### Filtering experiments\n\nLaunchDarkly supports the `filter` query param for filtering, with the following fields:\n\n- `flagKey` filters for only experiments that use the flag with the given key.\n- `metricKey` filters for only experiments that use the metric with the given key.\n- `status` filters for only experiments with an iteration with the given status. An iteration can have the status `not_started`, `running` or `stopped`.\n\nFor example, `filter=flagKey:my-flag,status:running,metricKey:page-load-ms` filters for experiments for the given flag key and the given metric key which have a currently running iteration.\n\n### Expanding the experiments response\n\nLaunchDarkly supports four fields for expanding the \"Get experiments\" response. By default, these fields are **not** included in the response.\n\nTo expand the response, append the `expand` query parameter and add a comma-separated list with any of the following fields:\n\n- `previousIterations` includes all iterations prior to the current iteration. By default only the current iteration is included in the response.\n- `draftIteration` includes the iteration which has not been started yet, if any.\n- `secondaryMetrics` includes secondary metrics. By default only the primary metric is included in the response.\n- `treatments` includes all treatment and parameter details. By default treatment data is not included in the response.\n\nFor example, `expand=draftIteration,treatments` includes the `draftIteration` and `treatments` fields in the response. If fields that you request with the `expand` query parameter are empty, they are not included in the response.\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "limit", + "in": "query", + "description": "The maximum number of experiments to return. Defaults to 20.", + "schema": { + "type": "integer", + "format": "int64", + "description": "The maximum number of experiments to return. Defaults to 20." + } + }, + { + "name": "offset", + "in": "query", + "description": "Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.", + "schema": { + "type": "integer", + "format": "int64", + "description": "Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`." + } + }, + { + "name": "filter", + "in": "query", + "description": "A comma-separated list of filters. Each filter is of the form `field:value`. Supported fields are explained above.", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of filters. Each filter is of the form `field:value`. Supported fields are explained above." + } + }, + { + "name": "expand", + "in": "query", + "description": "A comma-separated list of properties that can reveal additional information in the response. Supported fields are explained above.", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of properties that can reveal additional information in the response. Supported fields are explained above." + } + }, + { + "name": "lifecycleState", + "in": "query", + "description": "A comma-separated list of experiment archived states. Supports `archived`, `active`, or both. Defaults to `active` experiments.", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of experiment archived states. Supports `archived`, `active`, or both. Defaults to `active` experiments." + } + } + ], + "operationId": "getExperiments" + }, + "post": { + "responses": { + "201": { + "description": "Experiment response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Experiment" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Experiments (beta)" + ], + "summary": "Create experiment", + "description": "Create an experiment.\n\nTo run this experiment, you'll need to [create an iteration](/tag/Experiments-(beta)#operation/createIteration) and then [update the experiment](/tag/Experiments-(beta)#operation/patchExperiment) with the `startIteration` instruction.\n\nTo learn more, read [Creating experiments](https://docs.launchdarkly.com/home/creating-experiments).\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExperimentPost" + } + } + }, + "required": true + }, + "operationId": "createExperiment" + } + }, + "/api/v2/projects/{projectKey}/environments/{environmentKey}/experiments/{experimentKey}": { + "get": { + "responses": { + "200": { + "description": "Experiment response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Experiment" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "405": { + "description": "Method not allowed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MethodNotAllowedErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Experiments (beta)" + ], + "summary": "Get experiment", + "description": "Get details about an experiment.\n\n### Expanding the experiment response\n\nLaunchDarkly supports four fields for expanding the \"Get experiment\" response. By default, these fields are **not** included in the response.\n\nTo expand the response, append the `expand` query parameter and add a comma-separated list with any of the following fields:\n\n- `previousIterations` includes all iterations prior to the current iteration. By default only the current iteration is included in the response.\n- `draftIteration` includes the iteration which has not been started yet, if any.\n- `secondaryMetrics` includes secondary metrics. By default only the primary metric is included in the response.\n- `treatments` includes all treatment and parameter details. By default treatment data is not included in the response.\n\nFor example, `expand=draftIteration,treatments` includes the `draftIteration` and `treatments` fields in the response. If fields that you request with the `expand` query parameter are empty, they are not included in the response.\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "experimentKey", + "in": "path", + "description": "The experiment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The experiment key" + } + }, + { + "name": "expand", + "in": "query", + "description": "A comma-separated list of properties that can reveal additional information in the response. Supported fields are explained above.", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of properties that can reveal additional information in the response. Supported fields are explained above." + } + } + ], + "operationId": "getExperiment" + }, + "patch": { + "responses": { + "200": { + "description": "Experiment response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Experiment" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Experiments (beta)" + ], + "summary": "Patch experiment", + "description": "Update an experiment. Updating an experiment uses the semantic patch format.\n\nTo make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch).\n\n### Instructions\n\nSemantic patch requests support the following `kind` instructions for updating experiments.\n\n#### updateName\n\nUpdates the experiment name.\n\n##### Parameters\n\n- `value`: The new name.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"updateName\",\n \"value\": \"Example updated experiment name\"\n }]\n}\n```\n\n#### updateDescription\n\nUpdates the experiment description.\n\n##### Parameters\n\n- `value`: The new description.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"updateDescription\",\n \"value\": \"Example updated description\"\n }]\n}\n```\n\n#### startIteration\n\nStarts a new iteration for this experiment. You must [create a new iteration](/tag/Experiments-(beta)#operation/createIteration) before calling this instruction.\n\nAn iteration may not be started until it meets the following criteria:\n\n* Its associated flag is toggled on and is not archived\n* Its `randomizationUnit` is set\n* At least one of its `treatments` has a non-zero `allocationPercent`\n\n##### Parameters\n\n- `changeJustification`: The reason for starting a new iteration. Required when you call `startIteration` on an already running experiment, otherwise optional.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"startIteration\",\n \"changeJustification\": \"It's time to start a new iteration\"\n }]\n}\n```\n\n#### stopIteration\n\nStops the current iteration for this experiment.\n\n##### Parameters\n\n- `winningTreatmentId`: The ID of the winning treatment. Treatment IDs are returned as part of the [Get experiment](/tag/Experiments-(beta)#operation/getExperiment) response. They are the `_id` of each element in the `treatments` array.\n- `winningReason`: The reason for the winner\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"stopIteration\",\n \"winningTreatmentId\": \"3a548ec2-72ac-4e59-8518-5c24f5609ccf\",\n \"winningReason\": \"Example reason to stop the iteration\"\n }]\n}\n```\n\n#### archiveExperiment\n\nArchives this experiment. Archived experiments are hidden by default in the LaunchDarkly user interface. You cannot start new iterations for archived experiments.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{ \"kind\": \"archiveExperiment\" }]\n}\n```\n\n#### restoreExperiment\n\nRestores an archived experiment. After restoring an experiment, you can start new iterations for it again.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{ \"kind\": \"restoreExperiment\" }]\n}\n```\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "experimentKey", + "in": "path", + "description": "The experiment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The experiment key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExperimentPatchInput" + }, + "example": { + "comment": "Example comment describing the update", + "instructions": [ + { + "kind": "updateName", + "value": "Updated experiment name" + } + ] + } + } + }, + "required": true + }, + "operationId": "patchExperiment" + } + }, + "/api/v2/projects/{projectKey}/environments/{environmentKey}/experiments/{experimentKey}/iterations": { + "post": { + "responses": { + "200": { + "description": "Iteration response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IterationRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Experiments (beta)" + ], + "summary": "Create iteration", + "description": "Create an experiment iteration.\n\nExperiment iterations let you record experiments in individual blocks of time. Initially, iterations are created with a status of `not_started` and appear in the `draftIteration` field of an experiment. To start or stop an iteration, [update the experiment](/tag/Experiments-(beta)#operation/patchExperiment) with the `startIteration` or `stopIteration` instruction. \n\nTo learn more, read [Starting experiment iterations](https://docs.launchdarkly.com/home/creating-experiments#starting-experiment-iterations).\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "experimentKey", + "in": "path", + "description": "The experiment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The experiment key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IterationInput" + } + } + }, + "required": true + }, + "operationId": "createIteration" + } + }, + "/api/v2/projects/{projectKey}/environments/{environmentKey}/experiments/{experimentKey}/metric-groups/{metricGroupKey}/results": { + "get": { + "responses": { + "200": { + "description": "Experiment results response for metric group", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetricGroupResultsRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Experiments (beta)" + ], + "summary": "Get experiment results for metric group", + "description": "Get results from an experiment for a particular metric group.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "experimentKey", + "in": "path", + "description": "The experiment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The experiment key" + } + }, + { + "name": "metricGroupKey", + "in": "path", + "description": "The metric group key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The metric group key" + } + }, + { + "name": "iterationId", + "in": "query", + "description": "The iteration ID", + "schema": { + "type": "string", + "format": "string", + "description": "The iteration ID" + } + } + ], + "operationId": "getExperimentResultsForMetricGroup" + } + }, + "/api/v2/projects/{projectKey}/environments/{environmentKey}/experiments/{experimentKey}/metrics/{metricKey}/results": { + "get": { + "responses": { + "200": { + "description": "Experiment results response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExperimentBayesianResultsRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Experiments (beta)" + ], + "summary": "Get experiment results", + "description": "Get results from an experiment for a particular metric.\n\nLaunchDarkly supports one field for expanding the \"Get experiment results\" response. By default, this field is **not** included in the response.\n\nTo expand the response, append the `expand` query parameter with the following field:\n* `traffic` includes the total count of units for each treatment.\n\nFor example, `expand=traffic` includes the `traffic` field for the project in the response.\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "experimentKey", + "in": "path", + "description": "The experiment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The experiment key" + } + }, + { + "name": "metricKey", + "in": "path", + "description": "The metric key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The metric key" + } + }, + { + "name": "iterationId", + "in": "query", + "description": "The iteration ID", + "schema": { + "type": "string", + "format": "string", + "description": "The iteration ID" + } + }, + { + "name": "expand", + "in": "query", + "description": "A comma-separated list of fields to expand in the response. Supported fields are explained above.", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of fields to expand in the response. Supported fields are explained above." + } + } + ], + "operationId": "getExperimentResults" + } + }, + "/api/v2/projects/{projectKey}/environments/{environmentKey}/flags/evaluate": { + "post": { + "responses": { + "200": { + "description": "Flag evaluation collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContextInstanceEvaluations" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Contexts" + ], + "summary": "Evaluate flags for context instance", + "description": "Evaluate flags for a context instance, for example, to determine the expected flag variation. **Do not use this API instead of an SDK.** The LaunchDarkly SDKs are specialized for the tasks of evaluating feature flags in your application at scale and generating analytics events based on those evaluations. This API is not designed for that use case. Any evaluations you perform with this API will not be reflected in features such as flag statuses and flag insights. Context instances evaluated by this API will not appear in the Contexts list. To learn more, read [Comparing LaunchDarkly's SDKs and REST API](https://docs.launchdarkly.com/guide/api/comparing-sdk-rest-api).\n\n### Filtering \n\nLaunchDarkly supports the `filter` query param for filtering, with the following fields:\n\n- `query` filters for a string that matches against the flags' keys and names. It is not case sensitive. For example: `filter=query equals dark-mode`.\n- `tags` filters the list to flags that have all of the tags in the list. For example: `filter=tags contains [\"beta\",\"q1\"]`.\n\nYou can also apply multiple filters at once. For example, setting `filter=query equals dark-mode, tags contains [\"beta\",\"q1\"]` matches flags which match the key or name `dark-mode` and are tagged `beta` and `q1`.\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "limit", + "in": "query", + "description": "The number of feature flags to return. Defaults to -1, which returns all flags", + "schema": { + "type": "integer", + "format": "int64", + "description": "The number of feature flags to return. Defaults to -1, which returns all flags" + } + }, + { + "name": "offset", + "in": "query", + "description": "Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.", + "schema": { + "type": "integer", + "format": "int64", + "description": "Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`." + } + }, + { + "name": "sort", + "in": "query", + "description": "A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order" + } + }, + { + "name": "filter", + "in": "query", + "description": "A comma-separated list of filters. Each filter is of the form `field operator value`. Supported fields are explained above.", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of filters. Each filter is of the form `field operator value`. Supported fields are explained above." + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContextInstance" + }, + "example": { + "key": "user-key-123abc", + "kind": "user", + "otherAttribute": "other attribute value" + } + } + }, + "required": true + }, + "operationId": "evaluateContextInstance" + } + }, + "/api/v2/projects/{projectKey}/environments/{environmentKey}/followers": { + "get": { + "responses": { + "200": { + "description": "Flags and flag followers response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FlagFollowersByProjEnvGetRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + } + }, + "tags": [ + "Follow flags" + ], + "summary": "Get followers of all flags in a given project and environment", + "description": "Get followers of all flags in a given environment and project", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + } + ], + "operationId": "getFollowersByProjEnv" + } + }, + "/api/v2/projects/{projectKey}/environments/{environmentKey}/mobileKey": { + "post": { + "responses": { + "200": { + "description": "Environment response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Environment" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Environments" + ], + "summary": "Reset environment mobile SDK key", + "description": "Reset an environment's mobile key. The optional expiry for the old key is deprecated for this endpoint, so the old key will always expire immediately.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + } + ], + "operationId": "resetEnvironmentMobileKey" + } + }, + "/api/v2/projects/{projectKey}/environments/{environmentKey}/segments/evaluate": { + "post": { + "responses": { + "200": { + "description": "Context instance segment membership collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContextInstanceSegmentMemberships" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + } + }, + "tags": [ + "Segments" + ], + "summary": "List segment memberships for context instance", + "description": "For a given context instance with attributes, get membership details for all segments. In the request body, pass in the context instance.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContextInstance" + }, + "example": { + "address": { + "city": "Springfield", + "street": "123 Main Street" + }, + "jobFunction": "doctor", + "key": "context-key-123abc", + "kind": "user", + "name": "Sandy" + } + } + }, + "required": true + }, + "operationId": "getContextInstanceSegmentsMembershipByEnv" + } + }, + "/api/v2/projects/{projectKey}/experimentation-settings": { + "get": { + "responses": { + "200": { + "description": "Experimentation settings response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RandomizationSettingsRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "405": { + "description": "Method not allowed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MethodNotAllowedErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Experiments (beta)" + ], + "summary": "Get experimentation settings", + "description": "Get current experimentation settings for the given project", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + } + ], + "operationId": "getExperimentationSettings" + }, + "put": { + "responses": { + "200": { + "description": "Experimentation settings response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RandomizationSettingsRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "405": { + "description": "Method not allowed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MethodNotAllowedErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Experiments (beta)" + ], + "summary": "Update experimentation settings", + "description": "Update experimentation settings for the given project", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RandomizationSettingsPut" + } + } + }, + "required": true + }, + "operationId": "putExperimentationSettings" + } + }, + "/api/v2/projects/{projectKey}/flag-defaults": { + "get": { + "responses": { + "200": { + "description": "Flag defaults response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/flagDefaultsRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + } + }, + "tags": [ + "Projects" + ], + "summary": "Get flag defaults for project", + "description": "Get the flag defaults for a specific project.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + } + ], + "operationId": "getFlagDefaultsByProject" + }, + "patch": { + "responses": { + "200": { + "description": "Flag default response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/upsertPayloadRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Projects" + ], + "summary": "Update flag default for project", + "description": "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](/#section/Overview/Updates).", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JSONPatch" + } + } + }, + "required": true + }, + "operationId": "patchFlagDefaultsByProject" + }, + "put": { + "responses": { + "200": { + "description": "Flag default response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/upsertPayloadRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Projects" + ], + "summary": "Create or update flag defaults for project", + "description": "Create or update flag defaults for a project.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpsertFlagDefaultsPayload" + } + } + }, + "required": true + }, + "operationId": "putFlagDefaultsByProject" + } + }, + "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests": { + "get": { + "responses": { + "200": { + "description": "Approval request collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FlagConfigApprovalRequestsResponse" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Approvals" + ], + "summary": "List approval requests for a flag", + "description": "Get all approval requests for a feature flag.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + } + ], + "operationId": "getApprovalsForFlag" + }, + "post": { + "responses": { + "201": { + "description": "Approval request response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FlagConfigApprovalRequestResponse" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Approvals" + ], + "summary": "Create approval request for a flag", + "description": "Create an approval request for a feature flag.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/createFlagConfigApprovalRequestRequest" + } + } + }, + "required": true + }, + "operationId": "postApprovalRequestForFlag" + } + }, + "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests-flag-copy": { + "post": { + "responses": { + "201": { + "description": "Approval request response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FlagConfigApprovalRequestResponse" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Approvals" + ], + "summary": "Create approval request to copy flag configurations across environments", + "description": "Create an approval request to copy a feature flag's configuration across environments.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key for the target environment", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key for the target environment" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/createCopyFlagConfigApprovalRequestRequest" + } + } + }, + "required": true + }, + "operationId": "postFlagCopyConfigApprovalRequest" + } + }, + "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{id}": { + "get": { + "responses": { + "200": { + "description": "Approval request response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FlagConfigApprovalRequestResponse" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Approvals" + ], + "summary": "Get approval request for a flag", + "description": "Get a single approval request for a feature flag.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "id", + "in": "path", + "description": "The feature flag approval request ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag approval request ID" + } + } + ], + "operationId": "getApprovalForFlag" + }, + "delete": { + "responses": { + "204": { + "description": "Action succeeded" + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Approvals" + ], + "summary": "Delete approval request for a flag", + "description": "Delete an approval request for a feature flag.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "id", + "in": "path", + "description": "The feature flag approval request ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag approval request ID" + } + } + ], + "operationId": "deleteApprovalRequestForFlag" + } + }, + "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{id}/apply": { + "post": { + "responses": { + "200": { + "description": "Approval request apply response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FlagConfigApprovalRequestResponse" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Approvals" + ], + "summary": "Apply approval request for a flag", + "description": "Apply an approval request that has been approved.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "id", + "in": "path", + "description": "The feature flag approval request ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag approval request ID" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/postApprovalRequestApplyRequest" + } + } + }, + "required": true + }, + "operationId": "postApprovalRequestApplyForFlag" + } + }, + "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{id}/reviews": { + "post": { + "responses": { + "200": { + "description": "Approval request review response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FlagConfigApprovalRequestResponse" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Approvals" + ], + "summary": "Review approval request for a flag", + "description": "Review an approval request by approving or denying changes.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "id", + "in": "path", + "description": "The feature flag approval request ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag approval request ID" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/postApprovalRequestReviewRequest" + } + } + }, + "required": true + }, + "operationId": "postApprovalRequestReviewForFlag" + } + }, + "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/followers": { + "get": { + "responses": { + "200": { + "description": "Flag followers response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FlagFollowersGetRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + } + }, + "tags": [ + "Follow flags" + ], + "summary": "Get followers of a flag in a project and environment", + "description": "Get a list of members following a flag in a project and environment", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + } + ], + "operationId": "getFlagFollowers" + } + }, + "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/followers/{memberId}": { + "put": { + "responses": { + "204": { + "description": "Action succeeded" + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + } + }, + "tags": [ + "Follow flags" + ], + "summary": "Add a member as a follower of a flag in a project and environment", + "description": "Add a member as a follower to a flag in a project and environment", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "memberId", + "in": "path", + "description": "The memberId of the member to add as a follower of the flag. Reader roles can only add themselves.", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The memberId of the member to add as a follower of the flag. Reader roles can only add themselves." + } + } + ], + "operationId": "putFlagFollowers" + }, + "delete": { + "responses": { + "204": { + "description": "Action succeeded" + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + } + }, + "tags": [ + "Follow flags" + ], + "summary": "Remove a member as a follower of a flag in a project and environment", + "description": "Remove a member as a follower to a flag in a project and environment", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "memberId", + "in": "path", + "description": "The memberId of the member to remove as a follower of the flag. Reader roles can only remove themselves.", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The memberId of the member to remove as a follower of the flag. Reader roles can only remove themselves." + } + } + ], + "operationId": "deleteFlagFollowers" + } + }, + "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/scheduled-changes": { + "get": { + "responses": { + "200": { + "description": "Scheduled changes collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeatureFlagScheduledChanges" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + } + }, + "tags": [ + "Scheduled changes" + ], + "summary": "List scheduled changes", + "description": "Get a list of scheduled changes that will be applied to the feature flag.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + } + ], + "operationId": "getFlagConfigScheduledChanges" + }, + "post": { + "responses": { + "201": { + "description": "Scheduled changes response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeatureFlagScheduledChange" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "405": { + "description": "Method not allowed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MethodNotAllowedErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Scheduled changes" + ], + "summary": "Create scheduled changes workflow", + "description": "Create scheduled changes for a feature flag. If the `ignoreConficts` query parameter is false and there are conflicts between these instructions and existing scheduled changes, the request will fail. If the parameter is true and there are conflicts, the request will succeed.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "ignoreConflicts", + "in": "query", + "description": "Whether to succeed (`true`) or fail (`false`) when these instructions conflict with existing scheduled changes", + "schema": { + "type": "boolean", + "description": "Whether to succeed (`true`) or fail (`false`) when these instructions conflict with existing scheduled changes" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostFlagScheduledChangesInput" + }, + "example": { + "comment": "Optional comment describing the scheduled changes", + "executionDate": 1718467200000, + "instructions": [ + { + "kind": "turnFlagOn" + } + ] + } + } + }, + "required": true + }, + "operationId": "postFlagConfigScheduledChanges" + } + }, + "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/scheduled-changes/{id}": { + "get": { + "responses": { + "200": { + "description": "Scheduled changes response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeatureFlagScheduledChange" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Scheduled changes" + ], + "summary": "Get a scheduled change", + "description": "Get a scheduled change that will be applied to the feature flag by ID.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "id", + "in": "path", + "description": "The scheduled change id", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The scheduled change id" + } + } + ], + "operationId": "getFeatureFlagScheduledChange" + }, + "patch": { + "responses": { + "200": { + "description": "Scheduled changes response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeatureFlagScheduledChange" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "405": { + "description": "Method not allowed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MethodNotAllowedErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Scheduled changes" + ], + "summary": "Update scheduled changes workflow", + "description": "\nUpdate a scheduled change, overriding existing instructions with the new ones. Updating a scheduled change uses the semantic patch format.\n\nTo make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch).\n\n### Instructions\n\nSemantic patch requests support the following `kind` instructions for updating scheduled changes.\n\n
\nClick to expand instructions for updating scheduled changes\n\n#### deleteScheduledChange\n\nRemoves the scheduled change.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{ \"kind\": \"deleteScheduledChange\" }]\n}\n```\n\n#### replaceScheduledChangesInstructions\n\nRemoves the existing scheduled changes and replaces them with the new instructions.\n\n##### Parameters\n\n- `value`: An array of the new actions to perform when the execution date for these scheduled changes arrives. Supported scheduled actions are `turnFlagOn` and `turnFlagOff`.\n\nHere's an example that replaces the scheduled changes with new instructions to turn flag targeting off:\n\n```json\n{\n \"instructions\": [\n {\n \"kind\": \"replaceScheduledChangesInstructions\",\n \"value\": [ {\"kind\": \"turnFlagOff\"} ]\n }\n ]\n}\n```\n\n#### updateScheduledChangesExecutionDate\n\nUpdates the execution date for the scheduled changes.\n\n##### Parameters\n\n- `value`: the new execution date, in Unix milliseconds.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [\n {\n \"kind\": \"updateScheduledChangesExecutionDate\",\n \"value\": 1754092860000\n }\n ]\n}\n```\n\n
\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "id", + "in": "path", + "description": "The scheduled change ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The scheduled change ID" + } + }, + { + "name": "ignoreConflicts", + "in": "query", + "description": "Whether to succeed (`true`) or fail (`false`) when these new instructions conflict with existing scheduled changes", + "schema": { + "type": "boolean", + "description": "Whether to succeed (`true`) or fail (`false`) when these new instructions conflict with existing scheduled changes" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FlagScheduledChangesInput" + }, + "example": { + "comment": "Optional comment describing the update to the scheduled changes", + "instructions": [ + { + "kind": "replaceScheduledChangesInstructions", + "value": [ + { + "kind": "turnFlagOff" + } + ] + } + ] + } + } + }, + "required": true + }, + "operationId": "patchFlagConfigScheduledChange" + }, + "delete": { + "responses": { + "204": { + "description": "Action succeeded" + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "405": { + "description": "Method not allowed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MethodNotAllowedErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Scheduled changes" + ], + "summary": "Delete scheduled changes workflow", + "description": "Delete a scheduled changes workflow.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "id", + "in": "path", + "description": "The scheduled change id", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The scheduled change id" + } + } + ], + "operationId": "deleteFlagConfigScheduledChanges" + } + }, + "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/workflows": { + "get": { + "responses": { + "200": { + "description": "Workflows collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CustomWorkflowsListingOutput" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Workflows" + ], + "summary": "Get workflows", + "description": "Display workflows associated with a feature flag.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "status", + "in": "query", + "description": "Filter results by workflow status. Valid status filters are `active`, `completed`, and `failed`.", + "schema": { + "type": "string", + "format": "string", + "description": "Filter results by workflow status. Valid status filters are `active`, `completed`, and `failed`." + } + }, + { + "name": "sort", + "in": "query", + "description": "A field to sort the items by. Prefix field by a dash ( - ) to sort in descending order. This endpoint supports sorting by `creationDate` or `stopDate`.", + "schema": { + "type": "string", + "format": "string", + "description": "A field to sort the items by. Prefix field by a dash ( - ) to sort in descending order. This endpoint supports sorting by `creationDate` or `stopDate`." + } + }, + { + "name": "limit", + "in": "query", + "description": "The maximum number of workflows to return. Defaults to 20.", + "schema": { + "type": "integer", + "format": "int64", + "description": "The maximum number of workflows to return. Defaults to 20." + } + }, + { + "name": "offset", + "in": "query", + "description": "Where to start in the list. Defaults to 0. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.", + "schema": { + "type": "integer", + "format": "int64", + "description": "Where to start in the list. Defaults to 0. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`." + } + } + ], + "operationId": "getWorkflows" + }, + "post": { + "responses": { + "201": { + "description": "Workflow response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CustomWorkflowOutput" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Workflows" + ], + "summary": "Create workflow", + "description": "Create a workflow for a feature flag. You can create a workflow directly, or you can apply a template to create a new workflow.\n\n### Creating a workflow\n\nYou can use the create workflow endpoint to create a workflow directly by adding a `stages` array to the request body.\n\nFor each stage, define the `name`, `conditions` when the stage should be executed, and `action` that describes the stage.\n\n
\nClick to expand example\n\n_Example request body_\n```json\n{\n \"name\": \"Progressive rollout starting in two days\",\n \"description\": \"Turn flag targeting on and increase feature rollout in 10% increments each day\",\n \"stages\": [\n {\n \"name\": \"10% rollout on day 1\",\n \"conditions\": [\n {\n \"kind\": \"schedule\",\n \"scheduleKind\": \"relative\", // or \"absolute\"\n // If \"scheduleKind\" is \"absolute\", set \"executionDate\";\n // \"waitDuration\" and \"waitDurationUnit\" will be ignored\n \"waitDuration\": 2,\n \"waitDurationUnit\": \"calendarDay\"\n },\n {\n \"kind\": \"ld-approval\",\n \"notifyMemberIds\": [ \"507f1f77bcf86cd799439011\" ],\n \"notifyTeamKeys\": [ \"team-key-123abc\" ]\n }\n ],\n \"action\": {\n \"instructions\": [\n {\n \"kind\": \"turnFlagOn\"\n },\n {\n \"kind\": \"updateFallthroughVariationOrRollout\",\n \"rolloutWeights\": {\n \"452f5fb5-7320-4ba3-81a1-8f4324f79d49\": 90000,\n \"fc15f6a4-05d3-4aa4-a997-446be461345d\": 10000\n }\n }\n ]\n }\n }\n ]\n}\n```\n
\n\n### Creating a workflow by applying a workflow template\n\nYou can also create a workflow by applying a workflow template. If you pass a valid workflow template key as the `templateKey` query parameter with the request, the API will attempt to create a new workflow with the stages defined in the workflow template with the corresponding key.\n\n#### Applicability of stages\nTemplates are created in the context of a particular flag in a particular environment in a particular project. However, because workflows created from a template can be applied to any project, environment, and flag, some steps of the workflow may need to be updated in order to be applicable for the target resource.\n\nYou can pass a `dryRun` query parameter to tell the API to return a report of which steps of the workflow template are applicable in the target project/environment/flag, and which will need to be updated. When the `dryRun` query parameter is present the response body includes a `meta` property that holds a list of parameters that could potentially be inapplicable for the target resource. Each of these parameters will include a `valid` field. You will need to update any invalid parameters in order to create the new workflow. You can do this using the `parameters` property, which overrides the workflow template parameters.\n\n#### Overriding template parameters\nYou can use the `parameters` property in the request body to tell the API to override the specified workflow template parameters with new values that are specific to your target project/environment/flag.\n\n
\nClick to expand example\n\n_Example request body_\n```json\n{\n\t\"name\": \"workflow created from my-template\",\n\t\"description\": \"description of my workflow\",\n\t\"parameters\": [\n\t\t{\n\t\t\t\"_id\": \"62cf2bc4cadbeb7697943f3b\",\n\t\t\t\"path\": \"/clauses/0/values\",\n\t\t\t\"default\": {\n\t\t\t\t\"value\": [\"updated-segment\"]\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"_id\": \"62cf2bc4cadbeb7697943f3d\",\n\t\t\t\"path\": \"/variationId\",\n\t\t\t\"default\": {\n\t\t\t\t\"value\": \"abcd1234-abcd-1234-abcd-1234abcd12\"\n\t\t\t}\n\t\t}\n\t]\n}\n```\n
\n\nIf there are any steps in the template that are not applicable to the target resource, the workflow will not be created, and the `meta` property will be included in the response body detailing which parameters need to be updated.\n", + "parameters": [ + { + "name": "templateKey", + "in": "query", + "description": "The template key to apply as a starting point for the new workflow", + "schema": { + "type": "string", + "format": "string", + "description": "The template key to apply as a starting point for the new workflow" + } + }, + { + "name": "dryRun", + "in": "query", + "description": "Whether to call the endpoint in dry-run mode", + "schema": { + "type": "boolean", + "description": "Whether to call the endpoint in dry-run mode" + } + }, + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CustomWorkflowInput" + }, + "example": { + "description": "Turn flag on for 10% of customers each day", + "name": "Progressive rollout starting in two days", + "stages": [ + { + "action": { + "instructions": [ + { + "kind": "turnFlagOn" + }, + { + "kind": "updateFallthroughVariationOrRollout", + "rolloutWeights": { + "452f5fb5-7320-4ba3-81a1-8f4324f79d49": 90000, + "fc15f6a4-05d3-4aa4-a997-446be461345d": 10000 + } + } + ] + }, + "conditions": [ + { + "kind": "schedule", + "scheduleKind": "relative", + "waitDuration": 2, + "waitDurationUnit": "calendarDay" + } + ], + "name": "10% rollout on day 1" + } + ] + } + } + }, + "required": true + }, + "operationId": "postWorkflow" + } + }, + "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/workflows/{workflowId}": { + "get": { + "responses": { + "200": { + "description": "Workflow response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CustomWorkflowOutput" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Workflows" + ], + "summary": "Get custom workflow", + "description": "Get a specific workflow by ID.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "workflowId", + "in": "path", + "description": "The workflow ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The workflow ID" + } + } + ], + "operationId": "getCustomWorkflow" + }, + "delete": { + "responses": { + "204": { + "description": "Action completed successfully" + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Workflows" + ], + "summary": "Delete workflow", + "description": "Delete a workflow from a feature flag.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "workflowId", + "in": "path", + "description": "The workflow id", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The workflow id" + } + } + ], + "operationId": "deleteWorkflow" + } + }, + "/api/v2/projects/{projectKey}/flags/{flagKey}/environments/{environmentKey}/migration-safety-issues": { + "post": { + "responses": { + "200": { + "description": "Migration safety issues found", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MigrationSafetyIssueRep" + } + } + } + } + }, + "204": { + "description": "No safety issues found" + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + }, + "503": { + "description": "Service unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusServiceUnavailable" + } + } + } + } + }, + "tags": [ + "Feature flags" + ], + "summary": "Get migration safety issues", + "description": "Returns the migration safety issues that are associated with the POSTed flag patch. The patch must use the semantic patch format for updating feature flags.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "flagKey", + "in": "path", + "description": "The migration flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The migration flag key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/flagSempatch" + } + } + }, + "required": true + }, + "operationId": "postMigrationSafetyIssues" + } + }, + "/api/v2/projects/{projectKey}/metric-groups": { + "get": { + "responses": { + "200": { + "description": "Metric group collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetricGroupCollectionRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "405": { + "description": "Method not allowed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MethodNotAllowedErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Metrics (beta)" + ], + "summary": "List metric groups", + "description": "Get a list of all metric groups for the specified project.\n\n### Expanding the metric groups response\nLaunchDarkly supports one field for expanding the \"Get metric groups\" response. By default, these fields are **not** included in the response.\n\nTo expand the response, append the `expand` query parameter and add a comma-separated list with the following field:\n\n- `experiments` includes all experiments from the specific project that use the metric group\n\nFor example, `expand=experiments` includes the `experiments` field in the response.\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "expand", + "in": "query", + "description": "A comma-separated list of properties that can reveal additional information in the response.", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of properties that can reveal additional information in the response." + } + } + ], + "operationId": "getMetricGroups" + }, + "post": { + "responses": { + "201": { + "description": "Metric group response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetricGroupRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "405": { + "description": "Method not allowed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MethodNotAllowedErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Metrics (beta)" + ], + "summary": "Create metric group", + "description": "Create a new metric group in the specified project", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetricGroupPost" + } + } + }, + "required": true + }, + "operationId": "createMetricGroup" + } + }, + "/api/v2/projects/{projectKey}/metric-groups/{metricGroupKey}": { + "get": { + "responses": { + "200": { + "description": "Metric group response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetricGroupRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "405": { + "description": "Method not allowed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MethodNotAllowedErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Metrics (beta)" + ], + "summary": "Get metric group", + "description": "Get information for a single metric group from the specific project.\n\n### Expanding the metric group response\nLaunchDarkly supports two fields for expanding the \"Get metric group\" response. By default, these fields are **not** included in the response.\n\nTo expand the response, append the `expand` query parameter and add a comma-separated list with either or both of the following fields:\n\n- `experiments` includes all experiments from the specific project that use the metric group\n- `experimentCount` includes the number of experiments from the specific project that use the metric group\n\nFor example, `expand=experiments` includes the `experiments` field in the response.\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "metricGroupKey", + "in": "path", + "description": "The metric group key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The metric group key" + } + }, + { + "name": "expand", + "in": "query", + "description": "A comma-separated list of properties that can reveal additional information in the response.", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of properties that can reveal additional information in the response." + } + } + ], + "operationId": "getMetricGroup" + }, + "patch": { + "responses": { + "200": { + "description": "Metric group response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MetricGroupRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "405": { + "description": "Method not allowed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MethodNotAllowedErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Metrics (beta)" + ], + "summary": "Patch metric group", + "description": "Patch a metric group by key. Updating a metric group uses a [JSON patch](https://datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "metricGroupKey", + "in": "path", + "description": "The metric group key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The metric group key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JSONPatch" + }, + "example": [ + { + "op": "replace", + "path": "/name", + "value": "my-updated-metric-group" + } + ] + } + }, + "required": true + }, + "operationId": "patchMetricGroup" + }, + "delete": { + "responses": { + "204": { + "description": "Action succeeded" + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "405": { + "description": "Method not allowed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MethodNotAllowedErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Metrics (beta)" + ], + "summary": "Delete metric group", + "description": "Delete a metric group by key.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "metricGroupKey", + "in": "path", + "description": "The metric group key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The metric group key" + } + } + ], + "operationId": "deleteMetricGroup" + } + }, + "/api/v2/projects/{projectKey}/release-pipelines": { + "get": { + "responses": { + "200": { + "description": "Release pipeline collection", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReleasePipelineCollection" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + } + }, + "tags": [ + "Release pipelines (beta)" + ], + "summary": "Get all release pipelines", + "description": "Get all release pipelines for a project.\n\n### Filtering release pipelines\n\nLaunchDarkly supports the following fields for filters:\n\n- `query` is a string that matches against the release pipeline `key`, `name`, and `description`. It is not case sensitive. For example: `?filter=query:examplePipeline`.\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "filter", + "in": "query", + "description": "A comma-separated list of filters. Each filter is of the form field:value. Read the endpoint description for a full list of available filter fields.", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of filters. Each filter is of the form field:value. Read the endpoint description for a full list of available filter fields." + } + }, + { + "name": "limit", + "in": "query", + "description": "The maximum number of items to return. Defaults to 20.", + "schema": { + "type": "integer", + "format": "int64", + "description": "The maximum number of items to return. Defaults to 20." + } + }, + { + "name": "offset", + "in": "query", + "description": "Where to start in the list. Defaults to 0. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.", + "schema": { + "type": "integer", + "format": "int64", + "description": "Where to start in the list. Defaults to 0. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`." + } + } + ], + "operationId": "getAllReleasePipelines" + }, + "post": { + "responses": { + "201": { + "description": "Release pipeline response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReleasePipeline" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + } + }, + "tags": [ + "Release pipelines (beta)" + ], + "summary": "Create a release pipeline", + "description": "Creates a new release pipeline.\n\nThe first release pipeline you create is automatically set as the default release pipeline for your project. To change the default release pipeline, use the [Update project](/tag/Projects#operation/patchProject) API to set the `defaultReleasePipelineKey`.\n\nYou can create up to 20 release pipelines per project.\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateReleasePipelineInput" + } + } + }, + "required": true + }, + "operationId": "postReleasePipeline" + } + }, + "/api/v2/projects/{projectKey}/release-pipelines/{pipelineKey}": { + "get": { + "responses": { + "200": { + "description": "Release pipeline response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReleasePipeline" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + } + }, + "tags": [ + "Release pipelines (beta)" + ], + "summary": "Get release pipeline by key", + "description": "Get a release pipeline by key", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "pipelineKey", + "in": "path", + "description": "The release pipeline key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The release pipeline key" + } + } + ], + "operationId": "getReleasePipelineByKey" + }, + "patch": { + "responses": { + "200": { + "description": "Release pipeline response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReleasePipeline" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + } + }, + "tags": [ + "Release pipelines (beta)" + ], + "summary": "Update a release pipeline", + "description": "Updates a release pipeline. Updating a release pipeline uses a [JSON patch](https://datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes. To learn more, read [Updates](/#section/Overview/Updates).", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "pipelineKey", + "in": "path", + "description": "The release pipeline key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The release pipeline key" + } + } + ], + "operationId": "patchReleasePipeline" + }, + "delete": { + "responses": { + "204": { + "description": "Action succeeded" + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + } + }, + "tags": [ + "Release pipelines (beta)" + ], + "summary": "Delete release pipeline", + "description": "Deletes a release pipeline.\n\nYou cannot delete the default release pipeline.\n\nIf you want to delete a release pipeline that is currently the default, create a second release pipeline and set it as the default. Then delete the first release pipeline. To change the default release pipeline, use the [Update project](/tag/Projects#operation/patchProject) API to set the `defaultReleasePipelineKey`.\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "pipelineKey", + "in": "path", + "description": "The release pipeline key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The release pipeline key" + } + } + ], + "operationId": "deleteReleasePipeline" + } + }, + "/api/v2/public-ip-list": { + "get": { + "responses": { + "200": { + "description": "Public IP response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ipList" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Other" + ], + "summary": "Gets the public IP list", + "description": "Get a list of IP ranges the LaunchDarkly service uses. You can use this list to allow LaunchDarkly through your firewall. We post upcoming changes to this list in advance on our [status page](https://status.launchdarkly.com/).

In the sandbox, click 'Try it' and enter any string in the 'Authorization' field to test this endpoint.", + "operationId": "getIps" + } + }, + "/api/v2/roles": { + "get": { + "responses": { + "200": { + "description": "Custom roles collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CustomRoles" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Custom roles" + ], + "summary": "List custom roles", + "description": "Get a complete list of custom roles. Custom roles let you create flexible policies providing fine-grained access control to everything in LaunchDarkly, from feature flags to goals, environments, and teams. With custom roles, it's possible to enforce access policies that meet your exact workflow needs. Custom roles are available to customers on our enterprise plans. If you're interested in learning more about our enterprise plans, contact sales@launchdarkly.com.", + "parameters": [ + { + "name": "limit", + "in": "query", + "description": "The maximum number of custom roles to return. Defaults to 20.", + "schema": { + "type": "integer", + "format": "int64", + "description": "The maximum number of custom roles to return. Defaults to 20." + } + }, + { + "name": "offset", + "in": "query", + "description": "Where to start in the list. Defaults to 0. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.", + "schema": { + "type": "integer", + "format": "int64", + "description": "Where to start in the list. Defaults to 0. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`." + } + } + ], + "operationId": "getCustomRoles" + }, + "post": { + "responses": { + "201": { + "description": "Custom role response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CustomRole" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Custom roles" + ], + "summary": "Create custom role", + "description": "Create a new custom role", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CustomRolePost" + }, + "example": { + "basePermissions": "reader", + "description": "An example role for members of the ops team", + "key": "role-key-123abc", + "name": "Ops team", + "policy": [ + { + "actions": [ + "updateOn" + ], + "effect": "allow", + "resources": [ + "proj/*:env/production:flag/*" + ] + } + ] + } + } + }, + "required": true + }, + "operationId": "postCustomRole" + } + }, + "/api/v2/roles/{customRoleKey}": { + "get": { + "responses": { + "200": { + "description": "Custom role response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CustomRole" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Custom roles" + ], + "summary": "Get custom role", + "description": "Get a single custom role by key or ID", + "parameters": [ + { + "name": "customRoleKey", + "in": "path", + "description": "The custom role key or ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The custom role key or ID" + } + } + ], + "operationId": "getCustomRole" + }, + "patch": { + "responses": { + "200": { + "description": "Custom role response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CustomRole" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Custom roles" + ], + "summary": "Update custom role", + "description": "Update a single custom role. Updating a custom role 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](/#section/Overview/Updates).

To add an element to the `policy` array, set the `path` to `/policy` and then append `/`. Use `/0` to add to the beginning of the array. Use `/-` to add to the end of the array.", + "parameters": [ + { + "name": "customRoleKey", + "in": "path", + "description": "The custom role key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The custom role key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchWithComment" + }, + "example": { + "patch": [ + { + "op": "add", + "path": "/policy/0", + "value": { + "actions": [ + "updateOn" + ], + "effect": "allow", + "resources": [ + "proj/*:env/qa:flag/*" + ] + } + } + ] + } + } + }, + "required": true + }, + "operationId": "patchCustomRole" + }, + "delete": { + "responses": { + "204": { + "description": "Action succeeded" + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Custom roles" + ], + "summary": "Delete custom role", + "description": "Delete a custom role by key", + "parameters": [ + { + "name": "customRoleKey", + "in": "path", + "description": "The custom role key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The custom role key" + } + } + ], + "operationId": "deleteCustomRole" + } + }, + "/api/v2/segments/{projectKey}/{environmentKey}": { + "get": { + "responses": { + "200": { + "description": "Segment collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserSegments" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + } + }, + "tags": [ + "Segments" + ], + "summary": "List segments", + "description": "Get a list of all segments in the given project.

Segments can be rule-based, list-based, or synced. Big segments include larger list-based segments and synced segments. Some fields in the response only apply to big segments.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "limit", + "in": "query", + "description": "The number of segments to return. Defaults to 20.", + "schema": { + "type": "integer", + "format": "int64", + "description": "The number of segments to return. Defaults to 20." + } + }, + { + "name": "offset", + "in": "query", + "description": "Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.", + "schema": { + "type": "integer", + "format": "int64", + "description": "Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`." + } + }, + { + "name": "sort", + "in": "query", + "description": "Accepts sorting order and fields. Fields can be comma separated. Possible fields are 'creationDate', 'name', 'lastModified'. Example: `sort=name` sort by names ascending or `sort=-name,creationDate` sort by names descending and creationDate ascending.", + "schema": { + "type": "string", + "format": "string", + "description": "Accepts sorting order and fields. Fields can be comma separated. Possible fields are 'creationDate', 'name', 'lastModified'. Example: `sort=name` sort by names ascending or `sort=-name,creationDate` sort by names descending and creationDate ascending." + } + }, + { + "name": "filter", + "in": "query", + "description": "Accepts filter by kind, query, tags, unbounded, or external. To filter by kind or query, use the `equals` operator. To filter by tags, use the `anyOf` operator. Query is a 'fuzzy' search across segment key, name, and description. Example: `filter=tags anyOf ['enterprise', 'beta'],query equals 'toggle'` returns segments with 'toggle' in their key, name, or description that also have 'enterprise' or 'beta' as a tag. To filter by unbounded, use the `equals` operator. Example: `filter=unbounded equals true`. To filter by external, use the `exists` operator. Example: `filter=external exists true`.", + "schema": { + "type": "string", + "format": "string", + "description": "Accepts filter by kind, query, tags, unbounded, or external. To filter by kind or query, use the `equals` operator. To filter by tags, use the `anyOf` operator. Query is a 'fuzzy' search across segment key, name, and description. Example: `filter=tags anyOf ['enterprise', 'beta'],query equals 'toggle'` returns segments with 'toggle' in their key, name, or description that also have 'enterprise' or 'beta' as a tag. To filter by unbounded, use the `equals` operator. Example: `filter=unbounded equals true`. To filter by external, use the `exists` operator. Example: `filter=external exists true`." + } + } + ], + "operationId": "getSegments" + }, + "post": { + "responses": { + "201": { + "description": "Segment response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserSegment" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Segments" + ], + "summary": "Create segment", + "description": "Create a new segment.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SegmentBody" + } + } + }, + "required": true + }, + "operationId": "postSegment" + } + }, + "/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}": { + "get": { + "responses": { + "200": { + "description": "Segment response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserSegment" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Segments" + ], + "summary": "Get segment", + "description": "Get a single segment by key.

Segments can be rule-based, list-based, or synced. Big segments include larger list-based segments and synced segments. Some fields in the response only apply to big segments.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "segmentKey", + "in": "path", + "description": "The segment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The segment key" + } + } + ], + "operationId": "getSegment" + }, + "patch": { + "responses": { + "200": { + "description": "Segment response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserSegment" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Segments" + ], + "summary": "Patch segment", + "description": "Update a segment. The request body must be a valid semantic patch, JSON patch, or JSON merge patch. To learn more the different formats, read [Updates](/#section/Overview/Updates).\n\n### Using semantic patches on a segment\n\nTo make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch).\n\nThe body of a semantic patch request for updating segments requires an `environmentKey` in addition to `instructions` and an optional `comment`. The body of the request takes the following properties:\n\n* `comment` (string): (Optional) A description of the update.\n* `environmentKey` (string): (Required) The key of the LaunchDarkly environment.\n* `instructions` (array): (Required) A list of actions the update should perform. Each action in the list must be an object with a `kind` property that indicates the instruction. If the action requires parameters, you must include those parameters as additional fields in the object.\n\n### Instructions\n\nSemantic patch requests support the following `kind` instructions for updating segments.\n\n
\nClick to expand instructions for updating segments\n\n#### addIncludedTargets\n\nAdds context keys to the individual context targets included in the segment for the specified `contextKind`. Returns an error if this causes the same context key to be both included and excluded.\n\n##### Parameters\n\n- `contextKind`: The context kind the targets should be added to.\n- `values`: List of keys.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"addIncludedTargets\",\n \"contextKind\": \"org\",\n \"values\": [ \"org-key-123abc\", \"org-key-456def\" ]\n }]\n}\n```\n\n#### addIncludedUsers\n\nAdds user keys to the individual user targets included in the segment. Returns an error if this causes the same user key to be both included and excluded. If you are working with contexts, use `addIncludedTargets` instead of this instruction.\n\n##### Parameters\n\n- `values`: List of user keys.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"addIncludedUsers\",\n \"values\": [ \"user-key-123abc\", \"user-key-456def\" ]\n }]\n}\n```\n\n#### addExcludedTargets\n\nAdds context keys to the individual context targets excluded in the segment for the specified `contextKind`. Returns an error if this causes the same context key to be both included and excluded.\n\n##### Parameters\n\n- `contextKind`: The context kind the targets should be added to.\n- `values`: List of keys.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"addExcludedTargets\",\n \"contextKind\": \"org\",\n \"values\": [ \"org-key-123abc\", \"org-key-456def\" ]\n }]\n}\n```\n\n#### addExcludedUsers\n\nAdds user keys to the individual user targets excluded from the segment. Returns an error if this causes the same user key to be both included and excluded. If you are working with contexts, use `addExcludedTargets` instead of this instruction.\n\n##### Parameters\n\n- `values`: List of user keys.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"addExcludedUsers\",\n \"values\": [ \"user-key-123abc\", \"user-key-456def\" ]\n }]\n}\n```\n\n#### removeIncludedTargets\n\nRemoves context keys from the individual context targets included in the segment for the specified `contextKind`.\n\n##### Parameters\n\n- `contextKind`: The context kind the targets should be removed from.\n- `values`: List of keys.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"removeIncludedTargets\",\n \"contextKind\": \"org\",\n \"values\": [ \"org-key-123abc\", \"org-key-456def\" ]\n }]\n}\n```\n\n#### removeIncludedUsers\n\nRemoves user keys from the individual user targets included in the segment. If you are working with contexts, use `removeIncludedTargets` instead of this instruction.\n\n##### Parameters\n\n- `values`: List of user keys.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"removeIncludedUsers\",\n \"values\": [ \"user-key-123abc\", \"user-key-456def\" ]\n }]\n}\n```\n\n#### removeExcludedTargets\n\nRemoves context keys from the individual context targets excluded from the segment for the specified `contextKind`.\n\n##### Parameters\n\n- `contextKind`: The context kind the targets should be removed from.\n- `values`: List of keys.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"removeExcludedTargets\",\n \"contextKind\": \"org\",\n \"values\": [ \"org-key-123abc\", \"org-key-456def\" ]\n }]\n}\n```\n\n#### removeExcludedUsers\n\nRemoves user keys from the individual user targets excluded from the segment. If you are working with contexts, use `removeExcludedTargets` instead of this instruction.\n\n##### Parameters\n\n- `values`: List of user keys.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"removeExcludedUsers\",\n \"values\": [ \"user-key-123abc\", \"user-key-456def\" ]\n }]\n}\n```\n\n#### updateName\n\nUpdates the name of the segment.\n\n##### Parameters\n\n- `value`: Name of the segment.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"updateName\",\n \"value\": \"Updated segment name\"\n }]\n}\n```\n\n
\n\n## Using JSON patches on a segment\n\nIf you do not include the header described above, you can use a [JSON patch](/reference#updates-using-json-patch) or [JSON merge patch](https://datatracker.ietf.org/doc/html/rfc7386) representation of the desired changes.\n\nFor example, to update the description for a segment with a JSON patch, use the following request body:\n\n```json\n{\n \"patch\": [\n {\n \"op\": \"replace\",\n \"path\": \"/description\",\n \"value\": \"new description\"\n }\n ]\n}\n```\n\nTo update fields in the segment that are arrays, set the `path` to the name of the field and then append `/`. Use `/0` to add the new entry to the beginning of the array. Use `/-` to add the new entry to the end of the array.\n\nFor example, to add a rule to a segment, use the following request body:\n\n```json\n{\n \"patch\":[\n {\n \"op\": \"add\",\n \"path\": \"/rules/0\",\n \"value\": {\n \"clauses\": [{ \"contextKind\": \"user\", \"attribute\": \"email\", \"op\": \"endsWith\", \"values\": [\".edu\"], \"negate\": false }]\n }\n }\n ]\n}\n```\n\nTo add or remove targets from segments, we recommend using semantic patch. Semantic patch for segments includes specific instructions for adding and removing both included and excluded targets.\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "segmentKey", + "in": "path", + "description": "The segment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The segment key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchWithComment" + }, + "example": { + "patch": [ + { + "op": "replace", + "path": "/description", + "value": "New description for this segment" + }, + { + "op": "add", + "path": "/tags/0", + "value": "example" + } + ] + } + } + }, + "required": true + }, + "operationId": "patchSegment" + }, + "delete": { + "responses": { + "204": { + "description": "Action succeeded" + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Segments" + ], + "summary": "Delete segment", + "description": "Delete a segment.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "segmentKey", + "in": "path", + "description": "The segment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The segment key" + } + } + ], + "operationId": "deleteSegment" + } + }, + "/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/contexts": { + "post": { + "responses": { + "204": { + "description": "Action succeeded" + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Segments" + ], + "summary": "Update context targets on a big segment", + "description": "Update context targets included or excluded in a big segment. Big segments include larger list-based segments and synced segments. This operation does not support standard segments.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "segmentKey", + "in": "path", + "description": "The segment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The segment key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SegmentUserState" + } + } + }, + "required": true + }, + "operationId": "updateBigSegmentContextTargets" + } + }, + "/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/contexts/{contextKey}": { + "get": { + "responses": { + "200": { + "description": "Segment membership for context response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BigSegmentTarget" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Segments" + ], + "summary": "Get big segment membership for context", + "description": "Get the membership status (included/excluded) for a given context in this big segment. Big segments include larger list-based segments and synced segments. This operation does not support standard segments.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "segmentKey", + "in": "path", + "description": "The segment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The segment key" + } + }, + { + "name": "contextKey", + "in": "path", + "description": "The context key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The context key" + } + } + ], + "operationId": "getSegmentMembershipForContext" + } + }, + "/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/exports": { + "post": { + "responses": { + "200": { + "description": "Action succeeded" + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Segments (beta)" + ], + "summary": "Create big segment export", + "description": "Starts a new export process for a big segment. This is an export for a synced segment or a list-based segment that can include more than 15,000 entries.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "segmentKey", + "in": "path", + "description": "The segment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The segment key" + } + } + ], + "operationId": "createBigSegmentExport" + } + }, + "/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/exports/{exportID}": { + "get": { + "responses": { + "200": { + "description": "Segment export response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Export" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Segments (beta)" + ], + "summary": "Get big segment export", + "description": "Returns information about a big segment export process. This is an export for a synced segment or a list-based segment that can include more than 15,000 entries.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "segmentKey", + "in": "path", + "description": "The segment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The segment key" + } + }, + { + "name": "exportID", + "in": "path", + "description": "The export ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The export ID" + } + } + ], + "operationId": "getBigSegmentExport" + } + }, + "/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/imports": { + "post": { + "responses": { + "204": { + "description": "Import request submitted successfully" + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "409": { + "description": "Conflicting process", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Segments (beta)" + ], + "summary": "Create big segment import", + "description": "Start a new import process for a big segment. This is an import for a list-based segment that can include more than 15,000 entries.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "segmentKey", + "in": "path", + "description": "The segment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The segment key" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary", + "description": "CSV file containing keys" + }, + "mode": { + "type": "string", + "format": "string", + "description": "Import mode. Use either `merge` or `replace`" + } + } + } + } + }, + "required": true + }, + "operationId": "createBigSegmentImport" + } + }, + "/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/imports/{importID}": { + "get": { + "responses": { + "200": { + "description": "Segment import response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Import" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Segments (beta)" + ], + "summary": "Get big segment import", + "description": "Returns information about a big segment import process. This is the import of a list-based segment that can include more than 15,000 entries.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "segmentKey", + "in": "path", + "description": "The segment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The segment key" + } + }, + { + "name": "importID", + "in": "path", + "description": "The import ID", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The import ID" + } + } + ], + "operationId": "getBigSegmentImport" + } + }, + "/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/users": { + "post": { + "responses": { + "204": { + "description": "Action succeeded" + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Segments" + ], + "summary": "Update user context targets on a big segment", + "description": "Update user context targets included or excluded in a big segment. Big segments include larger list-based segments and synced segments. This operation does not support standard segments.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "segmentKey", + "in": "path", + "description": "The segment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The segment key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SegmentUserState" + } + } + }, + "required": true + }, + "operationId": "updateBigSegmentTargets" + } + }, + "/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/users/{userKey}": { + "get": { + "responses": { + "200": { + "description": "Segment membership for user response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BigSegmentTarget" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Segments" + ], + "summary": "Get big segment membership for user", + "description": "> ### Contexts are now available\n>\n> After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use [Get expiring targets for segment](/tag/Segments#operation/getExpiringTargetsForSegment) instead of this endpoint. To learn more, read [Contexts](https://docs.launchdarkly.com/home/contexts).\n\nGet the membership status (included/excluded) for a given user in this big segment. This operation does not support standard segments.\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "segmentKey", + "in": "path", + "description": "The segment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The segment key" + } + }, + { + "name": "userKey", + "in": "path", + "description": "The user key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The user key" + } + } + ], + "operationId": "getSegmentMembershipForUser" + } + }, + "/api/v2/segments/{projectKey}/{segmentKey}/expiring-targets/{environmentKey}": { + "get": { + "responses": { + "200": { + "description": "Expiring context target response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExpiringTargetGetResponse" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Segments" + ], + "summary": "Get expiring targets for segment", + "description": "Get a list of a segment's context targets that are scheduled for removal.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "segmentKey", + "in": "path", + "description": "The segment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The segment key" + } + } + ], + "operationId": "getExpiringTargetsForSegment" + }, + "patch": { + "responses": { + "200": { + "description": "Expiring target response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExpiringTargetPatchResponse" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Segments" + ], + "summary": "Update expiring targets for segment", + "description": "\nUpdate expiring context targets for a segment. Updating a context target expiration uses the semantic patch format.\n\nTo make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch).\n\nIf the request is well-formed but any of its instructions failed to process, this operation returns status code `200`. In this case, the response `errors` array will be non-empty.\n\n### Instructions\n\nSemantic patch requests support the following `kind` instructions for updating expiring context targets.\n\n
\nClick to expand instructions for updating expiring context targets\n\n#### addExpiringTarget\n\nSchedules a date and time when LaunchDarkly will remove a context from segment targeting. The segment must already have the context as an individual target.\n\n##### Parameters\n\n- `targetType`: The type of individual target for this context. Must be either `included` or `excluded`.\n- `contextKey`: The context key.\n- `contextKind`: The kind of context being targeted.\n- `value`: The date when the context should expire from the segment targeting, in Unix milliseconds.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"addExpiringTarget\",\n \"targetType\": \"included\",\n \"contextKey\": \"user-key-123abc\",\n \"contextKind\": \"user\",\n \"value\": 1754092860000\n }]\n}\n```\n\n#### updateExpiringTarget\n\nUpdates the date and time when LaunchDarkly will remove a context from segment targeting.\n\n##### Parameters\n\n- `targetType`: The type of individual target for this context. Must be either `included` or `excluded`.\n- `contextKey`: The context key.\n- `contextKind`: The kind of context being targeted.\n- `value`: The new date when the context should expire from the segment targeting, in Unix milliseconds.\n- `version`: (Optional) The version of the expiring target to update. If included, update will fail if version doesn't match current version of the expiring target.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"updateExpiringTarget\",\n \"targetType\": \"included\",\n \"contextKey\": \"user-key-123abc\",\n \"contextKind\": \"user\",\n \"value\": 1754179260000\n }]\n}\n```\n\n#### removeExpiringTarget\n\nRemoves the scheduled expiration for the context in the segment.\n\n##### Parameters\n\n- `targetType`: The type of individual target for this context. Must be either `included` or `excluded`.\n- `contextKey`: The context key.\n- `contextKind`: The kind of context being targeted.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"removeExpiringTarget\",\n \"targetType\": \"included\",\n \"contextKey\": \"user-key-123abc\",\n \"contextKind\": \"user\",\n }]\n}\n```\n\n
\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "segmentKey", + "in": "path", + "description": "The segment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The segment key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/patchSegmentExpiringTargetInputRep" + } + } + }, + "required": true + }, + "operationId": "patchExpiringTargetsForSegment" + } + }, + "/api/v2/segments/{projectKey}/{segmentKey}/expiring-user-targets/{environmentKey}": { + "get": { + "responses": { + "200": { + "description": "Expiring user target response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExpiringUserTargetGetResponse" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Segments" + ], + "summary": "Get expiring user targets for segment", + "description": "> ### Contexts are now available\n>\n> After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use [Get expiring targets for segment](/tag/Segments#operation/getExpiringTargetsForSegment) instead of this endpoint. To learn more, read [Contexts](https://docs.launchdarkly.com/home/contexts).\n\nGet a list of a segment's user targets that are scheduled for removal.\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "segmentKey", + "in": "path", + "description": "The segment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The segment key" + } + } + ], + "operationId": "getExpiringUserTargetsForSegment" + }, + "patch": { + "responses": { + "200": { + "description": "Expiring user target response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExpiringUserTargetPatchResponse" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Segments" + ], + "summary": "Update expiring user targets for segment", + "description": "\n> ### Contexts are now available\n>\n> After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use [Update expiring targets for segment](/tag/Segments#operation/patchExpiringTargetsForSegment) instead of this endpoint. To learn more, read [Contexts](https://docs.launchdarkly.com/home/contexts).\n\nUpdate expiring user targets for a segment. Updating a user target expiration uses the semantic patch format.\n\nTo make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch).\n\nIf the request is well-formed but any of its instructions failed to process, this operation returns status code `200`. In this case, the response `errors` array will be non-empty.\n\n### Instructions\n\nSemantic patch requests support the following `kind` instructions for updating expiring user targets.\n\n
\nClick to expand instructions for updating expiring user targets\n\n#### addExpireUserTargetDate\n\nSchedules a date and time when LaunchDarkly will remove a user from segment targeting.\n\n##### Parameters\n\n- `targetType`: A segment's target type, must be either `included` or `excluded`.\n- `userKey`: The user key.\n- `value`: The date when the user should expire from the segment targeting, in Unix milliseconds.\n\n#### updateExpireUserTargetDate\n\nUpdates the date and time when LaunchDarkly will remove a user from segment targeting.\n\n##### Parameters\n\n- `targetType`: A segment's target type, must be either `included` or `excluded`.\n- `userKey`: The user key.\n- `value`: The new date when the user should expire from the segment targeting, in Unix milliseconds.\n- `version`: The segment version.\n\n#### removeExpireUserTargetDate\n\nRemoves the scheduled expiration for the user in the segment.\n\n##### Parameters\n\n- `targetType`: A segment's target type, must be either `included` or `excluded`.\n- `userKey`: The user key.\n\n
\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "segmentKey", + "in": "path", + "description": "The segment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The segment key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/patchSegmentRequest" + } + } + }, + "required": true + }, + "operationId": "patchExpiringUserTargetsForSegment" + } + }, + "/api/v2/tags": { + "get": { + "responses": { + "200": { + "description": "Tag collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TagCollection" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Tags" + ], + "summary": "List tags", + "description": "Get a list of tags.", + "parameters": [ + { + "name": "kind", + "in": "query", + "description": "Fetch tags associated with the specified resource type. Options are `flag`, `project`, `environment`, `segment`. Returns all types by default.", + "schema": { + "type": "string", + "format": "string", + "description": "Fetch tags associated with the specified resource type. Options are `flag`, `project`, `environment`, `segment`. Returns all types by default." + } + }, + { + "name": "pre", + "in": "query", + "description": "Return tags with the specified prefix", + "schema": { + "type": "string", + "format": "string", + "description": "Return tags with the specified prefix" + } + }, + { + "name": "archived", + "in": "query", + "description": "Whether or not to return archived flags", + "schema": { + "type": "boolean", + "description": "Whether or not to return archived flags" + } + } + ], + "operationId": "getTags" + } + }, + "/api/v2/teams": { + "get": { + "responses": { + "200": { + "description": "Teams collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Teams" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "405": { + "description": "Method not allowed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MethodNotAllowedErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Teams" + ], + "summary": "List teams", + "description": "Return a list of teams.\n\nBy default, this returns the first 20 teams. Page through this list with the `limit` parameter and by following the `first`, `prev`, `next`, and `last` links in the `_links` field that returns. If those links do not appear, the pages they refer to don't exist. For example, the `first` and `prev` links will be missing from the response on the first page, because there is no previous page and you cannot return to the first page when you are already on the first page.\n\n### Filtering teams\n\nLaunchDarkly supports the following fields for filters:\n\n- `query` is a string that matches against the teams' names and keys. It is not case-sensitive.\n - A request with `query:abc` returns teams with the string `abc` in their name or key.\n- `nomembers` is a boolean that filters the list of teams who have 0 members\n - A request with `nomembers:true` returns teams that have 0 members\n - A request with `nomembers:false` returns teams that have 1 or more members\n\n### Expanding the teams response\nLaunchDarkly supports expanding several fields in the \"List teams\" response. By default, these fields are **not** included in the response.\n\nTo expand the response, append the `expand` query parameter and add a comma-separated list with any of the following fields:\n\n* `members` includes the total count of members that belong to the team.\n* `maintainers` includes a paginated list of the maintainers that you have assigned to the team.\n\nFor example, `expand=members,maintainers` includes the `members` and `maintainers` fields in the response.\n", + "parameters": [ + { + "name": "limit", + "in": "query", + "description": "The number of teams to return in the response. Defaults to 20.", + "schema": { + "type": "integer", + "format": "int64", + "description": "The number of teams to return in the response. Defaults to 20." + } + }, + { + "name": "offset", + "in": "query", + "description": "Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and returns the next `limit` items.", + "schema": { + "type": "integer", + "format": "int64", + "description": "Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and returns the next `limit` items." + } + }, + { + "name": "filter", + "in": "query", + "description": "A comma-separated list of filters. Each filter is constructed as `field:value`.", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of filters. Each filter is constructed as `field:value`." + } + }, + { + "name": "expand", + "in": "query", + "description": "A comma-separated list of properties that can reveal additional information in the response.", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of properties that can reveal additional information in the response." + } + } + ], + "operationId": "getTeams" + }, + "post": { + "responses": { + "201": { + "description": "Teams response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Team" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "405": { + "description": "Method not allowed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MethodNotAllowedErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Teams" + ], + "summary": "Create team", + "description": "Create a team. To learn more, read [Creating a team](https://docs.launchdarkly.com/home/teams/creating).\n\n### Expanding the teams response\nLaunchDarkly supports four fields for expanding the \"Create team\" response. By default, these fields are **not** included in the response.\n\nTo expand the response, append the `expand` query parameter and add a comma-separated list with any of the following fields:\n\n* `members` includes the total count of members that belong to the team.\n* `roles` includes a paginated list of the custom roles that you have assigned to the team.\n* `projects` includes a paginated list of the projects that the team has any write access to.\n* `maintainers` includes a paginated list of the maintainers that you have assigned to the team.\n\nFor example, `expand=members,roles` includes the `members` and `roles` fields in the response.\n", + "parameters": [ + { + "name": "expand", + "in": "query", + "description": "A comma-separated list of properties that can reveal additional information in the response. Supported fields are explained above.", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of properties that can reveal additional information in the response. Supported fields are explained above." + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/teamPostInput" + }, + "example": { + "customRoleKeys": [ + "example-role1", + "example-role2" + ], + "description": "An example team", + "key": "team-key-123abc", + "memberIDs": [ + "12ab3c45de678910fgh12345" + ], + "name": "Example team" + } + } + }, + "required": true + }, + "operationId": "postTeam" + }, + "patch": { + "responses": { + "200": { + "description": "Teams response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkEditTeamsRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Teams (beta)" + ], + "summary": "Update teams", + "description": "Perform a partial update to multiple teams. Updating teams uses the semantic patch format.\n\nTo make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch).\n\n### Instructions\n\nSemantic patch requests support the following `kind` instructions for updating teams.\n\n
\nClick to expand instructions for updating teams\n\n#### addMembersToTeams\n\nAdd the members to teams.\n\n##### Parameters\n\n- `memberIDs`: List of member IDs to add.\n- `teamKeys`: List of teams to update.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"addMembersToTeams\",\n \"memberIDs\": [\n \"1234a56b7c89d012345e678f\"\n ],\n \"teamKeys\": [\n \"example-team-1\",\n \"example-team-2\"\n ]\n }]\n}\n```\n\n#### addAllMembersToTeams\n\nAdd all members to the team. Members that match any of the filters are **excluded** from the update.\n\n##### Parameters\n\n- `teamKeys`: List of teams to update.\n- `filterLastSeen`: (Optional) A JSON object with one of the following formats:\n - `{\"never\": true}` - Members that have never been active, such as those who have not accepted their invitation to LaunchDarkly, or have not logged in after being provisioned via SCIM.\n - `{\"noData\": true}` - Members that have not been active since LaunchDarkly began recording last seen timestamps.\n - `{\"before\": 1608672063611}` - Members that have not been active since the provided value, which should be a timestamp in Unix epoch milliseconds.\n- `filterQuery`: (Optional) A string that matches against the members' emails and names. It is not case sensitive.\n- `filterRoles`: (Optional) A `|` separated list of roles and custom roles. For the purposes of this filtering, `Owner` counts as `Admin`.\n- `filterTeamKey`: (Optional) A string that matches against the key of the team the members belong to. It is not case sensitive.\n- `ignoredMemberIDs`: (Optional) A list of member IDs.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"addAllMembersToTeams\",\n \"teamKeys\": [\n \"example-team-1\",\n \"example-team-2\"\n ],\n \"filterLastSeen\": { \"never\": true }\n }]\n}\n```\n\n
\n", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/teamsPatchInput" + }, + "example": { + "comment": "Optional comment about the update", + "instructions": [ + { + "kind": "addMembersToTeams", + "memberIDs": [ + "1234a56b7c89d012345e678f" + ], + "teamKeys": [ + "example-team-1", + "example-team-2" + ] + } + ] + } + } + }, + "required": true + }, + "operationId": "patchTeams" + } + }, + "/api/v2/teams/{teamKey}": { + "get": { + "responses": { + "200": { + "description": "Teams response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Team" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "405": { + "description": "Method not allowed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MethodNotAllowedErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Teams" + ], + "summary": "Get team", + "description": "Fetch a team by key.\n\n### Expanding the teams response\nLaunchDarkly supports four fields for expanding the \"Get team\" response. By default, these fields are **not** included in the response.\n\nTo expand the response, append the `expand` query parameter and add a comma-separated list with any of the following fields:\n\n* `members` includes the total count of members that belong to the team.\n* `roles` includes a paginated list of the custom roles that you have assigned to the team.\n* `projects` includes a paginated list of the projects that the team has any write access to.\n* `maintainers` includes a paginated list of the maintainers that you have assigned to the team.\n\nFor example, `expand=members,roles` includes the `members` and `roles` fields in the response.\n", + "parameters": [ + { + "name": "teamKey", + "in": "path", + "description": "The team key.", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The team key." + } + }, + { + "name": "expand", + "in": "query", + "description": "A comma-separated list of properties that can reveal additional information in the response.", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of properties that can reveal additional information in the response." + } + } + ], + "operationId": "getTeam" + }, + "patch": { + "responses": { + "200": { + "description": "Teams response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Team" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "405": { + "description": "Method not allowed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MethodNotAllowedErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Teams" + ], + "summary": "Update team", + "description": "Perform a partial update to a team. Updating a team uses the semantic patch format.\n\nTo make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch).\n\n### Instructions\n\nSemantic patch requests support the following `kind` instructions for updating teams.\n\n
\nClick to expand instructions for updating teams\n\n#### addCustomRoles\n\nAdds custom roles to the team. Team members will have these custom roles granted to them.\n\n##### Parameters\n\n- `values`: List of custom role keys.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"addCustomRoles\",\n \"values\": [ \"example-custom-role\" ]\n }]\n}\n```\n\n#### removeCustomRoles\n\nRemoves custom roles from the team. The app will no longer grant these custom roles to the team members.\n\n##### Parameters\n\n- `values`: List of custom role keys.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"removeCustomRoles\",\n \"values\": [ \"example-custom-role\" ]\n }]\n}\n```\n\n#### addMembers\n\nAdds members to the team.\n\n##### Parameters\n\n- `values`: List of member IDs to add.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"addMembers\",\n \"values\": [ \"1234a56b7c89d012345e678f\", \"507f1f77bcf86cd799439011\" ]\n }]\n}\n```\n\n#### removeMembers\n\nRemoves members from the team.\n\n##### Parameters\n\n- `values`: List of member IDs to remove.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"removeMembers\",\n \"values\": [ \"1234a56b7c89d012345e678f\", \"507f1f77bcf86cd799439011\" ]\n }]\n}\n```\n\n#### replaceMembers\n\nReplaces the existing members of the team with the new members.\n\n##### Parameters\n\n- `values`: List of member IDs of the new members.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"replaceMembers\",\n \"values\": [ \"1234a56b7c89d012345e678f\", \"507f1f77bcf86cd799439011\" ]\n }]\n}\n```\n\n#### addPermissionGrants\n\nAdds permission grants to members for the team. For example, a permission grant could allow a member to act as a team maintainer. A permission grant may have either an `actionSet` or a list of `actions` but not both at the same time. The members do not have to be team members to have a permission grant for the team.\n\n##### Parameters\n\n- `actionSet`: Name of the action set.\n- `actions`: List of actions.\n- `memberIDs`: List of member IDs.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"addPermissionGrants\",\n \"actions\": [ \"updateTeamName\", \"updateTeamDescription\" ],\n \"memberIDs\": [ \"1234a56b7c89d012345e678f\", \"507f1f77bcf86cd799439011\" ]\n }]\n}\n```\n\n#### removePermissionGrants\n\nRemoves permission grants from members for the team. A permission grant may have either an `actionSet` or a list of `actions` but not both at the same time. The `actionSet` and `actions` must match an existing permission grant.\n\n##### Parameters\n\n- `actionSet`: Name of the action set.\n- `actions`: List of actions.\n- `memberIDs`: List of member IDs.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"removePermissionGrants\",\n \"actions\": [ \"updateTeamName\", \"updateTeamDescription\" ],\n \"memberIDs\": [ \"1234a56b7c89d012345e678f\", \"507f1f77bcf86cd799439011\" ]\n }]\n}\n```\n\n#### updateDescription\n\nUpdates the description of the team.\n\n##### Parameters\n\n- `value`: The new description.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"updateDescription\",\n \"value\": \"Updated team description\"\n }]\n}\n```\n\n#### updateName\n\nUpdates the name of the team.\n\n##### Parameters\n\n- `value`: The new name.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"updateName\",\n \"value\": \"Updated team name\"\n }]\n}\n```\n\n
\n\n### Expanding the teams response\nLaunchDarkly supports four fields for expanding the \"Update team\" response. By default, these fields are **not** included in the response.\n\nTo expand the response, append the `expand` query parameter and add a comma-separated list with any of the following fields:\n\n* `members` includes the total count of members that belong to the team.\n* `roles` includes a paginated list of the custom roles that you have assigned to the team.\n* `projects` includes a paginated list of the projects that the team has any write access to.\n* `maintainers` includes a paginated list of the maintainers that you have assigned to the team.\n\nFor example, `expand=members,roles` includes the `members` and `roles` fields in the response.\n", + "parameters": [ + { + "name": "teamKey", + "in": "path", + "description": "The team key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The team key" + } + }, + { + "name": "expand", + "in": "query", + "description": "A comma-separated list of properties that can reveal additional information in the response. Supported fields are explained above.", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of properties that can reveal additional information in the response. Supported fields are explained above." + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/teamPatchInput" + }, + "example": { + "comment": "Optional comment about the update", + "instructions": [ + { + "kind": "updateDescription", + "value": "New description for the team" + } + ] + } + } + }, + "required": true + }, + "operationId": "patchTeam" + }, + "delete": { + "responses": { + "204": { + "description": "Action succeeded" + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Teams" + ], + "summary": "Delete team", + "description": "Delete a team by key. To learn more, read [Deleting a team](https://docs.launchdarkly.com/home/teams/managing#deleting-a-team).", + "parameters": [ + { + "name": "teamKey", + "in": "path", + "description": "The team key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The team key" + } + } + ], + "operationId": "deleteTeam" + } + }, + "/api/v2/teams/{teamKey}/maintainers": { + "get": { + "responses": { + "200": { + "description": "Team maintainers response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TeamMaintainers" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "405": { + "description": "Method not allowed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MethodNotAllowedErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Teams" + ], + "summary": "Get team maintainers", + "description": "Fetch the maintainers that have been assigned to the team. To learn more, read [Managing team maintainers](https://docs.launchdarkly.com/home/teams/managing#managing-team-maintainers).", + "parameters": [ + { + "name": "teamKey", + "in": "path", + "description": "The team key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The team key" + } + }, + { + "name": "limit", + "in": "query", + "description": "The number of maintainers to return in the response. Defaults to 20.", + "schema": { + "type": "integer", + "format": "int64", + "description": "The number of maintainers to return in the response. Defaults to 20." + } + }, + { + "name": "offset", + "in": "query", + "description": "Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.", + "schema": { + "type": "integer", + "format": "int64", + "description": "Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`." + } + } + ], + "operationId": "getTeamMaintainers" + } + }, + "/api/v2/teams/{teamKey}/members": { + "post": { + "responses": { + "201": { + "description": "Team member imports response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TeamImportsRep" + } + } + } + }, + "207": { + "description": "Partial Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TeamImportsRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "405": { + "description": "Method not allowed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MethodNotAllowedErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Teams" + ], + "summary": "Add multiple members to team", + "description": "Add multiple members to an existing team by uploading a CSV file of member email addresses. Your CSV file must include email addresses in the first column. You can include data in additional columns, but LaunchDarkly ignores all data outside the first column. Headers are optional. To learn more, read [Managing team members](https://docs.launchdarkly.com/home/teams/managing#managing-team-members).\n\n**Members are only added on a `201` response.** A `207` indicates the CSV file contains a combination of valid and invalid entries. A `207` results in no members being added to the team.\n\nOn a `207` response, if an entry contains bad input, the `message` field contains the row number as well as the reason for the error. The `message` field is omitted if the entry is valid.\n\nExample `207` response:\n```json\n{\n \"items\": [\n {\n \"status\": \"success\",\n \"value\": \"new-team-member@acme.com\"\n },\n {\n \"message\": \"Line 2: empty row\",\n \"status\": \"error\",\n \"value\": \"\"\n },\n {\n \"message\": \"Line 3: email already exists in the specified team\",\n \"status\": \"error\",\n \"value\": \"existing-team-member@acme.com\"\n },\n {\n \"message\": \"Line 4: invalid email formatting\",\n \"status\": \"error\",\n \"value\": \"invalid email format\"\n }\n ]\n}\n```\n\nMessage | Resolution\n--- | ---\nEmpty row | This line is blank. Add an email address and try again.\nDuplicate entry | This email address appears in the file twice. Remove the email from the file and try again.\nEmail already exists in the specified team | This member is already on your team. Remove the email from the file and try again.\nInvalid formatting | This email address is not formatted correctly. Fix the formatting and try again.\nEmail does not belong to a LaunchDarkly member | The email address doesn't belong to a LaunchDarkly account member. Invite them to LaunchDarkly, then re-add them to the team.\n\nOn a `400` response, the `message` field may contain errors specific to this endpoint.\n\nExample `400` response:\n```json\n{\n \"code\": \"invalid_request\",\n \"message\": \"Unable to process file\"\n}\n```\n\nMessage | Resolution\n--- | ---\nUnable to process file | LaunchDarkly could not process the file for an unspecified reason. Review your file for errors and try again.\nFile exceeds 25mb | Break up your file into multiple files of less than 25mbs each.\nAll emails have invalid formatting | None of the email addresses in the file are in the correct format. Fix the formatting and try again.\nAll emails belong to existing team members | All listed members are already on this team. Populate the file with member emails that do not belong to the team and try again.\nFile is empty | The CSV file does not contain any email addresses. Populate the file and try again.\nNo emails belong to members of your LaunchDarkly organization | None of the email addresses belong to members of your LaunchDarkly account. Invite these members to LaunchDarkly, then re-add them to the team.\n", + "parameters": [ + { + "name": "teamKey", + "in": "path", + "description": "The team key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The team key" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary", + "description": "CSV file containing email addresses" + } + } + } + } + }, + "required": true + }, + "operationId": "postTeamMembers" + } + }, + "/api/v2/teams/{teamKey}/roles": { + "get": { + "responses": { + "200": { + "description": "Team roles response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TeamCustomRoles" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "405": { + "description": "Method not allowed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MethodNotAllowedErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Teams" + ], + "summary": "Get team custom roles", + "description": "Fetch the custom roles that have been assigned to the team. To learn more, read [Managing team permissions](https://docs.launchdarkly.com/home/teams/managing#managing-team-permissions).", + "parameters": [ + { + "name": "teamKey", + "in": "path", + "description": "The team key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The team key" + } + }, + { + "name": "limit", + "in": "query", + "description": "The number of roles to return in the response. Defaults to 20.", + "schema": { + "type": "integer", + "format": "int64", + "description": "The number of roles to return in the response. Defaults to 20." + } + }, + { + "name": "offset", + "in": "query", + "description": "Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.", + "schema": { + "type": "integer", + "format": "int64", + "description": "Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`." + } + } + ], + "operationId": "getTeamRoles" + } + }, + "/api/v2/templates": { + "get": { + "responses": { + "200": { + "description": "Workflow templates list response JSON", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WorkflowTemplatesListingOutputRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Workflow templates" + ], + "summary": "Get workflow templates", + "description": "Get workflow templates belonging to an account, or can optionally return templates_endpoints.workflowTemplateSummariesListingOutputRep when summary query param is true", + "parameters": [ + { + "name": "summary", + "in": "query", + "description": "Whether the entire template object or just a summary should be returned", + "schema": { + "type": "boolean", + "description": "Whether the entire template object or just a summary should be returned" + } + }, + { + "name": "search", + "in": "query", + "description": "The substring in either the name or description of a template", + "schema": { + "type": "string", + "format": "string", + "description": "The substring in either the name or description of a template" + } + } + ], + "operationId": "getWorkflowTemplates" + }, + "post": { + "responses": { + "201": { + "description": "Workflow template response JSON", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WorkflowTemplateOutput" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Workflow templates" + ], + "summary": "Create workflow template", + "description": "Create a template for a feature flag workflow", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateWorkflowTemplateInput" + } + } + }, + "required": true + }, + "operationId": "createWorkflowTemplate" + } + }, + "/api/v2/templates/{templateKey}": { + "delete": { + "responses": { + "204": { + "description": "Action completed successfully" + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Workflow templates" + ], + "summary": "Delete workflow template", + "description": "Delete a workflow template", + "parameters": [ + { + "name": "templateKey", + "in": "path", + "description": "The template key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The template key" + } + } + ], + "operationId": "deleteWorkflowTemplate" + } + }, + "/api/v2/tokens": { + "get": { + "responses": { + "200": { + "description": "Access tokens collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Tokens" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Access tokens" + ], + "summary": "List access tokens", + "description": "Fetch a list of all access tokens.", + "parameters": [ + { + "name": "showAll", + "in": "query", + "description": "If set to true, and the authentication access token has the 'Admin' role, personal access tokens for all members will be retrieved.", + "schema": { + "type": "boolean", + "description": "If set to true, and the authentication access token has the 'Admin' role, personal access tokens for all members will be retrieved." + } + }, + { + "name": "limit", + "in": "query", + "description": "The number of access tokens to return in the response. Defaults to 25.", + "schema": { + "type": "integer", + "format": "int64", + "description": "The number of access tokens to return in the response. Defaults to 25." + } + }, + { + "name": "offset", + "in": "query", + "description": "Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.", + "schema": { + "type": "integer", + "format": "int64", + "description": "Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`." + } + } + ], + "operationId": "getTokens" + }, + "post": { + "responses": { + "201": { + "description": "Access token response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Token" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Access tokens" + ], + "summary": "Create access token", + "description": "Create a new access token.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccessTokenPost" + }, + "example": { + "role": "reader" + } + } + }, + "required": true + }, + "operationId": "postToken" + } + }, + "/api/v2/tokens/{id}": { + "get": { + "responses": { + "200": { + "description": "Access token response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Token" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Access tokens" + ], + "summary": "Get access token", + "description": "Get a single access token by ID.", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID of the access token", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The ID of the access token" + } + } + ], + "operationId": "getToken" + }, + "patch": { + "responses": { + "200": { + "description": "Access token response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Token" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "422": { + "description": "Invalid patch content", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchFailedErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Access tokens" + ], + "summary": "Patch access token", + "description": "Update an access token's settings. Updating an access token uses a [JSON patch](https://datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes. To learn more, read [Updates](/#section/Overview/Updates).", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID of the access token to update", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The ID of the access token to update" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JSONPatch" + }, + "example": [ + { + "op": "replace", + "path": "/role", + "value": "writer" + } + ] + } + }, + "required": true + }, + "operationId": "patchToken" + }, + "delete": { + "responses": { + "204": { + "description": "Action succeeded" + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Access tokens" + ], + "summary": "Delete access token", + "description": "Delete an access token by ID.", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID of the access token to update", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The ID of the access token to update" + } + } + ], + "operationId": "deleteToken" + } + }, + "/api/v2/tokens/{id}/reset": { + "post": { + "responses": { + "200": { + "description": "Access token response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Token" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Access tokens" + ], + "summary": "Reset access token", + "description": "Reset an access token's secret key with an optional expiry time for the old key.", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID of the access token to update", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The ID of the access token to update" + } + }, + { + "name": "expiry", + "in": "query", + "description": "An expiration time for the old token key, expressed as a Unix epoch time in milliseconds. By default, the token will expire immediately.", + "schema": { + "type": "integer", + "format": "int64", + "description": "An expiration time for the old token key, expressed as a Unix epoch time in milliseconds. By default, the token will expire immediately." + } + } + ], + "operationId": "resetToken" + } + }, + "/api/v2/usage/data-export-events": { + "get": { + "responses": { + "200": { + "description": "Usage response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SeriesIntervalsRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + }, + "503": { + "description": "Service unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusServiceUnavailable" + } + } + } + } + }, + "tags": [ + "Account usage (beta)" + ], + "summary": "Get data export events usage", + "description": "Get a time-series array of the number of monthly data export events from your account. The granularity is always daily, with a maximum of 31 days.", + "parameters": [ + { + "name": "from", + "in": "query", + "description": "The series of data returned starts from this timestamp (Unix seconds). Defaults to the beginning of the current month.", + "schema": { + "type": "string", + "format": "string", + "description": "The series of data returned starts from this timestamp (Unix seconds). Defaults to the beginning of the current month." + } + }, + { + "name": "to", + "in": "query", + "description": "The series of data returned ends at this timestamp (Unix seconds). Defaults to the current time.", + "schema": { + "type": "string", + "format": "string", + "description": "The series of data returned ends at this timestamp (Unix seconds). Defaults to the current time." + } + } + ], + "operationId": "getDataExportEventsUsage" + } + }, + "/api/v2/usage/evaluations/{projectKey}/{environmentKey}/{featureFlagKey}": { + "get": { + "responses": { + "200": { + "description": "Usage response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SeriesListRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Account usage (beta)" + ], + "summary": "Get evaluations usage", + "description": "Get time-series arrays of the number of times a flag is evaluated, broken down by the variation that resulted from that evaluation. The granularity of the data depends on the age of the data requested. If the requested range is within the past two hours, minutely data is returned. If it is within the last two days, hourly data is returned. Otherwise, daily data is returned.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + }, + { + "name": "from", + "in": "query", + "description": "The series of data returned starts from this timestamp. Defaults to 30 days ago.", + "schema": { + "type": "string", + "format": "string", + "description": "The series of data returned starts from this timestamp. Defaults to 30 days ago." + } + }, + { + "name": "to", + "in": "query", + "description": "The series of data returned ends at this timestamp. Defaults to the current time.", + "schema": { + "type": "string", + "format": "string", + "description": "The series of data returned ends at this timestamp. Defaults to the current time." + } + }, + { + "name": "tz", + "in": "query", + "description": "The timezone to use for breaks between days when returning daily data.", + "schema": { + "type": "string", + "format": "string", + "description": "The timezone to use for breaks between days when returning daily data." + } + } + ], + "operationId": "getEvaluationsUsage" + } + }, + "/api/v2/usage/events/{type}": { + "get": { + "responses": { + "200": { + "description": "Usage response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SeriesListRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Account usage (beta)" + ], + "summary": "Get events usage", + "description": "Get time-series arrays of the number of times a flag is evaluated, broken down by the variation that resulted from that evaluation. The granularity of the data depends on the age of the data requested. If the requested range is within the past two hours, minutely data is returned. If it is within the last two days, hourly data is returned. Otherwise, daily data is returned.", + "parameters": [ + { + "name": "type", + "in": "path", + "description": "The type of event to retrieve. Must be either `received` or `published`.", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The type of event to retrieve. Must be either `received` or `published`." + } + }, + { + "name": "from", + "in": "query", + "description": "The series of data returned starts from this timestamp. Defaults to 24 hours ago.", + "schema": { + "type": "string", + "format": "string", + "description": "The series of data returned starts from this timestamp. Defaults to 24 hours ago." + } + }, + { + "name": "to", + "in": "query", + "description": "The series of data returned ends at this timestamp. Defaults to the current time.", + "schema": { + "type": "string", + "format": "string", + "description": "The series of data returned ends at this timestamp. Defaults to the current time." + } + } + ], + "operationId": "getEventsUsage" + } + }, + "/api/v2/usage/experimentation-keys": { + "get": { + "responses": { + "200": { + "description": "Usage response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SeriesIntervalsRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + }, + "503": { + "description": "Service unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusServiceUnavailable" + } + } + } + } + }, + "tags": [ + "Account usage (beta)" + ], + "summary": "Get experimentation keys usage", + "description": "Get a time-series array of the number of monthly experimentation keys from your account. The granularity is always daily, with a maximum of 31 days.", + "parameters": [ + { + "name": "from", + "in": "query", + "description": "The series of data returned starts from this timestamp (Unix seconds). Defaults to the beginning of the current month.", + "schema": { + "type": "string", + "format": "string", + "description": "The series of data returned starts from this timestamp (Unix seconds). Defaults to the beginning of the current month." + } + }, + { + "name": "to", + "in": "query", + "description": "The series of data returned ends at this timestamp (Unix seconds). Defaults to the current time.", + "schema": { + "type": "string", + "format": "string", + "description": "The series of data returned ends at this timestamp (Unix seconds). Defaults to the current time." + } + } + ], + "operationId": "getExperimentationKeysUsage" + } + }, + "/api/v2/usage/experimentation-units": { + "get": { + "responses": { + "200": { + "description": "Usage response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SeriesIntervalsRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + }, + "503": { + "description": "Service unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusServiceUnavailable" + } + } + } + } + }, + "tags": [ + "Account usage (beta)" + ], + "summary": "Get experimentation units usage", + "description": "Get a time-series array of the number of monthly experimentation units from your account. The granularity is always daily, with a maximum of 31 days.", + "parameters": [ + { + "name": "from", + "in": "query", + "description": "The series of data returned starts from this timestamp (Unix seconds). Defaults to the beginning of the current month.", + "schema": { + "type": "string", + "format": "string", + "description": "The series of data returned starts from this timestamp (Unix seconds). Defaults to the beginning of the current month." + } + }, + { + "name": "to", + "in": "query", + "description": "The series of data returned ends at this timestamp (Unix seconds). Defaults to the current time.", + "schema": { + "type": "string", + "format": "string", + "description": "The series of data returned ends at this timestamp (Unix seconds). Defaults to the current time." + } + } + ], + "operationId": "getExperimentationUnitsUsage" + } + }, + "/api/v2/usage/mau": { + "get": { + "responses": { + "200": { + "description": "Usage response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SeriesListRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Account usage (beta)" + ], + "summary": "Get MAU usage", + "description": "Get a time-series array of the number of monthly active users (MAU) seen by LaunchDarkly from your account. The granularity is always daily.

Endpoints for retrieving monthly active users (MAU) do not return information about active context instances. After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should not rely on this endpoint. To learn more, read [Account usage metrics](https://docs.launchdarkly.com/home/billing/usage-metrics).", + "parameters": [ + { + "name": "from", + "in": "query", + "description": "The series of data returned starts from this timestamp. Defaults to 30 days ago.", + "schema": { + "type": "string", + "format": "string", + "description": "The series of data returned starts from this timestamp. Defaults to 30 days ago." + } + }, + { + "name": "to", + "in": "query", + "description": "The series of data returned ends at this timestamp. Defaults to the current time.", + "schema": { + "type": "string", + "format": "string", + "description": "The series of data returned ends at this timestamp. Defaults to the current time." + } + }, + { + "name": "project", + "in": "query", + "description": "A project key to filter results to. Can be specified multiple times, one query parameter per project key, to view data for multiple projects.", + "schema": { + "type": "string", + "format": "string", + "description": "A project key to filter results to. Can be specified multiple times, one query parameter per project key, to view data for multiple projects." + } + }, + { + "name": "environment", + "in": "query", + "description": "An environment key to filter results to. When using this parameter, exactly one project key must also be set. Can be specified multiple times as separate query parameters to view data for multiple environments within a single project.", + "schema": { + "type": "string", + "format": "string", + "description": "An environment key to filter results to. When using this parameter, exactly one project key must also be set. Can be specified multiple times as separate query parameters to view data for multiple environments within a single project." + } + }, + { + "name": "sdktype", + "in": "query", + "description": "An SDK type to filter results to. Can be specified multiple times, one query parameter per SDK type. Valid values: client, server", + "schema": { + "type": "string", + "format": "string", + "description": "An SDK type to filter results to. Can be specified multiple times, one query parameter per SDK type. Valid values: client, server" + } + }, + { + "name": "sdk", + "in": "query", + "description": "An SDK name to filter results to. Can be specified multiple times, one query parameter per SDK.", + "schema": { + "type": "string", + "format": "string", + "description": "An SDK name to filter results to. Can be specified multiple times, one query parameter per SDK." + } + }, + { + "name": "anonymous", + "in": "query", + "description": "If specified, filters results to either anonymous or nonanonymous users.", + "schema": { + "type": "string", + "format": "string", + "description": "If specified, filters results to either anonymous or nonanonymous users." + } + }, + { + "name": "groupby", + "in": "query", + "description": "If specified, returns data for each distinct value of the given field. Can be specified multiple times to group data by multiple dimensions (for example, to group by both project and SDK). Valid values: project, environment, sdktype, sdk, anonymous", + "schema": { + "type": "string", + "format": "string", + "description": "If specified, returns data for each distinct value of the given field. Can be specified multiple times to group data by multiple dimensions (for example, to group by both project and SDK). Valid values: project, environment, sdktype, sdk, anonymous" + } + } + ], + "operationId": "getMauUsage" + } + }, + "/api/v2/usage/mau/bycategory": { + "get": { + "responses": { + "200": { + "description": "Usage response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SeriesListRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Account usage (beta)" + ], + "summary": "Get MAU usage by category", + "description": "Get time-series arrays of the number of monthly active users (MAU) seen by LaunchDarkly from your account, broken down by the category of users. The category is either `browser`, `mobile`, or `backend`.

Endpoints for retrieving monthly active users (MAU) do not return information about active context instances. After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should not rely on this endpoint. To learn more, read [Account usage metrics](https://docs.launchdarkly.com/home/billing/usage-metrics).", + "parameters": [ + { + "name": "from", + "in": "query", + "description": "The series of data returned starts from this timestamp. Defaults to 30 days ago.", + "schema": { + "type": "string", + "format": "string", + "description": "The series of data returned starts from this timestamp. Defaults to 30 days ago." + } + }, + { + "name": "to", + "in": "query", + "description": "The series of data returned ends at this timestamp. Defaults to the current time.", + "schema": { + "type": "string", + "format": "string", + "description": "The series of data returned ends at this timestamp. Defaults to the current time." + } + } + ], + "operationId": "getMauUsageByCategory" + } + }, + "/api/v2/usage/mau/sdks": { + "get": { + "responses": { + "200": { + "description": "MAU SDKs response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SdkListRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Account usage (beta)" + ], + "summary": "Get MAU SDKs by type", + "description": "Get a list of SDKs. These are all of the SDKs that have connected to LaunchDarkly by monthly active users (MAU) in the requested time period.

Endpoints for retrieving monthly active users (MAU) do not return information about active context instances. After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should not rely on this endpoint. To learn more, read [Account usage metrics](https://docs.launchdarkly.com/home/billing/usage-metrics).", + "parameters": [ + { + "name": "from", + "in": "query", + "description": "The data returned starts from this timestamp. Defaults to seven days ago. The timestamp is in Unix milliseconds, for example, 1656694800000.", + "schema": { + "type": "string", + "format": "string", + "description": "The data returned starts from this timestamp. Defaults to seven days ago. The timestamp is in Unix milliseconds, for example, 1656694800000." + } + }, + { + "name": "to", + "in": "query", + "description": "The data returned ends at this timestamp. Defaults to the current time. The timestamp is in Unix milliseconds, for example, 1657904400000.", + "schema": { + "type": "string", + "format": "string", + "description": "The data returned ends at this timestamp. Defaults to the current time. The timestamp is in Unix milliseconds, for example, 1657904400000." + } + }, + { + "name": "sdktype", + "in": "query", + "description": "The type of SDK with monthly active users (MAU) to list. Must be either `client` or `server`.", + "schema": { + "type": "string", + "format": "string", + "description": "The type of SDK with monthly active users (MAU) to list. Must be either `client` or `server`." + } + } + ], + "operationId": "getMauSdksByType" + } + }, + "/api/v2/usage/service-connections": { + "get": { + "responses": { + "200": { + "description": "Usage response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SeriesIntervalsRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + }, + "503": { + "description": "Service unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusServiceUnavailable" + } + } + } + } + }, + "tags": [ + "Account usage (beta)" + ], + "summary": "Get service connection usage", + "description": "Get a time-series array of the number of monthly service connections from your account. The granularity is always daily, with a maximum of 31 days.", + "parameters": [ + { + "name": "from", + "in": "query", + "description": "The series of data returned starts from this timestamp (Unix seconds). Defaults to the beginning of the current month.", + "schema": { + "type": "string", + "format": "string", + "description": "The series of data returned starts from this timestamp (Unix seconds). Defaults to the beginning of the current month." + } + }, + { + "name": "to", + "in": "query", + "description": "The series of data returned ends at this timestamp (Unix seconds). Defaults to the current time.", + "schema": { + "type": "string", + "format": "string", + "description": "The series of data returned ends at this timestamp (Unix seconds). Defaults to the current time." + } + } + ], + "operationId": "getServiceConnectionUsage" + } + }, + "/api/v2/usage/streams/{source}": { + "get": { + "responses": { + "200": { + "description": "Usage response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SeriesListRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Account usage (beta)" + ], + "summary": "Get stream usage", + "description": "Get a time-series array of the number of streaming connections to LaunchDarkly in each time period. The granularity of the data depends on the age of the data requested. If the requested range is within the past two hours, minutely data is returned. If it is within the last two days, hourly data is returned. Otherwise, daily data is returned.", + "parameters": [ + { + "name": "source", + "in": "path", + "description": "The source of streaming connections to describe. Must be either `client` or `server`.", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The source of streaming connections to describe. Must be either `client` or `server`." + } + }, + { + "name": "from", + "in": "query", + "description": "The series of data returned starts from this timestamp. Defaults to 30 days ago.", + "schema": { + "type": "string", + "format": "string", + "description": "The series of data returned starts from this timestamp. Defaults to 30 days ago." + } + }, + { + "name": "to", + "in": "query", + "description": "The series of data returned ends at this timestamp. Defaults to the current time.", + "schema": { + "type": "string", + "format": "string", + "description": "The series of data returned ends at this timestamp. Defaults to the current time." + } + }, + { + "name": "tz", + "in": "query", + "description": "The timezone to use for breaks between days when returning daily data.", + "schema": { + "type": "string", + "format": "string", + "description": "The timezone to use for breaks between days when returning daily data." + } + } + ], + "operationId": "getStreamUsage" + } + }, + "/api/v2/usage/streams/{source}/bysdkversion": { + "get": { + "responses": { + "200": { + "description": "Usage response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SeriesListRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Account usage (beta)" + ], + "summary": "Get stream usage by SDK version", + "description": "Get multiple series of the number of streaming connections to LaunchDarkly in each time period, separated by SDK type and version. Information about each series is in the metadata array. The granularity of the data depends on the age of the data requested. If the requested range is within the past 2 hours, minutely data is returned. If it is within the last two days, hourly data is returned. Otherwise, daily data is returned.", + "parameters": [ + { + "name": "source", + "in": "path", + "description": "The source of streaming connections to describe. Must be either `client` or `server`.", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The source of streaming connections to describe. Must be either `client` or `server`." + } + }, + { + "name": "from", + "in": "query", + "description": "The series of data returned starts from this timestamp. Defaults to 24 hours ago.", + "schema": { + "type": "string", + "format": "string", + "description": "The series of data returned starts from this timestamp. Defaults to 24 hours ago." + } + }, + { + "name": "to", + "in": "query", + "description": "The series of data returned ends at this timestamp. Defaults to the current time.", + "schema": { + "type": "string", + "format": "string", + "description": "The series of data returned ends at this timestamp. Defaults to the current time." + } + }, + { + "name": "tz", + "in": "query", + "description": "The timezone to use for breaks between days when returning daily data.", + "schema": { + "type": "string", + "format": "string", + "description": "The timezone to use for breaks between days when returning daily data." + } + }, + { + "name": "sdk", + "in": "query", + "description": "If included, this filters the returned series to only those that match this SDK name.", + "schema": { + "type": "string", + "format": "string", + "description": "If included, this filters the returned series to only those that match this SDK name." + } + }, + { + "name": "version", + "in": "query", + "description": "If included, this filters the returned series to only those that match this SDK version.", + "schema": { + "type": "string", + "format": "string", + "description": "If included, this filters the returned series to only those that match this SDK version." + } + } + ], + "operationId": "getStreamUsageBySdkVersion" + } + }, + "/api/v2/usage/streams/{source}/sdkversions": { + "get": { + "responses": { + "200": { + "description": "SDK Versions response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SdkVersionListRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Account usage (beta)" + ], + "summary": "Get stream usage SDK versions", + "description": "Get a list of SDK version objects, which contain an SDK name and version. These are all of the SDKs that have connected to LaunchDarkly from your account in the past 60 days.", + "parameters": [ + { + "name": "source", + "in": "path", + "description": "The source of streaming connections to describe. Must be either `client` or `server`.", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The source of streaming connections to describe. Must be either `client` or `server`." + } + } + ], + "operationId": "getStreamUsageSdkversion" + } + }, + "/api/v2/user-attributes/{projectKey}/{environmentKey}": { + "get": { + "responses": { + "200": { + "description": "User attribute names response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserAttributeNamesRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + } + }, + "tags": [ + "Users (beta)" + ], + "summary": "Get user attribute names", + "description": "> ### Use contexts instead\n>\n> After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use [Get context attribute names\n](/tag/Contexts#operation/getContextAttributeNames) instead of this endpoint.\n\nGet all in-use user attributes in the specified environment. The set of in-use attributes typically consists of all attributes seen within the past 30 days.\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + } + ], + "operationId": "getUserAttributeNames", + "deprecated": true + } + }, + "/api/v2/user-search/{projectKey}/{environmentKey}": { + "get": { + "responses": { + "200": { + "description": "Users collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Users" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Users" + ], + "summary": "Find users", + "description": "> ### Use contexts instead\n>\n> After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use [Search for context instances](/tag/Contexts#operation/searchContextInstances) instead of this endpoint.\n\nSearch users in LaunchDarkly based on their last active date, a user attribute filter set, or a search query.\n\nAn example user attribute filter set is `filter=firstName:Anna,activeTrial:false`. This matches users that have the user attribute `firstName` set to `Anna`, that also have the attribute `activeTrial` set to `false`.\n\nTo paginate through results, follow the `next` link in the `_links` object. To learn more, read [Representations](/#section/Representations).\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "q", + "in": "query", + "description": "Full-text search for users based on name, first name, last name, e-mail address, or key", + "schema": { + "type": "string", + "format": "string", + "description": "Full-text search for users based on name, first name, last name, e-mail address, or key" + } + }, + { + "name": "limit", + "in": "query", + "description": "Specifies the maximum number of items in the collection to return (max: 50, default: 20)", + "schema": { + "type": "integer", + "format": "int64", + "description": "Specifies the maximum number of items in the collection to return (max: 50, default: 20)" + } + }, + { + "name": "offset", + "in": "query", + "description": "Deprecated, use `searchAfter` instead. Specifies the first item to return in the collection.", + "deprecated": true, + "schema": { + "type": "integer", + "format": "int64", + "description": "Deprecated, use `searchAfter` instead. Specifies the first item to return in the collection." + } + }, + { + "name": "after", + "in": "query", + "description": "A Unix epoch time in milliseconds specifying the maximum last time a user requested a feature flag from LaunchDarkly", + "schema": { + "type": "integer", + "format": "int64", + "description": "A Unix epoch time in milliseconds specifying the maximum last time a user requested a feature flag from LaunchDarkly" + } + }, + { + "name": "sort", + "in": "query", + "description": "Specifies a field by which to sort. LaunchDarkly supports the `userKey` and `lastSeen` fields. Fields prefixed by a dash ( - ) sort in descending order.", + "schema": { + "type": "string", + "format": "string", + "description": "Specifies a field by which to sort. LaunchDarkly supports the `userKey` and `lastSeen` fields. Fields prefixed by a dash ( - ) sort in descending order." + } + }, + { + "name": "searchAfter", + "in": "query", + "description": "Limits results to users with sort values after the value you specify. You can use this for pagination, but we recommend using the `next` link we provide instead.", + "schema": { + "type": "string", + "format": "string", + "description": "Limits results to users with sort values after the value you specify. You can use this for pagination, but we recommend using the `next` link we provide instead." + } + }, + { + "name": "filter", + "in": "query", + "description": "A comma-separated list of user attribute filters. Each filter is in the form of attributeKey:attributeValue", + "schema": { + "type": "string", + "format": "string", + "description": "A comma-separated list of user attribute filters. Each filter is in the form of attributeKey:attributeValue" + } + } + ], + "operationId": "getSearchUsers", + "deprecated": true + } + }, + "/api/v2/users/{projectKey}/{environmentKey}": { + "get": { + "responses": { + "200": { + "description": "Users collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UsersRep" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Users" + ], + "summary": "List users", + "description": "> ### Use contexts instead\n>\n> After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use [Search for contexts](/tag/Contexts#operation/searchContexts) instead of this endpoint.\n\nList all users in the environment. Includes the total count of users. This is useful for exporting all users in the system for further analysis.\n\nEach page displays users up to a set `limit`. The default is 20. To page through, follow the `next` link in the `_links` object. To learn more, read [Representations](/#section/Representations).\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "limit", + "in": "query", + "description": "The number of elements to return per page", + "schema": { + "type": "integer", + "format": "int64", + "description": "The number of elements to return per page" + } + }, + { + "name": "searchAfter", + "in": "query", + "description": "Limits results to users with sort values after the value you specify. You can use this for pagination, but we recommend using the `next` link we provide instead.", + "schema": { + "type": "string", + "format": "string", + "description": "Limits results to users with sort values after the value you specify. You can use this for pagination, but we recommend using the `next` link we provide instead." + } + } + ], + "operationId": "getUsers", + "deprecated": true + } + }, + "/api/v2/users/{projectKey}/{environmentKey}/{userKey}": { + "get": { + "responses": { + "200": { + "description": "User response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserRecord" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Users" + ], + "summary": "Get user", + "description": "> ### Use contexts instead\n>\n> After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use [Get context instances](/tag/Contexts#operation/getContextInstances) instead of this endpoint.\n\nGet a user by key. The `user` object contains all attributes sent in `variation` calls for that key.\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "userKey", + "in": "path", + "description": "The user key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The user key" + } + } + ], + "operationId": "getUser", + "deprecated": true + }, + "delete": { + "responses": { + "204": { + "description": "Action succeeded" + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "409": { + "description": "Status conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusConflictErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Users" + ], + "summary": "Delete user", + "description": "> ### Use contexts instead\n>\n> After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use [Delete context instances](/tag/Contexts#operation/deleteContextInstances) instead of this endpoint.\n\nDelete a user by key.\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "userKey", + "in": "path", + "description": "The user key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The user key" + } + } + ], + "operationId": "deleteUser", + "deprecated": true + } + }, + "/api/v2/users/{projectKey}/{environmentKey}/{userKey}/flags": { + "get": { + "responses": { + "200": { + "description": "User flag settings collection response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserFlagSettings" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "User settings" + ], + "summary": "List flag settings for user", + "description": "Get the current flag settings for a given user.

The `_value` is the flag variation that the user receives. The `setting` indicates whether you've explicitly targeted a user to receive a particular variation. For example, if you have turned off a feature flag for a user, this setting will be `false`. The example response indicates that the user `Abbie_Braun` has the `sort.order` flag enabled and the `alternate.page` flag disabled, and that the user has not been explicitly targeted to receive a particular variation.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "userKey", + "in": "path", + "description": "The user key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The user key" + } + } + ], + "operationId": "getUserFlagSettings", + "deprecated": true + } + }, + "/api/v2/users/{projectKey}/{environmentKey}/{userKey}/flags/{featureFlagKey}": { + "get": { + "responses": { + "200": { + "description": "User flag settings response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserFlagSetting" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "User settings" + ], + "summary": "Get flag setting for user", + "description": "Get a single flag setting for a user by flag key.

The `_value` is the flag variation that the user receives. The `setting` indicates whether you've explicitly targeted a user to receive a particular variation. For example, if you have turned off a feature flag for a user, this setting will be `false`. The example response indicates that the user `Abbie_Braun` has the `sort.order` flag enabled.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "userKey", + "in": "path", + "description": "The user key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The user key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + } + ], + "operationId": "getUserFlagSetting", + "deprecated": true + }, + "put": { + "responses": { + "204": { + "description": "Action succeeded" + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "User settings" + ], + "summary": "Update flag settings for user", + "description": "Enable or disable a feature flag for a user based on their key.\n\nOmitting the `setting` attribute from the request body, or including a `setting` of `null`, erases the current setting for a user.\n\nIf you previously patched the flag, and the patch included the user's data, LaunchDarkly continues to use that data. If LaunchDarkly has never encountered the user's key before, it calculates the flag values based on the user key alone.\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + }, + { + "name": "userKey", + "in": "path", + "description": "The user key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The user key" + } + }, + { + "name": "featureFlagKey", + "in": "path", + "description": "The feature flag key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The feature flag key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValuePut" + } + } + }, + "required": true + }, + "operationId": "putFlagSetting", + "deprecated": true + } + }, + "/api/v2/users/{projectKey}/{userKey}/expiring-user-targets/{environmentKey}": { + "get": { + "responses": { + "200": { + "description": "Expiring user target response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExpiringUserTargetGetResponse" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "User settings" + ], + "summary": "Get expiring dates on flags for user", + "description": "Get a list of flags for which the given user is scheduled for removal.", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "userKey", + "in": "path", + "description": "The user key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The user key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + } + ], + "operationId": "getExpiringFlagsForUser", + "deprecated": true + }, + "patch": { + "responses": { + "200": { + "description": "Expiring user target response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExpiringUserTargetPatchResponse" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "User settings" + ], + "summary": "Update expiring user target for flags", + "description": "Schedule the specified user for removal from individual targeting on one or more flags. The user must already be individually targeted for each flag.\n\nYou can add, update, or remove a scheduled removal date. You can only schedule a user for removal on a single variation per flag.\n\nUpdating an expiring target uses the semantic patch format. To make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch).\n\n### Instructions\n\nSemantic patch requests support the following `kind` instructions for updating expiring user targets.\n\n
\nClick to expand instructions for updating expiring user targets\n\n#### addExpireUserTargetDate\n\nAdds a date and time that LaunchDarkly will remove the user from the flag's individual targeting.\n\n##### Parameters\n\n* `flagKey`: The flag key\n* `variationId`: ID of a variation on the flag\n* `value`: The time, in Unix milliseconds, when LaunchDarkly should remove the user from individual targeting for this flag.\n\n#### updateExpireUserTargetDate\n\nUpdates the date and time that LaunchDarkly will remove the user from the flag's individual targeting.\n\n##### Parameters\n\n* `flagKey`: The flag key\n* `variationId`: ID of a variation on the flag\n* `value`: The time, in Unix milliseconds, when LaunchDarkly should remove the user from individual targeting for this flag.\n* `version`: The version of the expiring user target to update. If included, update will fail if version doesn't match current version of the expiring user target.\n\n#### removeExpireUserTargetDate\n\nRemoves the scheduled removal of the user from the flag's individual targeting. The user will remain part of the flag's individual targeting until explicitly removed, or until another removal is scheduled.\n\n##### Parameters\n\n* `flagKey`: The flag key\n* `variationId`: ID of a variation on the flag\n\n
\n", + "parameters": [ + { + "name": "projectKey", + "in": "path", + "description": "The project key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The project key" + } + }, + { + "name": "userKey", + "in": "path", + "description": "The user key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The user key" + } + }, + { + "name": "environmentKey", + "in": "path", + "description": "The environment key", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The environment key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/patchUsersRequest" + } + } + }, + "required": true + }, + "operationId": "patchExpiringFlagsForUser", + "deprecated": true + } + }, + "/api/v2/versions": { + "get": { + "responses": { + "200": { + "description": "Versions information response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VersionsRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Other" + ], + "summary": "Get version information", + "description": "Get the latest API version, the list of valid API versions in ascending order, and the version being used for this request. These are all in the external, date-based format.", + "operationId": "getVersions" + } + }, + "/api/v2/webhooks": { + "get": { + "responses": { + "200": { + "description": "Webhooks response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Webhooks" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Webhooks" + ], + "summary": "List webhooks", + "description": "Fetch a list of all webhooks.", + "operationId": "getAllWebhooks" + }, + "post": { + "responses": { + "200": { + "description": "Webhook response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Webhook" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Webhooks" + ], + "summary": "Creates a webhook", + "description": "Create a new webhook.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/webhookPost" + }, + "example": { + "name": "apidocs test webhook", + "on": true, + "sign": false, + "statements": [ + { + "actions": [ + "*" + ], + "effect": "allow", + "resources": [ + "proj/test" + ] + } + ], + "tags": [ + "example-tag" + ], + "url": "https://example.com" + } + } + }, + "required": true + }, + "operationId": "postWebhook" + } + }, + "/api/v2/webhooks/{id}": { + "get": { + "responses": { + "200": { + "description": "Webhook response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Webhook" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Webhooks" + ], + "summary": "Get webhook", + "description": "Get a single webhook by ID.", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID of the webhook", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The ID of the webhook" + } + } + ], + "operationId": "getWebhook" + }, + "patch": { + "responses": { + "200": { + "description": "Webhook response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Webhook" + } + } + } + }, + "400": { + "description": "Invalid request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestErrorRep" + } + } + } + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Webhooks" + ], + "summary": "Update webhook", + "description": "Update a webhook's settings. Updating webhook settings uses a [JSON patch](https://datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes. To learn more, read [Updates](/#section/Overview/Updates).", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID of the webhook to update", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The ID of the webhook to update" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JSONPatch" + }, + "example": [ + { + "op": "replace", + "path": "/on", + "value": false + } + ] + } + }, + "required": true + }, + "operationId": "patchWebhook" + }, + "delete": { + "responses": { + "204": { + "description": "Action succeeded" + }, + "401": { + "description": "Invalid access token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedErrorRep" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenErrorRep" + } + } + } + }, + "404": { + "description": "Invalid resource identifier", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorRep" + } + } + } + }, + "429": { + "description": "Rate limited", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitedErrorRep" + } + } + } + } + }, + "tags": [ + "Webhooks" + ], + "summary": "Delete webhook", + "description": "Delete a webhook by ID.", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ID of the webhook to delete", + "required": true, + "schema": { + "type": "string", + "format": "string", + "description": "The ID of the webhook to delete" + } + } + ], + "operationId": "deleteWebhook" + } + } + }, + "components": { + "schemas": { + "Access": { + "type": "object", + "required": [ + "denied", + "allowed" + ], + "properties": { + "denied": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AccessDenied" + } + }, + "allowed": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AccessAllowedRep" + } + } + } + }, + "AccessAllowedReason": { + "type": "object", + "required": [ + "effect" + ], + "properties": { + "resources": { + "type": "array", + "description": "Resource specifier strings", + "items": { + "type": "string" + }, + "example": [ + "proj/*:env/*;qa_*:/flag/*" + ] + }, + "notResources": { + "type": "array", + "description": "Targeted resources are the resources NOT in this list. The resources and notActions fields must be empty to use this field.", + "items": { + "type": "string" + } + }, + "actions": { + "type": "array", + "description": "Actions to perform on a resource", + "items": { + "$ref": "#/components/schemas/ActionSpecifier" + }, + "example": [ + "*" + ] + }, + "notActions": { + "type": "array", + "description": "Targeted actions are the actions NOT in this list. The actions and notResources fields must be empty to use this field.", + "items": { + "$ref": "#/components/schemas/ActionSpecifier" + } + }, + "effect": { + "type": "string", + "description": "Whether this statement should allow or deny actions on the resources.", + "example": "allow", + "enum": [ + "allow", + "deny" + ] + }, + "role_name": { + "type": "string" + } + } + }, + "AccessAllowedRep": { + "type": "object", + "required": [ + "action", + "reason" + ], + "properties": { + "action": { + "$ref": "#/components/schemas/ActionIdentifier" + }, + "reason": { + "$ref": "#/components/schemas/AccessAllowedReason" + } + } + }, + "AccessDenied": { + "type": "object", + "required": [ + "action", + "reason" + ], + "properties": { + "action": { + "$ref": "#/components/schemas/ActionIdentifier" + }, + "reason": { + "$ref": "#/components/schemas/AccessDeniedReason" + } + } + }, + "AccessDeniedReason": { + "type": "object", + "required": [ + "effect" + ], + "properties": { + "resources": { + "type": "array", + "description": "Resource specifier strings", + "items": { + "type": "string" + }, + "example": [ + "proj/*:env/*;qa_*:/flag/*" + ] + }, + "notResources": { + "type": "array", + "description": "Targeted resources are the resources NOT in this list. The resources and notActions fields must be empty to use this field.", + "items": { + "type": "string" + } + }, + "actions": { + "type": "array", + "description": "Actions to perform on a resource", + "items": { + "$ref": "#/components/schemas/ActionSpecifier" + }, + "example": [ + "*" + ] + }, + "notActions": { + "type": "array", + "description": "Targeted actions are the actions NOT in this list. The actions and notResources fields must be empty to use this field.", + "items": { + "$ref": "#/components/schemas/ActionSpecifier" + } + }, + "effect": { + "type": "string", + "description": "Whether this statement should allow or deny actions on the resources.", + "example": "allow", + "enum": [ + "allow", + "deny" + ] + }, + "role_name": { + "type": "string" + } + } + }, + "AccessTokenPost": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "A human-friendly name for the access token" + }, + "description": { + "type": "string", + "description": "A description for the access token" + }, + "role": { + "type": "string", + "description": "Built-in role for the token", + "enum": [ + "reader", + "writer", + "admin" + ] + }, + "customRoleIds": { + "type": "array", + "description": "A list of custom role IDs to use as access limits for the access token", + "items": { + "type": "string" + } + }, + "inlineRole": { + "type": "array", + "description": "A JSON array of statements represented as JSON objects with three attributes: effect, resources, actions. May be used in place of a built-in or custom role.", + "items": { + "$ref": "#/components/schemas/StatementPost" + } + }, + "serviceToken": { + "type": "boolean", + "description": "Whether the token is a service token https://docs.launchdarkly.com/home/account-security/api-access-tokens#service-tokens" + }, + "defaultApiVersion": { + "type": "integer", + "description": "The default API version for this token" + } + } + }, + "ActionIdentifier": { + "type": "string" + }, + "ActionInput": { + "type": "object", + "properties": { + "instructions": { + "description": "An array of instructions for the stage. Each object in the array uses the semantic patch format for updating a feature flag.", + "example": "{\"instructions\": [{ \"kind\": \"turnFlagOn\"}]}" + } + } + }, + "ActionOutput": { + "type": "object", + "required": [ + "kind", + "instructions" + ], + "properties": { + "kind": { + "type": "string", + "description": "The type of action for this stage", + "example": "patch" + }, + "instructions": { + "description": "An array of instructions for the stage. Each object in the array uses the semantic patch format for updating a feature flag.", + "example": "[{\"kind\": \"turnFlagOn\"}]", + "$ref": "#/components/schemas/Instructions" + } + } + }, + "ActionSpecifier": { + "type": "string" + }, + "AllVariationsSummary": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/VariationSummary" + } + }, + "ApplicationCollectionRep": { + "type": "object", + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + }, + "items": { + "type": "array", + "description": "A list of applications", + "items": { + "$ref": "#/components/schemas/ApplicationRep" + } + }, + "totalCount": { + "type": "integer", + "description": "The number of applications", + "example": 1 + } + } + }, + "ApplicationFlagCollectionRep": { + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "A list of the flags that have been evaluated by the application", + "items": { + "$ref": "#/components/schemas/FlagListingRep" + } + }, + "totalCount": { + "type": "integer", + "description": "The number of flags that have been evaluated by the application", + "example": 1 + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + } + } + }, + "ApplicationRep": { + "type": "object", + "required": [ + "autoAdded", + "key", + "kind", + "name" + ], + "properties": { + "flags": { + "description": "Details about the flags that have been evaluated by the application", + "$ref": "#/components/schemas/ApplicationFlagCollectionRep" + }, + "_access": { + "description": "Details on the allowed and denied actions for this application", + "$ref": "#/components/schemas/Access" + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + }, + "_version": { + "type": "integer", + "description": "Version of the application" + }, + "autoAdded": { + "type": "boolean", + "description": "Whether the application was automatically created because it was included in a context when a LaunchDarkly SDK evaluated a feature flag, or was created through the LaunchDarkly UI or REST API.", + "example": true + }, + "creationDate": { + "description": "Timestamp of when the application version was created", + "example": "1654104600000", + "$ref": "#/components/schemas/UnixMillis" + }, + "description": { + "type": "string", + "description": "The application description", + "example": "The LaunchDarkly Cafe app" + }, + "key": { + "type": "string", + "description": "The unique identifier of this application", + "example": "com.launchdarkly.cafe" + }, + "kind": { + "type": "string", + "description": "To distinguish the kind of application", + "example": "mobile", + "enum": [ + "browser", + "mobile", + "server" + ] + }, + "_maintainer": { + "description": "Associated maintainer member or team info for the application", + "$ref": "#/components/schemas/MaintainerRep" + }, + "name": { + "type": "string", + "description": "The name of the application", + "example": "LaunchDarklyCafe" + } + } + }, + "ApplicationVersionRep": { + "type": "object", + "required": [ + "autoAdded", + "key", + "name" + ], + "properties": { + "_access": { + "description": "Details on the allowed and denied actions for this application version", + "$ref": "#/components/schemas/Access" + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + }, + "_version": { + "type": "integer", + "description": "Version of the application version" + }, + "autoAdded": { + "type": "boolean", + "description": "Whether the application version was automatically created, because it was included in a context when a LaunchDarkly SDK evaluated a feature flag, or if the application version was created through the LaunchDarkly UI or REST API. ", + "example": true + }, + "creationDate": { + "description": "Timestamp of when the application version was created", + "example": "1654104600000", + "$ref": "#/components/schemas/UnixMillis" + }, + "key": { + "type": "string", + "description": "The unique identifier of this application version", + "example": "2" + }, + "name": { + "type": "string", + "description": "The name of this version", + "example": "01.02.03" + }, + "supported": { + "type": "boolean", + "description": "Whether this version is supported. Only applicable if the application kind is mobile.", + "example": true + } + } + }, + "ApplicationVersionsCollectionRep": { + "type": "object", + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + }, + "items": { + "type": "array", + "description": "A list of the versions for this application", + "items": { + "$ref": "#/components/schemas/ApplicationVersionRep" + } + }, + "totalCount": { + "type": "integer", + "description": "The number of versions for this application", + "example": 1 + } + } + }, + "ApprovalRequestResponse": { + "type": "object", + "required": [ + "_id", + "_version", + "creationDate", + "serviceKind", + "reviewStatus", + "allReviews", + "notifyMemberIds", + "status", + "instructions", + "conflicts", + "_links" + ], + "properties": { + "_id": { + "type": "string", + "description": "The ID of this approval request", + "example": "12ab3c45de678910abc12345" + }, + "_version": { + "type": "integer", + "description": "Version of the approval request", + "example": 1 + }, + "creationDate": { + "description": "Timestamp of when the approval request was created", + "example": "1654104600000", + "$ref": "#/components/schemas/UnixMillis" + }, + "serviceKind": { + "description": "The approval service for this request. May be LaunchDarkly or an external approval service, such as ServiceNow or JIRA.", + "example": "launchdarkly", + "$ref": "#/components/schemas/ApprovalRequestServiceKind" + }, + "requestorId": { + "type": "string", + "description": "The ID of the member who requested the approval", + "example": "12ab3c45de678910abc12345" + }, + "description": { + "type": "string", + "description": "A human-friendly name for the approval request", + "example": "example: request approval from someone" + }, + "reviewStatus": { + "type": "string", + "description": "Current status of the review of this approval request", + "example": "pending", + "enum": [ + "approved", + "declined", + "pending" + ] + }, + "allReviews": { + "type": "array", + "description": "An array of individual reviews of this approval request", + "items": { + "$ref": "#/components/schemas/ReviewResponse" + } + }, + "notifyMemberIds": { + "type": "array", + "description": "An array of member IDs. These members are notified to review the approval request.", + "items": { + "type": "string" + }, + "example": [ + "1234a56b7c89d012345e678f" + ] + }, + "appliedDate": { + "description": "Timestamp of when the approval request was applied", + "example": "1654104600000", + "$ref": "#/components/schemas/UnixMillis" + }, + "appliedByMemberId": { + "type": "string", + "description": "The member ID of the member who applied the approval request", + "example": "1234a56b7c89d012345e678f" + }, + "appliedByServiceTokenId": { + "type": "string", + "description": "The service token ID of the service token which applied the approval request", + "example": "1234a56b7c89d012345e678f" + }, + "status": { + "type": "string", + "description": "Current status of the approval request", + "example": "pending", + "enum": [ + "pending", + "completed", + "failed", + "scheduled" + ] + }, + "instructions": { + "description": "List of instructions in semantic patch format to be applied to the feature flag", + "example": "[{\"kind\": \"turnFlagOn\"}]", + "$ref": "#/components/schemas/Instructions" + }, + "conflicts": { + "type": "array", + "description": "Details on any conflicting approval requests", + "items": { + "$ref": "#/components/schemas/Conflict" + } + }, + "_links": { + "type": "object", + "additionalProperties": {}, + "description": "The location and content type of related resources" + }, + "executionDate": { + "description": "Timestamp for when instructions will be executed", + "example": "1654104600000", + "$ref": "#/components/schemas/UnixMillis" + }, + "operatingOnId": { + "type": "string", + "description": "ID of scheduled change to edit or delete", + "example": "12ab3c45de678910abc12345" + }, + "integrationMetadata": { + "description": "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", + "$ref": "#/components/schemas/IntegrationMetadata" + }, + "source": { + "description": "Details about the source feature flag, if copied", + "$ref": "#/components/schemas/CopiedFromEnv" + }, + "customWorkflowMetadata": { + "description": "Details about the custom workflow, if this approval request is part of a custom workflow", + "$ref": "#/components/schemas/CustomWorkflowMeta" + }, + "resourceId": { + "type": "string", + "description": "String representation of a resource" + }, + "approvalSettings": { + "description": "The settings for this approval", + "$ref": "#/components/schemas/ApprovalSettings" + } + } + }, + "ApprovalRequestServiceKind": { + "type": "string" + }, + "ApprovalSettings": { + "type": "object", + "required": [ + "required", + "bypassApprovalsForPendingChanges", + "minNumApprovals", + "canReviewOwnRequest", + "canApplyDeclinedChanges", + "serviceKind", + "serviceConfig", + "requiredApprovalTags" + ], + "properties": { + "required": { + "type": "boolean", + "description": "If approvals are required for this environment", + "example": true + }, + "bypassApprovalsForPendingChanges": { + "type": "boolean", + "description": "Whether to skip approvals for pending changes", + "example": false + }, + "minNumApprovals": { + "type": "integer", + "description": "Sets the amount of approvals required before a member can apply a change. The minimum is one and the maximum is five.", + "example": 1 + }, + "canReviewOwnRequest": { + "type": "boolean", + "description": "Allow someone who makes an approval request to apply their own change", + "example": false + }, + "canApplyDeclinedChanges": { + "type": "boolean", + "description": "Allow applying the change as long as at least one person has approved", + "example": true + }, + "serviceKind": { + "type": "string", + "description": "Which service to use for managing approvals", + "example": "launchdarkly" + }, + "serviceConfig": { + "type": "object", + "additionalProperties": {}, + "example": {} + }, + "requiredApprovalTags": { + "type": "array", + "description": "Require approval only on flags with the provided tags. Otherwise all flags will require approval.", + "items": { + "type": "string" + }, + "example": [ + "require-approval" + ] + } + } + }, + "Audience": { + "type": "object", + "required": [ + "environment", + "name" + ], + "properties": { + "environment": { + "description": "Details about the environment", + "$ref": "#/components/schemas/EnvironmentSummary" + }, + "name": { + "type": "string", + "description": "The release phase name", + "example": "Phase 1 - Testing" + } + } + }, + "AudiencePost": { + "type": "object", + "required": [ + "environmentKey", + "name" + ], + "properties": { + "environmentKey": { + "type": "string", + "description": "A project-unique key for the environment." + }, + "name": { + "type": "string", + "description": "The audience name" + } + } + }, + "Audiences": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Audience" + } + }, + "AuditLogEntryListingRep": { + "type": "object", + "required": [ + "_links", + "_id", + "_accountId", + "date", + "accesses", + "kind", + "name", + "description", + "shortDescription" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + }, + "_id": { + "type": "string", + "description": "The ID of the audit log entry", + "example": "1234a56b7c89d012345e678f" + }, + "_accountId": { + "type": "string", + "description": "The ID of the account to which this audit log entry belongs", + "example": "1234a56b7c89d012345e678f" + }, + "date": { + "description": "Timestamp of the audit log entry", + "example": "1654104600000", + "$ref": "#/components/schemas/UnixMillis" + }, + "accesses": { + "type": "array", + "description": "Details on the actions performed and resources acted on in this audit log entry", + "items": { + "$ref": "#/components/schemas/ResourceAccess" + } + }, + "kind": { + "description": "The type of resource this audit log entry refers to", + "example": "flag", + "$ref": "#/components/schemas/ResourceKind" + }, + "name": { + "type": "string", + "description": "The name of the resource this audit log entry refers to", + "example": "Example feature flag" + }, + "description": { + "type": "string", + "description": "Description of the change recorded in the audit log entry", + "example": "Example, turning on the flag for testing" + }, + "shortDescription": { + "type": "string", + "description": "Shorter version of the change recorded in the audit log entry", + "example": "Example, turning on the flag" + }, + "comment": { + "type": "string", + "description": "Optional comment for the audit log entry", + "example": "This is an automated test" + }, + "subject": { + "description": "Details of the subject who initiated the action described in the audit log entry", + "$ref": "#/components/schemas/SubjectDataRep" + }, + "member": { + "description": "Details of the member who initiated the action described in the audit log entry", + "$ref": "#/components/schemas/MemberDataRep" + }, + "token": { + "description": "Details of the access token that initiated the action described in the audit log entry", + "$ref": "#/components/schemas/TokenSummary" + }, + "app": { + "description": "Details of the authorized application that initiated the action described in the audit log entry", + "$ref": "#/components/schemas/AuthorizedAppDataRep" + }, + "titleVerb": { + "type": "string", + "description": "The action and resource recorded in this audit log entry", + "example": "turned on the flag" + }, + "title": { + "type": "string", + "description": "A description of what occurred, in the format member titleVerb target" + }, + "target": { + "description": "Details of the resource acted upon in this audit log entry", + "example": "[Ariel Flores](mailto:ariel@acme.com) turned on the flag [example-flag](https://app.launchdarkly.com/example-project/production/features/example-flag) in Production", + "$ref": "#/components/schemas/TargetResourceRep" + }, + "parent": { + "$ref": "#/components/schemas/ParentResourceRep" + } + } + }, + "AuditLogEntryListingRepCollection": { + "type": "object", + "required": [ + "items", + "_links" + ], + "properties": { + "items": { + "type": "array", + "description": "An array of audit log entries", + "items": { + "$ref": "#/components/schemas/AuditLogEntryListingRep" + } + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + } + } + }, + "AuditLogEntryRep": { + "type": "object", + "required": [ + "_links", + "_id", + "_accountId", + "date", + "accesses", + "kind", + "name", + "description", + "shortDescription" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + }, + "_id": { + "type": "string", + "description": "The ID of the audit log entry", + "example": "1234a56b7c89d012345e678f" + }, + "_accountId": { + "type": "string", + "description": "The ID of the account to which this audit log entry belongs", + "example": "1234a56b7c89d012345e678f" + }, + "date": { + "description": "Timestamp of the audit log entry", + "example": "1654104600000", + "$ref": "#/components/schemas/UnixMillis" + }, + "accesses": { + "type": "array", + "description": "Details on the actions performed and resources acted on in this audit log entry", + "items": { + "$ref": "#/components/schemas/ResourceAccess" + } + }, + "kind": { + "description": "The type of resource this audit log entry refers to", + "example": "flag", + "$ref": "#/components/schemas/ResourceKind" + }, + "name": { + "type": "string", + "description": "The name of the resource this audit log entry refers to", + "example": "Example feature flag" + }, + "description": { + "type": "string", + "description": "Description of the change recorded in the audit log entry", + "example": "Example, turning on the flag for testing" + }, + "shortDescription": { + "type": "string", + "description": "Shorter version of the change recorded in the audit log entry", + "example": "Example, turning on the flag" + }, + "comment": { + "type": "string", + "description": "Optional comment for the audit log entry", + "example": "This is an automated test" + }, + "subject": { + "description": "Details of the subject who initiated the action described in the audit log entry", + "$ref": "#/components/schemas/SubjectDataRep" + }, + "member": { + "description": "Details of the member who initiated the action described in the audit log entry", + "$ref": "#/components/schemas/MemberDataRep" + }, + "token": { + "description": "Details of the access token that initiated the action described in the audit log entry", + "$ref": "#/components/schemas/TokenSummary" + }, + "app": { + "description": "Details of the authorized application that initiated the action described in the audit log entry", + "$ref": "#/components/schemas/AuthorizedAppDataRep" + }, + "titleVerb": { + "type": "string", + "description": "The action and resource recorded in this audit log entry", + "example": "turned on the flag" + }, + "title": { + "type": "string", + "description": "A description of what occurred, in the format member titleVerb target" + }, + "target": { + "description": "Details of the resource acted upon in this audit log entry", + "example": "[Ariel Flores](mailto:ariel@acme.com) turned on the flag [example-flag](https://app.launchdarkly.com/example-project/production/features/example-flag) in Production", + "$ref": "#/components/schemas/TargetResourceRep" + }, + "parent": { + "$ref": "#/components/schemas/ParentResourceRep" + }, + "delta": { + "description": "If the audit log entry has been updated, this is the JSON patch body that was used in the request to update the entity" + }, + "triggerBody": { + "description": "A JSON representation of the external trigger for this audit log entry, if any" + }, + "merge": { + "description": "A JSON representation of the merge information for this audit log entry, if any" + }, + "previousVersion": { + "description": "If the audit log entry has been updated, this is a JSON representation of the previous version of the entity" + }, + "currentVersion": { + "description": "If the audit log entry has been updated, this is a JSON representation of the current version of the entity" + }, + "subentries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AuditLogEntryListingRep" + } + } + } + }, + "AuthorizedAppDataRep": { + "type": "object", + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "_id": { + "type": "string", + "description": "The ID of the authorized application" + }, + "isScim": { + "type": "boolean", + "description": "Whether the application is authorized through SCIM" + }, + "name": { + "type": "string", + "description": "The authorized application name" + }, + "maintainerName": { + "type": "string", + "description": "The name of the maintainer for this authorized application" + } + } + }, + "BigSegmentStoreIntegration": { + "type": "object", + "required": [ + "_links", + "_id", + "integrationKey", + "projectKey", + "environmentKey", + "config", + "on", + "tags", + "name", + "version", + "_status" + ], + "properties": { + "_links": { + "description": "The location and content type of related resources", + "$ref": "#/components/schemas/BigSegmentStoreIntegrationLinks" + }, + "_id": { + "type": "string", + "description": "The integration ID", + "example": "12ab3c4d5ef1a2345bcde67f" + }, + "integrationKey": { + "type": "string", + "description": "The integration key", + "example": "redis", + "enum": [ + "redis", + "dynamodb" + ] + }, + "projectKey": { + "type": "string", + "description": "The project key", + "example": "default" + }, + "environmentKey": { + "type": "string", + "description": "The environment key", + "example": "development" + }, + "config": { + "description": "The delivery configuration for the given integration provider. Only included when requesting a single integration by ID. Refer to the formVariables field in the corresponding manifest.json for a full list of fields for each integration.", + "$ref": "#/components/schemas/FormVariableConfig" + }, + "on": { + "type": "boolean", + "description": "Whether the configuration is turned on", + "example": true + }, + "tags": { + "type": "array", + "description": "List of tags for this configuration", + "items": { + "type": "string" + }, + "example": [] + }, + "name": { + "type": "string", + "description": "Name of the configuration", + "example": "Development environment configuration" + }, + "version": { + "type": "integer", + "description": "Version of the current configuration", + "example": 1 + }, + "_access": { + "description": "Details on the allowed and denied actions for this configuration", + "$ref": "#/components/schemas/Access" + }, + "_status": { + "description": "Details on the connection status of the persistent store integration", + "$ref": "#/components/schemas/BigSegmentStoreStatus" + } + } + }, + "BigSegmentStoreIntegrationCollection": { + "type": "object", + "required": [ + "_links", + "items" + ], + "properties": { + "_links": { + "description": "The location and content type of related resources", + "$ref": "#/components/schemas/BigSegmentStoreIntegrationCollectionLinks" + }, + "items": { + "type": "array", + "description": "An array of persistent store integration configurations", + "items": { + "$ref": "#/components/schemas/BigSegmentStoreIntegration" + } + } + } + }, + "BigSegmentStoreIntegrationCollectionLinks": { + "type": "object", + "required": [ + "self" + ], + "properties": { + "self": { + "$ref": "#/components/schemas/Link" + }, + "parent": { + "$ref": "#/components/schemas/Link" + } + } + }, + "BigSegmentStoreIntegrationLinks": { + "type": "object", + "required": [ + "self", + "parent", + "project", + "environment" + ], + "properties": { + "self": { + "$ref": "#/components/schemas/Link" + }, + "parent": { + "$ref": "#/components/schemas/Link" + }, + "project": { + "$ref": "#/components/schemas/Link" + }, + "environment": { + "$ref": "#/components/schemas/Link" + } + } + }, + "BigSegmentStoreStatus": { + "type": "object", + "properties": { + "available": { + "type": "boolean", + "description": "Whether the persistent store integration is fully synchronized with the LaunchDarkly environment, and the lastSync occurred within a few minutes", + "example": true + }, + "potentiallyStale": { + "type": "boolean", + "description": "Whether the persistent store integration may not be fully synchronized with the LaunchDarkly environment. true if the integration could be stale.", + "example": false + }, + "lastSync": { + "description": "Timestamp of when the most recent successful sync occurred between the persistent store integration and the LaunchDarkly environment.", + "example": "1717263000000", + "$ref": "#/components/schemas/UnixMillis" + }, + "lastError": { + "description": "Timestamp of when the most recent synchronization error occurred, if any", + "example": "1714584600000", + "$ref": "#/components/schemas/UnixMillis" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StoreIntegrationError" + } + } + } + }, + "BigSegmentTarget": { + "type": "object", + "required": [ + "userKey", + "included", + "excluded" + ], + "properties": { + "userKey": { + "type": "string", + "description": "The target key" + }, + "included": { + "type": "boolean", + "description": "Indicates whether the target is included.
Included targets are always segment members, regardless of segment rules." + }, + "excluded": { + "type": "boolean", + "description": "Indicates whether the target is excluded.
Segment rules bypass excluded targets, so they will never be included based on rules. Excluded targets may still be included explicitly." + } + } + }, + "BooleanDefaults": { + "type": "object", + "properties": { + "trueDisplayName": { + "type": "string", + "description": "The display name for the true variation, displayed in the LaunchDarkly user interface", + "example": "True" + }, + "falseDisplayName": { + "type": "string", + "description": "The display name for the false variation, displayed in the LaunchDarkly user interface", + "example": "False" + }, + "trueDescription": { + "type": "string", + "description": "The description for the true variation", + "example": "serve true" + }, + "falseDescription": { + "type": "string", + "description": "The description for the false variation", + "example": "serve false" + }, + "onVariation": { + "type": "integer", + "description": "The variation index of the flag variation to use for the default targeting behavior when a flag's targeting is on and the target did not match any rules", + "example": 0 + }, + "offVariation": { + "type": "integer", + "description": "The variation index of the flag variation to use for the default targeting behavior when a flag's targeting is off", + "example": 1 + } + } + }, + "BooleanFlagDefaults": { + "type": "object", + "required": [ + "trueDisplayName", + "falseDisplayName", + "trueDescription", + "falseDescription", + "onVariation", + "offVariation" + ], + "properties": { + "trueDisplayName": { + "type": "string", + "description": "The display name for the true variation, displayed in the LaunchDarkly user interface", + "example": "True" + }, + "falseDisplayName": { + "type": "string", + "description": "The display name for the false variation, displayed in the LaunchDarkly user interface", + "example": "False" + }, + "trueDescription": { + "type": "string", + "description": "The description for the true variation", + "example": "serve true" + }, + "falseDescription": { + "type": "string", + "description": "The description for the false variation", + "example": "serve false" + }, + "onVariation": { + "type": "integer", + "description": "The variation index of the flag variation to use for the default targeting behavior when a flag's targeting is on and the target did not match any rules", + "example": 0 + }, + "offVariation": { + "type": "integer", + "description": "The variation index of the flag variation to use for the default targeting behavior when a flag's targeting is off", + "example": 1 + } + } + }, + "BranchCollectionRep": { + "type": "object", + "required": [ + "_links", + "items" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + }, + "items": { + "type": "array", + "description": "An array of branches", + "items": { + "$ref": "#/components/schemas/BranchRep" + } + } + } + }, + "BranchRep": { + "type": "object", + "required": [ + "name", + "head", + "syncTime", + "_links" + ], + "properties": { + "name": { + "type": "string", + "description": "The branch name", + "example": "main" + }, + "head": { + "type": "string", + "description": "An ID representing the branch HEAD. For example, a commit SHA.", + "example": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3" + }, + "updateSequenceId": { + "type": "integer", + "format": "int64", + "description": "An optional ID used to prevent older data from overwriting newer data", + "example": 25 + }, + "syncTime": { + "description": "A timestamp indicating when the branch was last synced", + "example": "1636558831870", + "$ref": "#/components/schemas/UnixMillis" + }, + "references": { + "type": "array", + "description": "An array of flag references found on the branch", + "items": { + "$ref": "#/components/schemas/ReferenceRep" + } + }, + "_links": { + "type": "object", + "additionalProperties": {}, + "description": "The location and content type of related resources" + } + } + }, + "BulkEditMembersRep": { + "type": "object", + "properties": { + "members": { + "type": "array", + "description": "A list of members IDs of the members who were successfully updated.", + "items": { + "type": "string" + }, + "example": [ + "1234a56b7c89d012345e678f" + ] + }, + "errors": { + "type": "array", + "description": "A list of member IDs and errors for the members whose updates failed.", + "items": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "example": [ + { + "507f1f77bcf86cd799439011": "you cannot modify your own role" + } + ] + } + } + }, + "BulkEditTeamsRep": { + "type": "object", + "properties": { + "memberIDs": { + "type": "array", + "description": "A list of member IDs of the members who were added to the teams.", + "items": { + "type": "string" + }, + "example": [ + "1234a56b7c89d012345e678f" + ] + }, + "teamKeys": { + "type": "array", + "description": "A list of team keys of the teams that were successfully updated.", + "items": { + "type": "string" + }, + "example": [ + "example-team-1" + ] + }, + "errors": { + "type": "array", + "description": "A list of team keys and errors for the teams whose updates failed.", + "items": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "example": [ + { + "example-team-2": "example failure message" + } + ] + } + } + }, + "Clause": { + "type": "object", + "required": [ + "attribute", + "op", + "values", + "negate" + ], + "properties": { + "_id": { + "type": "string" + }, + "attribute": { + "type": "string" + }, + "op": { + "$ref": "#/components/schemas/Operator" + }, + "values": { + "type": "array", + "items": {} + }, + "contextKind": { + "type": "string" + }, + "negate": { + "type": "boolean" + } + } + }, + "Client": { + "type": "object", + "required": [ + "_links", + "name", + "_accountId", + "_clientId", + "redirectUri", + "_creationDate" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "parent": { + "href": "/api/v2/oauth/clients", + "type": "application/json" + }, + "self": { + "href": "/api/v2/oauth/clients/50666563-9144-4125-b822-33f308227e45", + "type": "application/json" + } + } + }, + "name": { + "type": "string", + "description": "Client name" + }, + "description": { + "type": "string", + "description": "Client description" + }, + "_accountId": { + "type": "string", + "description": "The account ID the client is registered under" + }, + "_clientId": { + "type": "string", + "description": "The client's unique ID" + }, + "_clientSecret": { + "type": "string", + "description": "The client secret. This will only be shown upon creation." + }, + "redirectUri": { + "type": "string", + "description": "The client's redirect URI" + }, + "_creationDate": { + "description": "Timestamp of client creation date", + "example": "1494437420312", + "$ref": "#/components/schemas/UnixMillis" + } + } + }, + "ClientCollection": { + "type": "object", + "required": [ + "_links", + "items" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "self": { + "href": "/api/v2/oauth/clients", + "type": "application/json" + } + } + }, + "items": { + "type": "array", + "description": "List of client objects", + "items": { + "$ref": "#/components/schemas/Client" + } + } + } + }, + "ClientSideAvailability": { + "type": "object", + "properties": { + "usingMobileKey": { + "type": "boolean" + }, + "usingEnvironmentId": { + "type": "boolean" + } + } + }, + "ClientSideAvailabilityPost": { + "type": "object", + "required": [ + "usingEnvironmentId", + "usingMobileKey" + ], + "properties": { + "usingEnvironmentId": { + "type": "boolean", + "description": "Whether to enable availability for client-side SDKs. Defaults to false.", + "example": true + }, + "usingMobileKey": { + "type": "boolean", + "description": "Whether to enable availability for mobile SDKs. Defaults to true.", + "example": true + } + } + }, + "CompletedBy": { + "type": "object", + "properties": { + "member": { + "description": "The LaunchDarkly member who marked this phase as complete", + "$ref": "#/components/schemas/MemberSummary" + }, + "token": { + "description": "The service token used to mark this phase as complete", + "$ref": "#/components/schemas/TokenSummary" + } + } + }, + "ConditionInput": { + "type": "object", + "properties": { + "scheduleKind": { + "description": "Whether the scheduled execution of the workflow stage is relative or absolute. If relative, the waitDuration and waitDurationUnit specify when the execution occurs. If absolute, the executionDate specifies when the execution occurs.", + "example": "relative", + "enum": [ + "absolute", + "relative" + ], + "$ref": "#/components/schemas/ScheduleKind" + }, + "executionDate": { + "description": "For workflow stages whose scheduled execution is absolute, the time, in Unix milliseconds, when the stage should start.", + "example": "1706810400000", + "$ref": "#/components/schemas/UnixMillis" + }, + "waitDuration": { + "type": "integer", + "description": "For workflow stages whose scheduled execution is relative, how far in the future the stage should start.", + "example": 2 + }, + "waitDurationUnit": { + "description": "For workflow stages whose scheduled execution is relative, the unit of measure for the waitDuration.", + "example": "calendarDay", + "enum": [ + "minute", + "hour", + "calendarDay", + "calendarWeek" + ], + "$ref": "#/components/schemas/DurationUnit" + }, + "executeNow": { + "type": "boolean", + "description": "Whether the workflow stage should be executed immediately", + "example": false + }, + "description": { + "type": "string", + "description": "A description of the approval required for this stage", + "example": "Require example-team approval for final stage" + }, + "notifyMemberIds": { + "type": "array", + "description": "A list of member IDs for the members to request approval from for this stage", + "items": { + "type": "string" + }, + "example": [ + "507f1f77bcf86cd799439011" + ] + }, + "notifyTeamKeys": { + "type": "array", + "description": "A list of team keys for the teams to request approval from for this stage", + "items": { + "type": "string" + }, + "example": [ + "example-team" + ] + }, + "kind": { + "description": "The type of condition to meet before executing this stage of the workflow. Use schedule to schedule a workflow stage. Use ld-approval to add an approval request to a workflow stage.", + "example": "schedule", + "$ref": "#/components/schemas/ConditionKind" + } + } + }, + "ConditionKind": { + "type": "string" + }, + "ConditionOutput": { + "type": "object", + "required": [ + "_id", + "_execution", + "description", + "notifyMemberIds", + "allReviews", + "reviewStatus" + ], + "properties": { + "_id": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "_execution": { + "$ref": "#/components/schemas/ExecutionOutput" + }, + "scheduleKind": { + "$ref": "#/components/schemas/ScheduleKind" + }, + "executionDate": { + "$ref": "#/components/schemas/UnixMillis" + }, + "waitDuration": { + "type": "integer" + }, + "waitDurationUnit": { + "$ref": "#/components/schemas/DurationUnit" + }, + "description": { + "type": "string" + }, + "notifyMemberIds": { + "type": "array", + "items": { + "type": "string" + } + }, + "allReviews": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReviewOutput" + } + }, + "reviewStatus": { + "type": "string" + }, + "appliedDate": { + "$ref": "#/components/schemas/UnixMillis" + } + } + }, + "ConfidenceIntervalRep": { + "type": "object", + "properties": { + "upper": { + "type": "number" + }, + "lower": { + "type": "number" + } + } + }, + "Conflict": { + "type": "object", + "properties": { + "instruction": { + "description": "Instruction in semantic patch format to be applied to the feature flag", + "$ref": "#/components/schemas/Instruction" + }, + "reason": { + "type": "string", + "description": "Reason why the conflict exists" + } + } + }, + "ConflictOutput": { + "type": "object", + "required": [ + "stageId", + "message" + ], + "properties": { + "stageId": { + "type": "string", + "description": "The stage ID", + "example": "12ab3c4d5ef1a2345bcde67f" + }, + "message": { + "type": "string", + "description": "Message about the conflict" + } + } + }, + "ContextAttributeName": { + "type": "object", + "required": [ + "name", + "weight" + ], + "properties": { + "name": { + "type": "string", + "description": "A context attribute's name.", + "example": "/firstName" + }, + "weight": { + "type": "integer", + "description": "A relative estimate of the number of contexts seen recently that have an attribute with the associated name.", + "example": 2225 + }, + "redacted": { + "type": "boolean", + "description": "Whether or not the attribute has one or more redacted values.", + "example": false + } + } + }, + "ContextAttributeNames": { + "type": "object", + "required": [ + "kind", + "names" + ], + "properties": { + "kind": { + "type": "string", + "description": "The kind associated with this collection of context attribute names.", + "example": "user" + }, + "names": { + "type": "array", + "description": "A collection of context attribute names.", + "items": { + "$ref": "#/components/schemas/ContextAttributeName" + } + } + } + }, + "ContextAttributeNamesCollection": { + "type": "object", + "required": [ + "items" + ], + "properties": { + "items": { + "type": "array", + "description": "A collection of context attribute name data grouped by kind.", + "items": { + "$ref": "#/components/schemas/ContextAttributeNames" + } + } + } + }, + "ContextAttributeValue": { + "type": "object", + "required": [ + "name", + "weight" + ], + "properties": { + "name": { + "description": "A value for a context attribute.", + "example": "Sandy" + }, + "weight": { + "type": "integer", + "description": "A relative estimate of the number of contexts seen recently that have a matching value for a given attribute.", + "example": 35 + } + } + }, + "ContextAttributeValues": { + "type": "object", + "required": [ + "kind", + "values" + ], + "properties": { + "kind": { + "type": "string", + "description": "The kind associated with this collection of context attribute values.", + "example": "user" + }, + "values": { + "type": "array", + "description": "A collection of context attribute values.", + "items": { + "$ref": "#/components/schemas/ContextAttributeValue" + } + } + } + }, + "ContextAttributeValuesCollection": { + "type": "object", + "required": [ + "items" + ], + "properties": { + "items": { + "type": "array", + "description": "A collection of context attribute value data grouped by kind.", + "items": { + "$ref": "#/components/schemas/ContextAttributeValues" + } + } + } + }, + "ContextInstance": { + "type": "object", + "additionalProperties": {} + }, + "ContextInstanceEvaluation": { + "type": "object", + "required": [ + "name", + "key", + "_value", + "_links" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the flag.", + "example": "My Flag" + }, + "key": { + "type": "string", + "description": "Key of the flag.", + "example": "flag-key-123abc" + }, + "_value": { + "description": "The value of the flag variation that the context receives. If there is no defined default rule, this is null.", + "example": "true" + }, + "reason": { + "description": "Contains information about why that variation was selected.", + "example": "{\"kind\": \"RULE_MATCH\"}", + "$ref": "#/components/schemas/ContextInstanceEvaluationReason" + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "self": { + "href": "/api/v2/projects/{projectKey}/environments/{environmentKey}/flags/evaluate", + "type": "application/json" + }, + "site": { + "href": "/my-project/my-environment/features/sort.order/targeting", + "type": "text/html" + } + } + } + } + }, + "ContextInstanceEvaluationReason": { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "description": "Describes the general reason that LaunchDarkly selected this variation.", + "example": "OFF" + }, + "ruleIndex": { + "type": "integer", + "description": "The positional index of the matching rule if the kind is 'RULE_MATCH'. The index is 0-based.", + "example": 3 + }, + "ruleID": { + "type": "string", + "description": "The unique identifier of the matching rule if the kind is 'RULE_MATCH'.", + "example": "1234567890" + }, + "prerequisiteKey": { + "type": "string", + "description": "The key of the flag that failed if the kind is 'PREREQUISITE_FAILED'.", + "example": "someotherflagkey" + }, + "inExperiment": { + "type": "boolean", + "description": "Indicates whether the context was evaluated as part of an experiment.", + "example": true + }, + "errorKind": { + "type": "string", + "description": "The specific error type if the kind is 'ERROR'.", + "example": "tried to use uninitialized Context" + } + } + }, + "ContextInstanceEvaluations": { + "type": "object", + "required": [ + "items", + "_links" + ], + "properties": { + "items": { + "type": "array", + "description": "Details on the flag evaluations for this context instance", + "items": { + "$ref": "#/components/schemas/ContextInstanceEvaluation" + }, + "example": [ + { + "_links": { + "self": { + "href": "/api/v2/projects/{projectKey}/environments/{environmentKey}/flags/evaluate", + "type": "application/json" + }, + "site": { + "href": "/my-project/my-environment/features/sort.order/targeting", + "type": "text/html" + } + }, + "_value": true, + "key": "sort.order", + "name": "SortOrder", + "reason": { + "kind": "FALLTHROUGH" + } + }, + { + "_links": { + "self": { + "href": "/api/v2/projects/{projectKey}/environments/{environmentKey}/flags/evaluate", + "type": "application/json" + }, + "site": { + "href": "/my-project/my-environment/features/alternate.page/targeting", + "type": "text/html" + } + }, + "_value": false, + "key": "alternate.page", + "name": "AlternatePage", + "reason": { + "kind": "RULE_MATCH", + "ruleID": "b2530cdf-14c6-4e16-b660-00239e08f19b", + "ruleIndex": 1 + } + } + ] + }, + "totalCount": { + "type": "integer", + "description": "The number of flags", + "example": 2 + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "self": { + "href": "/api/v2/projects/{projectKey}/environments/{environmentKey}/flags/evaluate", + "type": "application/json" + } + } + } + } + }, + "ContextInstanceRecord": { + "type": "object", + "required": [ + "id", + "context" + ], + "properties": { + "lastSeen": { + "type": "string", + "format": "date-time", + "description": "Timestamp of the last time an evaluation occurred for this context instance", + "example": "2022-04-15T15:00:57.526470334Z" + }, + "id": { + "type": "string", + "description": "The context instance ID", + "example": "b3JnOmxhdW5jaGRhcmtseQ" + }, + "applicationId": { + "type": "string", + "description": "An identifier representing the application where the LaunchDarkly SDK is running", + "example": "GoSDK/1.2" + }, + "anonymousKinds": { + "type": "array", + "description": "A list of the context kinds this context was associated with that the SDK removed because they were marked as anonymous at flag evaluation", + "items": { + "type": "string" + }, + "example": [ + "device", + "privateKind" + ] + }, + "context": { + "description": "The context, including its kind and attributes", + "example": "{\"kind\": \"user\", \"key\": \"context-key-123abc\", \"name\": \"Sandy Smith\", \"email\": \"sandy@example.com\"}" + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "parent": { + "href": "/api/v2/projects/my-project/environments/my-environment", + "type": "application/json" + }, + "self": { + "href": "/api/v2/projects/my-project/environments/my-env/context-instances/organization:launch-darkly:user:henry?filter=applicationId:\"GoSDK/1.2\"", + "type": "application/json" + }, + "site": { + "href": "/my-project/my-environment/context-instances/organization:launch-darkly:user:henry", + "type": "text/html" + } + } + }, + "_access": { + "description": "Details on the allowed and denied actions for this context instance", + "$ref": "#/components/schemas/Access" + } + } + }, + "ContextInstanceSearch": { + "type": "object", + "properties": { + "filter": { + "type": "string", + "description": "A collection of context instance filters", + "example": "{\"filter\": \"kindKeys:{\"contains\": [\"user:Henry\"]},\"sort\": \"-ts\",\"limit\": 50}" + }, + "sort": { + "type": "string", + "description": "Specifies a field by which to sort. LaunchDarkly supports sorting by timestamp in ascending order by specifying ts for this value, or descending order by specifying -ts.", + "example": "-ts" + }, + "limit": { + "type": "integer", + "description": "Specifies the maximum number of items in the collection to return (max: 50, default: 20)", + "example": 10 + }, + "continuationToken": { + "type": "string", + "description": "Limits results to context instances with sort values after the value specified. You can use this for pagination, however, we recommend using the next link instead, because this value is an obfuscated string.", + "example": "QAGFKH1313KUGI2351" + } + } + }, + "ContextInstanceSegmentMembership": { + "type": "object", + "required": [ + "name", + "key", + "description", + "unbounded", + "external", + "isMember", + "isIndividuallyTargeted", + "isRuleTargeted", + "_links" + ], + "properties": { + "name": { + "type": "string", + "description": "A human-friendly name for the segment", + "example": "Segment Name" + }, + "key": { + "type": "string", + "description": "A unique key used to reference the segment", + "example": "segment-key-123abc" + }, + "description": { + "type": "string", + "description": "A description of the segment's purpose", + "example": "Segment description" + }, + "unbounded": { + "type": "boolean", + "description": "Whether this is an unbounded segment. Unbounded segments, also called big segments, may be list-based segments with more than 15,000 entries, or synced segments.", + "example": false + }, + "external": { + "type": "string", + "description": "If the segment is a synced segment, the name of the external source", + "example": "https://amplitude.com/myCohort" + }, + "isMember": { + "type": "boolean", + "description": "Whether the context is a member of this segment, either by explicit inclusion or by rule matching", + "example": true + }, + "isIndividuallyTargeted": { + "type": "boolean", + "description": "Whether the context is explicitly included in this segment", + "example": true + }, + "isRuleTargeted": { + "type": "boolean", + "description": "Whether the context is captured by this segment's rules. The value of this field is undefined if the context is also explicitly included (isIndividuallyTargeted is true).", + "example": false + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + } + } + }, + "ContextInstanceSegmentMemberships": { + "type": "object", + "required": [ + "items", + "_links" + ], + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ContextInstanceSegmentMembership" + } + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + } + } + }, + "ContextInstances": { + "type": "object", + "required": [ + "_environmentId", + "items" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "next": { + "href": "/api/v2/projects/my-project/environments/my-env/context-instances/organization:launch-darkly:user:henry?limit=2&continuationToken=2022-04-15T15:00:57.526470334Z", + "type": "application/json" + }, + "self": { + "href": "/api/v2/projects/my-proj/environments/my-env/context-instances/organization:launch-darkly:user:henry-jacobs?limit=2", + "type": "application/json" + } + } + }, + "totalCount": { + "type": "integer", + "description": "The number of unique context instances", + "example": 100 + }, + "_environmentId": { + "type": "string", + "description": "The environment ID", + "example": "57be1db38b75bf0772d11384" + }, + "continuationToken": { + "type": "string", + "description": "An obfuscated string that references the last context instance on the previous page of results. You can use this for pagination, however, we recommend using the next link instead.", + "example": "QAGFKH1313KUGI2351" + }, + "items": { + "type": "array", + "description": "A collection of context instances. Can include multiple versions of context instances that have the same id, but different applicationIds.", + "items": { + "$ref": "#/components/schemas/ContextInstanceRecord" + } + } + } + }, + "ContextKindCreatedFrom": { + "type": "string" + }, + "ContextKindRep": { + "type": "object", + "required": [ + "key", + "name", + "description", + "version", + "creationDate", + "lastModified", + "createdFrom" + ], + "properties": { + "key": { + "type": "string", + "description": "The context kind key", + "example": "organization-key-123abc" + }, + "name": { + "type": "string", + "description": "The context kind name", + "example": "Organization" + }, + "description": { + "type": "string", + "description": "The context kind description", + "example": "An example context kind, to enable targeting based on organization" + }, + "version": { + "type": "integer", + "description": "The context kind version", + "example": 4 + }, + "creationDate": { + "description": "Timestamp of when the context kind was created", + "example": "1668530155141", + "$ref": "#/components/schemas/UnixMillis" + }, + "lastModified": { + "description": "Timestamp of when the context kind was most recently changed", + "example": "1670341705251", + "$ref": "#/components/schemas/UnixMillis" + }, + "lastSeen": { + "description": "Timestamp of when a context of this context kind was most recently evaluated", + "example": "1671563538193", + "$ref": "#/components/schemas/UnixMillis" + }, + "createdFrom": { + "description": "How the context kind was created", + "example": "auto-add", + "enum": [ + "default", + "auto-add", + "manual" + ], + "$ref": "#/components/schemas/ContextKindCreatedFrom" + }, + "hideInTargeting": { + "type": "boolean", + "description": "Alias for archived.", + "example": false + }, + "archived": { + "type": "boolean", + "description": "Whether the context kind is archived. Archived context kinds are unavailable for targeting.", + "example": false + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + } + } + }, + "ContextKindsCollectionRep": { + "type": "object", + "required": [ + "items", + "_links" + ], + "properties": { + "items": { + "type": "array", + "description": "An array of context kinds", + "items": { + "$ref": "#/components/schemas/ContextKindRep" + } + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + } + } + }, + "ContextRecord": { + "type": "object", + "required": [ + "context" + ], + "properties": { + "lastSeen": { + "type": "string", + "format": "date-time", + "description": "Timestamp of the last time an evaluation occurred for this context", + "example": "2022-04-15T15:00:57.526470334Z" + }, + "applicationId": { + "type": "string", + "description": "An identifier representing the application where the LaunchDarkly SDK is running", + "example": "GoSDK/1.2" + }, + "context": { + "description": "The context, including its kind and attributes", + "example": "{\"kind\": \"user\", \"key\": \"context-key-123abc\", \"name\": \"Sandy Smith\", \"email\": \"sandy@example.com\"}" + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "parent": { + "href": "/api/v2/projects/my-project/environments/my-environment", + "type": "application/json" + }, + "self": { + "href": "/api/v2/projects/my-project/environments/my-env/contexts/organization:launch-darkly:user:henry?filter=applicationId:\"GoSDK/1.2\"", + "type": "application/json" + }, + "site": { + "href": "/my-project/my-environment/context/organization:launch-darkly:user:henry", + "type": "text/html" + } + } + }, + "_access": { + "description": "Details on the allowed and denied actions for this context instance", + "$ref": "#/components/schemas/Access" + }, + "associatedContexts": { + "type": "integer", + "description": "The total number of associated contexts. Associated contexts are contexts that have appeared in the same context instance, that is, they were part of the same flag evaluation.", + "example": 0 + } + } + }, + "ContextSearch": { + "type": "object", + "properties": { + "filter": { + "type": "string", + "description": "A collection of context filters", + "example": "*.name startsWith Jo,kind anyOf [\"user\",\"organization\"]" + }, + "sort": { + "type": "string", + "description": "Specifies a field by which to sort. LaunchDarkly supports sorting by timestamp in ascending order by specifying ts for this value, or descending order by specifying -ts.", + "example": "-ts" + }, + "limit": { + "type": "integer", + "description": "Specifies the maximum number of items in the collection to return (max: 50, default: 20)", + "example": 10 + }, + "continuationToken": { + "type": "string", + "description": "Limits results to contexts with sort values after the value specified. You can use this for pagination, however, we recommend using the next link instead, because this value is an obfuscated string.", + "example": "QAGFKH1313KUGI2351" + } + } + }, + "Contexts": { + "type": "object", + "required": [ + "_environmentId", + "items" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "next": { + "href": "/app.launchdarkly.com/api/v2/projects/my-project/environments/my-environment/contexts?filter=kind:{\"equals\": [\"organization\"]}&limit=2&continuationToken=QAGFKH1313KUGI2351", + "type": "application/json" + }, + "self": { + "href": "/api/v2/projects/my-proj/environments/my-env/contexts?filter=kind:{\"equals\": [\"organization\"]}&limit=2&continuationToken=QAGFKH1313KUGI2351", + "type": "application/json" + } + } + }, + "totalCount": { + "type": "integer", + "description": "The number of contexts", + "example": 100 + }, + "_environmentId": { + "type": "string", + "description": "The environment ID where the context was evaluated", + "example": "57be1db38b75bf0772d11384" + }, + "continuationToken": { + "type": "string", + "description": "An obfuscated string that references the last context instance on the previous page of results. You can use this for pagination, however, we recommend using the next link instead.", + "example": "QAGFKH1313KUGI2351" + }, + "items": { + "type": "array", + "description": "A collection of contexts. Can include multiple versions of contexts that have the same kind and key, but different applicationIds.", + "items": { + "$ref": "#/components/schemas/ContextRecord" + } + } + } + }, + "CopiedFromEnv": { + "type": "object", + "required": [ + "key" + ], + "properties": { + "key": { + "type": "string", + "description": "Key of feature flag copied", + "example": "source-flag-key-123abc" + }, + "version": { + "type": "integer", + "description": "Version of feature flag copied", + "example": 1 + } + } + }, + "CreatePhaseInput": { + "type": "object", + "required": [ + "audiences", + "name" + ], + "properties": { + "audiences": { + "type": "array", + "description": "An ordered list of the audiences for this release phase. Each audience corresponds to a LaunchDarkly environment.", + "items": { + "$ref": "#/components/schemas/AudiencePost" + } + }, + "name": { + "type": "string", + "description": "The release phase name", + "example": "Phase 1 - Testing" + } + } + }, + "CreateReleasePipelineInput": { + "type": "object", + "required": [ + "key", + "name", + "phases" + ], + "properties": { + "description": { + "type": "string", + "description": "The release pipeline description", + "example": "Standard pipeline to roll out to production" + }, + "key": { + "type": "string", + "description": "The unique identifier of this release pipeline", + "example": "standard-pipeline" + }, + "name": { + "type": "string", + "description": "The name of the release pipeline", + "example": "Standard Pipeline" + }, + "phases": { + "type": "array", + "description": "A logical grouping of one or more environments that share attributes for rolling out changes", + "items": { + "$ref": "#/components/schemas/CreatePhaseInput" + } + }, + "tags": { + "type": "array", + "description": "A list of tags for this release pipeline", + "items": { + "type": "string" + }, + "example": [ + "example-tag" + ] + } + } + }, + "CreateWorkflowTemplateInput": { + "type": "object", + "required": [ + "key" + ], + "properties": { + "key": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "workflowId": { + "$ref": "#/components/schemas/FeatureWorkflowId" + }, + "stages": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StageInput" + } + }, + "projectKey": { + "type": "string" + }, + "environmentKey": { + "type": "string" + }, + "flagKey": { + "type": "string" + } + } + }, + "CredibleIntervalRep": { + "type": "object", + "properties": { + "upper": { + "type": "number", + "description": "The upper bound", + "example": 0.6713222134386467 + }, + "lower": { + "type": "number", + "description": "The lower bound", + "example": 0.4060771673663068 + } + } + }, + "CustomProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/customProperty" + } + }, + "CustomRole": { + "type": "object", + "required": [ + "_id", + "_links", + "key", + "name", + "policy" + ], + "properties": { + "_id": { + "type": "string", + "description": "The ID of the custom role", + "example": "1234a56b7c89d012345e678f" + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + }, + "_access": { + "description": "Details on the allowed and denied actions for this custom role", + "$ref": "#/components/schemas/Access" + }, + "description": { + "type": "string", + "description": "The description of the custom role", + "example": "This custom role is just an example" + }, + "key": { + "type": "string", + "description": "The key of the custom role", + "example": "example-custom-role" + }, + "name": { + "type": "string", + "description": "The name of the custom role", + "example": "Example custom role" + }, + "policy": { + "type": "array", + "description": "An array of the policies that comprise this custom role", + "items": { + "$ref": "#/components/schemas/Statement" + } + }, + "basePermissions": { + "description": "Base permissions to use for this role", + "example": "reader", + "$ref": "#/components/schemas/RoleType" + } + } + }, + "CustomRolePost": { + "type": "object", + "required": [ + "name", + "key", + "policy" + ], + "properties": { + "name": { + "type": "string", + "description": "A human-friendly name for the custom role", + "example": "Ops team" + }, + "key": { + "type": "string", + "description": "The custom role key", + "example": "role-key-123abc" + }, + "description": { + "type": "string", + "description": "Description of custom role", + "example": "An example role for members of the ops team" + }, + "policy": { + "description": "Resource statements for custom role", + "$ref": "#/components/schemas/StatementPostList" + }, + "basePermissions": { + "description": "Base permissions to use for this role.", + "example": "reader", + "enum": [ + "reader", + "no_access" + ], + "$ref": "#/components/schemas/RoleType" + } + } + }, + "CustomRoles": { + "type": "object", + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + }, + "items": { + "type": "array", + "description": "An array of custom roles", + "items": { + "$ref": "#/components/schemas/CustomRole" + } + } + } + }, + "CustomWorkflowInput": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "maintainerId": { + "description": "The ID of the workflow maintainer. Defaults to the workflow creator.", + "example": "12ab3c45de678910abc12345", + "$ref": "#/components/schemas/ObjectId" + }, + "name": { + "type": "string", + "description": "The workflow name", + "example": "Progressive rollout starting in two days" + }, + "description": { + "type": "string", + "description": "The workflow description", + "example": "Turn flag on for 10% of users each day" + }, + "stages": { + "type": "array", + "description": "A list of the workflow stages", + "items": { + "$ref": "#/components/schemas/StageInput" + } + }, + "templateKey": { + "type": "string", + "description": "The template key" + } + } + }, + "CustomWorkflowMeta": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the workflow stage that required this approval request", + "example": "Example workflow name" + }, + "stage": { + "description": "Details on the stage of the workflow where this approval request is required", + "$ref": "#/components/schemas/CustomWorkflowStageMeta" + } + } + }, + "CustomWorkflowOutput": { + "type": "object", + "required": [ + "_id", + "_version", + "_conflicts", + "_creationDate", + "_maintainerId", + "_links", + "name", + "_execution" + ], + "properties": { + "_id": { + "type": "string", + "description": "The ID of the workflow", + "example": "12ab3c4d5ef1a2345bcde67f" + }, + "_version": { + "type": "integer", + "description": "The version of the workflow", + "example": 1 + }, + "_conflicts": { + "type": "array", + "description": "Any conflicts that are present in the workflow stages", + "items": { + "$ref": "#/components/schemas/ConflictOutput" + } + }, + "_creationDate": { + "description": "Timestamp of when the workflow was created", + "example": "1654104600000", + "$ref": "#/components/schemas/UnixMillis" + }, + "_maintainerId": { + "type": "string", + "description": "The member ID of the maintainer of the workflow. Defaults to the workflow creator.", + "example": "12ab3c45de678910abc12345" + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + }, + "name": { + "type": "string", + "description": "The name of the workflow", + "example": "Progressive rollout starting in two days" + }, + "description": { + "type": "string", + "description": "A brief description of the workflow", + "example": "Turn flag on for 10% of customers each day" + }, + "kind": { + "type": "string", + "description": "The kind of workflow", + "example": "custom" + }, + "stages": { + "type": "array", + "description": "The stages that make up the workflow. Each stage contains conditions and actions.", + "items": { + "$ref": "#/components/schemas/StageOutput" + } + }, + "_execution": { + "description": "The current execution status of the workflow", + "example": "{\"status\": \"completed\"}", + "$ref": "#/components/schemas/ExecutionOutput" + }, + "meta": { + "description": "For workflows being created from a workflow template, this value holds any parameters that could potentially be incompatible with the current project, environment, or flag", + "$ref": "#/components/schemas/WorkflowTemplateMetadata" + }, + "templateKey": { + "type": "string", + "description": "For workflows being created from a workflow template, this value is the template's key", + "example": "example-workflow-template" + } + } + }, + "CustomWorkflowStageMeta": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "The zero-based index of the workflow stage", + "example": 0 + }, + "name": { + "type": "string", + "description": "The name of the workflow stage", + "example": "Stage 1" + } + } + }, + "CustomWorkflowsListingOutput": { + "type": "object", + "required": [ + "items", + "totalCount", + "_links" + ], + "properties": { + "items": { + "type": "array", + "description": "An array of workflows", + "items": { + "$ref": "#/components/schemas/CustomWorkflowOutput" + } + }, + "totalCount": { + "type": "integer", + "description": "Total number of workflows", + "example": 1 + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + } + } + }, + "DateVersion": { + "type": "integer" + }, + "DefaultClientSideAvailability": { + "type": "object", + "required": [ + "usingMobileKey", + "usingEnvironmentId" + ], + "properties": { + "usingMobileKey": { + "type": "boolean", + "description": "Whether to enable availability for mobile SDKs", + "example": true + }, + "usingEnvironmentId": { + "type": "boolean", + "description": "Whether to enable availability for client-side SDKs", + "example": true + } + } + }, + "DefaultClientSideAvailabilityPost": { + "type": "object", + "required": [ + "usingEnvironmentId", + "usingMobileKey" + ], + "properties": { + "usingEnvironmentId": { + "type": "boolean", + "description": "Whether to enable availability for client-side SDKs.", + "example": true + }, + "usingMobileKey": { + "type": "boolean", + "description": "Whether to enable availability for mobile SDKs.", + "example": true + } + } + }, + "Defaults": { + "type": "object", + "required": [ + "onVariation", + "offVariation" + ], + "properties": { + "onVariation": { + "type": "integer", + "description": "The index, from the array of variations for this flag, of the variation to serve by default when targeting is on.", + "example": 0 + }, + "offVariation": { + "type": "integer", + "description": "The index, from the array of variations for this flag, of the variation to serve by default when targeting is off.", + "example": 1 + } + } + }, + "DependentExperimentListRep": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DependentExperimentRep" + } + }, + "DependentExperimentRep": { + "type": "object", + "required": [ + "key", + "name", + "environmentId", + "environmentKey", + "creationDate", + "_links" + ], + "properties": { + "key": { + "type": "string", + "description": "The experiment key", + "example": "experiment-key-123abc" + }, + "name": { + "type": "string", + "description": "The experiment name", + "example": "Example experiment" + }, + "environmentId": { + "type": "string", + "description": "The environment ID", + "example": "1234a56b7c89d012345e678f" + }, + "environmentKey": { + "type": "string", + "description": "The environment key", + "example": "production" + }, + "creationDate": { + "description": "Timestamp of when the experiment was created", + "example": "1654104600000", + "$ref": "#/components/schemas/UnixMillis" + }, + "archivedDate": { + "description": "Timestamp of when the experiment was archived", + "example": "1654104600000", + "$ref": "#/components/schemas/UnixMillis" + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "parent": { + "href": "/api/v2/projects/my-project/environments/my-environment", + "type": "application/json" + }, + "self": { + "href": "/api/v2/projects/my-project/environments/my-environment/experiments/example-experiment", + "type": "application/json" + } + } + } + } + }, + "DependentFlag": { + "type": "object", + "required": [ + "key", + "_links", + "_site" + ], + "properties": { + "name": { + "type": "string", + "description": "The flag name", + "example": "Example dependent flag" + }, + "key": { + "type": "string", + "description": "The flag key", + "example": "dependent-flag-key-123abc" + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + }, + "_site": { + "description": "Details on how to access the dependent flag in the LaunchDarkly UI", + "example": "{ \"href\": \"/example-project/example-environment/features/example-dependent-flag\", \"type\": \"text/html\" }", + "$ref": "#/components/schemas/Link" + } + } + }, + "DependentFlagEnvironment": { + "type": "object", + "required": [ + "key", + "_links", + "_site" + ], + "properties": { + "name": { + "type": "string", + "description": "The environment name", + "example": "Example environment" + }, + "key": { + "type": "string", + "description": "The environment key", + "example": "environment-key-123abc" + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + }, + "_site": { + "description": "Details on how to access the dependent flag in this environment in the LaunchDarkly UI", + "example": "{ \"href\": \"/example-project/example-environment/features/example-dependent-flag\", \"type\": \"text/html\" }", + "$ref": "#/components/schemas/Link" + } + } + }, + "DependentFlagsByEnvironment": { + "type": "object", + "required": [ + "items", + "_links", + "_site" + ], + "properties": { + "items": { + "type": "array", + "description": "A list of dependent flags, which are flags that use the requested flag as a prerequisite", + "items": { + "$ref": "#/components/schemas/DependentFlag" + } + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + }, + "_site": { + "description": "Details on how to access the prerequisite flag in the LaunchDarkly UI", + "example": "{ \"href\": \"/example-project/~/features/example-prereq-flag\", \"type\": \"text/html\" }", + "$ref": "#/components/schemas/Link" + } + } + }, + "DependentMetricGroupRep": { + "type": "object", + "required": [ + "key", + "name", + "kind", + "_links" + ], + "properties": { + "key": { + "type": "string", + "description": "A unique key to reference the metric group", + "example": "metric-group-key-123abc" + }, + "name": { + "type": "string", + "description": "A human-friendly name for the metric group", + "example": "My metric group" + }, + "kind": { + "type": "string", + "description": "The type of the metric group", + "example": "funnel", + "enum": [ + "funnel" + ] + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "parent": { + "href": "/api/v2/projects/my-project", + "type": "application/json" + }, + "self": { + "href": "/api/v2/projects/my-project/metric-groups/my-metric-group", + "type": "application/json" + } + } + } + } + }, + "DependentMetricGroupRepWithMetrics": { + "type": "object", + "required": [ + "key", + "name", + "kind", + "_links" + ], + "properties": { + "key": { + "type": "string", + "description": "A unique key to reference the metric group", + "example": "metric-group-key-123abc" + }, + "name": { + "type": "string", + "description": "A human-friendly name for the metric group", + "example": "My metric group" + }, + "kind": { + "type": "string", + "description": "The type of the metric group", + "example": "funnel", + "enum": [ + "funnel" + ] + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "parent": { + "href": "/api/v2/projects/my-project", + "type": "application/json" + }, + "self": { + "href": "/api/v2/projects/my-project/metric-groups/my-metric-group", + "type": "application/json" + } + } + }, + "metrics": { + "type": "array", + "description": "The metrics in the metric group", + "items": { + "$ref": "#/components/schemas/MetricInGroupRep" + } + } + } + }, + "DependentMetricOrMetricGroupRep": { + "type": "object", + "required": [ + "key", + "_versionId", + "name", + "kind", + "_links", + "isGroup" + ], + "properties": { + "key": { + "type": "string", + "description": "A unique key to reference the metric or metric group", + "example": "metric-key-123abc" + }, + "_versionId": { + "type": "string", + "description": "The version ID of the metric or metric group" + }, + "name": { + "type": "string", + "description": "A human-friendly name for the metric or metric group", + "example": "My metric" + }, + "kind": { + "type": "string", + "description": "If this is a metric, then it represents the kind of event the metric tracks. If this is a metric group, then it represents the group type", + "example": "custom", + "enum": [ + "pageview", + "click", + "custom", + "funnel", + "standard" + ] + }, + "isNumeric": { + "type": "boolean", + "description": "For custom metrics, whether to track numeric changes in value against a baseline (true) or to track a conversion when an end user takes an action (false).", + "example": true + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "self": { + "href": "/api/v2/metrics/my-project/my-metric", + "type": "application/json" + } + } + }, + "isGroup": { + "type": "boolean", + "description": "Whether this is a metric group or a metric" + }, + "metrics": { + "type": "array", + "description": "An ordered list of the metrics in this metric group", + "items": { + "$ref": "#/components/schemas/MetricInGroupRep" + } + } + } + }, + "Destination": { + "type": "object", + "properties": { + "_id": { + "type": "string", + "description": "The ID of this Data Export destination", + "example": "610addeadbeefaa86ec9a7d4" + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "parent": { + "href": "/api/v2/destinations", + "type": "application/json" + }, + "self": { + "href": "/api/v2/destinations/my-project/my-environment/610addeadbeefaa86ec9a7d4", + "type": "application/json" + } + } + }, + "name": { + "type": "string", + "description": "A human-readable name for your Data Export destination", + "example": "example-destination" + }, + "kind": { + "type": "string", + "description": "The type of Data Export destination", + "example": "google-pubsub", + "enum": [ + "google-pubsub", + "kinesis", + "mparticle", + "segment", + "azure-event-hubs" + ] + }, + "version": { + "type": "number", + "example": 1 + }, + "config": { + "description": "An object with the configuration parameters required for the destination type", + "example": "{\"project\":\"test-prod\",\"topic\":\"ld-pubsub-test-192301\"}" + }, + "on": { + "type": "boolean", + "description": "Whether the export is on, that is, the status of the integration", + "example": true + }, + "_access": { + "description": "Details on the allowed and denied actions for this Data Export destination", + "$ref": "#/components/schemas/Access" + } + } + }, + "DestinationPost": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "A human-readable name for your Data Export destination", + "example": "example-destination" + }, + "kind": { + "type": "string", + "description": "The type of Data Export destination", + "example": "google-pubsub", + "enum": [ + "google-pubsub", + "kinesis", + "mparticle", + "segment", + "azure-event-hubs" + ] + }, + "config": { + "description": "An object with the configuration parameters required for the destination type", + "example": "{\"project\":\"test-prod\",\"topic\":\"ld-pubsub-test-192301\"}" + }, + "on": { + "type": "boolean", + "description": "Whether the export is on. Displayed as the integration status in the LaunchDarkly UI.", + "example": true + } + } + }, + "Destinations": { + "type": "object", + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "self": { + "href": "/api/v2/destinations", + "type": "application/json" + } + } + }, + "items": { + "type": "array", + "description": "An array of Data Export destinations", + "items": { + "$ref": "#/components/schemas/Destination" + } + } + } + }, + "Distribution": { + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "The type of distribution.", + "example": "normal", + "enum": [ + "normal", + "beta" + ] + }, + "parameters": { + "type": "object", + "additionalProperties": {}, + "description": "The parameters of the distribution. The parameters are different for each distribution type. When kind is normal, the parameters of the distribution are 'mu' and 'sigma'. When kind is beta, the parameters of the distribution are 'alpha' and 'beta.'" + } + } + }, + "DurationUnit": { + "type": "string" + }, + "Environment": { + "type": "object", + "required": [ + "_links", + "_id", + "key", + "name", + "apiKey", + "mobileKey", + "color", + "defaultTtl", + "secureMode", + "defaultTrackEvents", + "requireComments", + "confirmChanges", + "tags", + "critical" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "self": { + "href": "/api/v2/projects/my-project/environments/my-environment", + "type": "application/json" + } + } + }, + "_id": { + "type": "string", + "description": "The ID for the environment. Use this as the client-side ID for authorization in some client-side SDKs, and to associate LaunchDarkly environments with CDN integrations in edge SDKs.", + "example": "57be1db38b75bf0772d11384" + }, + "key": { + "type": "string", + "description": "A project-unique key for the new environment", + "example": "environment-key-123abc" + }, + "name": { + "type": "string", + "description": "A human-friendly name for the new environment", + "example": "My Environment" + }, + "apiKey": { + "type": "string", + "description": "The SDK key for the environment. Use this for authorization in server-side SDKs.", + "example": "sdk-xxx" + }, + "mobileKey": { + "type": "string", + "description": "The mobile key for the environment. Use this for authorization in mobile SDKs.", + "example": "mob-xxx" + }, + "color": { + "type": "string", + "description": "The color used to indicate this environment in the UI", + "example": "F5A623" + }, + "defaultTtl": { + "type": "integer", + "description": "The default time (in minutes) that the PHP SDK can cache feature flag rules locally", + "example": 5 + }, + "secureMode": { + "type": "boolean", + "description": "Ensures that one end user of the client-side SDK cannot inspect the variations for another end user", + "example": true + }, + "defaultTrackEvents": { + "type": "boolean", + "description": "Enables tracking detailed information for new flags by default", + "example": false + }, + "requireComments": { + "type": "boolean", + "description": "Whether members who modify flags and segments through the LaunchDarkly user interface are required to add a comment", + "example": true + }, + "confirmChanges": { + "type": "boolean", + "description": "Whether members who modify flags and segments through the LaunchDarkly user interface are required to confirm those changes", + "example": true + }, + "tags": { + "type": "array", + "description": "A list of tags for this environment", + "items": { + "type": "string" + }, + "example": [ + "ops" + ] + }, + "approvalSettings": { + "description": "Details on the approval settings for this environment", + "$ref": "#/components/schemas/ApprovalSettings" + }, + "critical": { + "type": "boolean", + "description": "Whether the environment is critical", + "example": true + } + } + }, + "EnvironmentPost": { + "type": "object", + "required": [ + "name", + "key", + "color" + ], + "properties": { + "name": { + "type": "string", + "description": "A human-friendly name for the new environment", + "example": "My Environment" + }, + "key": { + "type": "string", + "description": "A project-unique key for the new environment", + "example": "environment-key-123abc" + }, + "color": { + "type": "string", + "description": "A color to indicate this environment in the UI", + "example": "F5A623" + }, + "defaultTtl": { + "type": "integer", + "description": "The default time (in minutes) that the PHP SDK can cache feature flag rules locally", + "example": 5 + }, + "secureMode": { + "type": "boolean", + "description": "Ensures that one end user of the client-side SDK cannot inspect the variations for another end user", + "example": true + }, + "defaultTrackEvents": { + "type": "boolean", + "description": "Enables tracking detailed information for new flags by default", + "example": false + }, + "confirmChanges": { + "type": "boolean", + "description": "Requires confirmation for all flag and segment changes via the UI in this environment", + "example": false + }, + "requireComments": { + "type": "boolean", + "description": "Requires comments for all flag and segment changes via the UI in this environment", + "example": false + }, + "tags": { + "type": "array", + "description": "Tags to apply to the new environment", + "items": { + "type": "string" + }, + "example": [ + "ops" + ] + }, + "source": { + "description": "Indicates that the new environment created will be cloned from the provided source environment", + "$ref": "#/components/schemas/SourceEnv" + }, + "critical": { + "type": "boolean", + "description": "Whether the environment is critical", + "example": true + } + } + }, + "EnvironmentSummary": { + "type": "object", + "required": [ + "_links", + "key", + "name", + "color" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "self": { + "href": "/api/v2/projects/my-project/environments/my-environment", + "type": "application/json" + } + } + }, + "key": { + "type": "string", + "description": "A project-unique key for the environment", + "example": "environment-key-123abc" + }, + "name": { + "type": "string", + "description": "A human-friendly name for the environment", + "example": "My Environment" + }, + "color": { + "type": "string", + "description": "The color used to indicate this environment in the UI", + "example": "F5A623" + } + } + }, + "Environments": { + "type": "object", + "required": [ + "items" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + }, + "totalCount": { + "type": "integer", + "description": "The number of environments returned", + "example": 2 + }, + "items": { + "type": "array", + "description": "An array of environments", + "items": { + "$ref": "#/components/schemas/Environment" + } + } + } + }, + "EvaluationReason": { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "description": "Describes the general reason that LaunchDarkly selected this variation.", + "example": "OFF" + }, + "ruleIndex": { + "type": "integer", + "description": "The positional index of the matching rule if the kind is 'RULE_MATCH'. The index is 0-based.", + "example": 3 + }, + "ruleID": { + "type": "string", + "description": "The unique identifier of the matching rule if the kind is 'RULE_MATCH'.", + "example": "1234567890" + }, + "prerequisiteKey": { + "type": "string", + "description": "The key of the flag that failed if the kind is 'PREREQUISITE_FAILED'.", + "example": "someotherflagkey" + }, + "inExperiment": { + "type": "boolean", + "description": "Indicates whether the evaluation occurred as part of an experiment.", + "example": true + }, + "errorKind": { + "type": "string", + "description": "The specific error type if the kind is 'ERROR'.", + "example": "USER_NOT_SPECIFIED" + } + } + }, + "ExecutionOutput": { + "type": "object", + "required": [ + "status" + ], + "properties": { + "status": { + "type": "string", + "description": "The status of the execution of this workflow stage", + "example": "completed" + }, + "stopDate": { + "description": "Timestamp of when the workflow was completed.", + "example": "1718467200000", + "$ref": "#/components/schemas/UnixMillis" + } + } + }, + "ExpandableApprovalRequestResponse": { + "type": "object", + "required": [ + "_id", + "_version", + "creationDate", + "serviceKind", + "reviewStatus", + "allReviews", + "notifyMemberIds", + "status", + "instructions", + "conflicts", + "_links" + ], + "properties": { + "_id": { + "type": "string", + "description": "The ID of this approval request", + "example": "12ab3c45de678910abc12345" + }, + "_version": { + "type": "integer", + "description": "Version of the approval request", + "example": 1 + }, + "creationDate": { + "description": "Timestamp of when the approval request was created", + "example": "1654104600000", + "$ref": "#/components/schemas/UnixMillis" + }, + "serviceKind": { + "description": "The approval service for this request. May be LaunchDarkly or an external approval service, such as ServiceNow or JIRA.", + "example": "launchdarkly", + "$ref": "#/components/schemas/ApprovalRequestServiceKind" + }, + "requestorId": { + "type": "string", + "description": "The ID of the member who requested the approval", + "example": "12ab3c45de678910abc12345" + }, + "description": { + "type": "string", + "description": "A human-friendly name for the approval request", + "example": "example: request approval from someone" + }, + "reviewStatus": { + "type": "string", + "description": "Current status of the review of this approval request", + "example": "pending", + "enum": [ + "approved", + "declined", + "pending" + ] + }, + "allReviews": { + "type": "array", + "description": "An array of individual reviews of this approval request", + "items": { + "$ref": "#/components/schemas/ReviewResponse" + } + }, + "notifyMemberIds": { + "type": "array", + "description": "An array of member IDs. These members are notified to review the approval request.", + "items": { + "type": "string" + }, + "example": [ + "1234a56b7c89d012345e678f" + ] + }, + "appliedDate": { + "description": "Timestamp of when the approval request was applied", + "example": "1654104600000", + "$ref": "#/components/schemas/UnixMillis" + }, + "appliedByMemberId": { + "type": "string", + "description": "The member ID of the member who applied the approval request", + "example": "1234a56b7c89d012345e678f" + }, + "appliedByServiceTokenId": { + "type": "string", + "description": "The service token ID of the service token which applied the approval request", + "example": "1234a56b7c89d012345e678f" + }, + "status": { + "type": "string", + "description": "Current status of the approval request", + "example": "pending", + "enum": [ + "pending", + "completed", + "failed", + "scheduled" + ] + }, + "instructions": { + "description": "List of instructions in semantic patch format to be applied to the feature flag", + "example": "[{\"kind\": \"turnFlagOn\"}]", + "$ref": "#/components/schemas/Instructions" + }, + "conflicts": { + "type": "array", + "description": "Details on any conflicting approval requests", + "items": { + "$ref": "#/components/schemas/Conflict" + } + }, + "_links": { + "type": "object", + "additionalProperties": {}, + "description": "The location and content type of related resources" + }, + "executionDate": { + "description": "Timestamp for when instructions will be executed", + "example": "1654104600000", + "$ref": "#/components/schemas/UnixMillis" + }, + "operatingOnId": { + "type": "string", + "description": "ID of scheduled change to edit or delete", + "example": "12ab3c45de678910abc12345" + }, + "integrationMetadata": { + "description": "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", + "$ref": "#/components/schemas/IntegrationMetadata" + }, + "source": { + "description": "Details about the source feature flag, if copied", + "$ref": "#/components/schemas/CopiedFromEnv" + }, + "customWorkflowMetadata": { + "description": "Details about the custom workflow, if this approval request is part of a custom workflow", + "$ref": "#/components/schemas/CustomWorkflowMeta" + }, + "resourceId": { + "type": "string", + "description": "String representation of a resource" + }, + "approvalSettings": { + "description": "The settings for this approval", + "$ref": "#/components/schemas/ApprovalSettings" + }, + "project": { + "description": "Project the approval request belongs to", + "$ref": "#/components/schemas/Project" + }, + "environments": { + "type": "array", + "description": "List of environments the approval impacts", + "items": { + "$ref": "#/components/schemas/Environment" + } + }, + "flag": { + "description": "Flag the approval request belongs to", + "$ref": "#/components/schemas/ExpandedFlagRep" + } + } + }, + "ExpandableApprovalRequestsResponse": { + "type": "object", + "required": [ + "items", + "totalCount", + "_links" + ], + "properties": { + "items": { + "type": "array", + "description": "An array of approval requests", + "items": { + "$ref": "#/components/schemas/ExpandableApprovalRequestResponse" + } + }, + "totalCount": { + "type": "integer", + "description": "Total number of approval requests", + "example": 1 + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + } + } + }, + "ExpandedFlagRep": { + "type": "object", + "required": [ + "name", + "kind", + "key", + "_version", + "creationDate", + "variations", + "temporary", + "tags", + "_links", + "customProperties", + "archived" + ], + "properties": { + "name": { + "type": "string", + "description": "A human-friendly name for the feature flag", + "example": "My Flag" + }, + "kind": { + "type": "string", + "description": "Kind of feature flag", + "example": "boolean", + "enum": [ + "boolean", + "multivariate" + ] + }, + "description": { + "type": "string", + "description": "Description of the feature flag", + "example": "This flag controls the example widgets" + }, + "key": { + "type": "string", + "description": "A unique key used to reference the flag in your code", + "example": "flag-key-123abc" + }, + "_version": { + "type": "integer", + "description": "Version of the feature flag", + "example": 1 + }, + "creationDate": { + "description": "Timestamp of flag creation date", + "example": "1494437420312", + "$ref": "#/components/schemas/UnixMillis" + }, + "includeInSnippet": { + "type": "boolean", + "description": "Deprecated, use clientSideAvailability. Whether this flag should be made available to the client-side JavaScript SDK", + "example": true, + "deprecated": true + }, + "clientSideAvailability": { + "description": "Which type of client-side SDKs the feature flag is available to", + "example": "{\"usingMobileKey\":true,\"usingEnvironmentId\":false}", + "$ref": "#/components/schemas/ClientSideAvailability" + }, + "variations": { + "type": "array", + "description": "An array of possible variations for the flag", + "items": { + "$ref": "#/components/schemas/Variation" + }, + "example": [ + { + "_id": "e432f62b-55f6-49dd-a02f-eb24acf39d05", + "value": true + }, + { + "_id": "a00bf58d-d252-476c-b915-15a74becacb4", + "value": false + } + ] + }, + "temporary": { + "type": "boolean", + "description": "Whether the flag is a temporary flag", + "example": true + }, + "tags": { + "type": "array", + "description": "Tags for the feature flag", + "items": { + "type": "string" + }, + "example": [ + "example-tag" + ] + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "parent": { + "href": "/api/v2/flags/my-project", + "type": "application/json" + }, + "self": { + "href": "/api/v2/flags/my-project/my-flag", + "type": "application/json" + } + } + }, + "maintainerId": { + "type": "string", + "description": "The ID of the member who maintains the flag", + "example": "569f183514f4432160000007" + }, + "_maintainer": { + "description": "Details on the member who maintains this feature flag", + "$ref": "#/components/schemas/MemberSummary" + }, + "customProperties": { + "description": "Metadata attached to the feature flag, in the form of the property key associated with a name and array of values for the metadata to associate with this flag. Typically used to store data related to an integration.", + "example": "{\"jira.issues\":{\"name\":\"Jira issues\",\"value\":[\"is-123\",\"is-456\"]}}", + "$ref": "#/components/schemas/CustomProperties" + }, + "archived": { + "type": "boolean", + "description": "Boolean indicating if the feature flag is archived", + "example": false + }, + "archivedDate": { + "description": "If archived is true, date of archive", + "example": "1494437420312", + "$ref": "#/components/schemas/UnixMillis" + }, + "defaults": { + "description": "The indices, from the array of variations, for the variations to serve by default when targeting is on and when targeting is off. These variations will be used for this flag in new environments. If omitted, the first and last variation will be used.", + "example": "{\"onVariation\":0,\"offVariation\":1}", + "$ref": "#/components/schemas/Defaults" + } + } + }, + "Experiment": { + "type": "object", + "required": [ + "key", + "name", + "_maintainerId", + "_creationDate", + "_links" + ], + "properties": { + "_id": { + "type": "string", + "description": "The experiment ID", + "example": "12ab3c45de678910fgh12345" + }, + "key": { + "type": "string", + "description": "The experiment key", + "example": "experiment-key-123abc" + }, + "name": { + "type": "string", + "description": "The experiment name", + "example": "Example experiment" + }, + "description": { + "type": "string", + "description": "The experiment description", + "example": "An example experiment, used in testing" + }, + "_maintainerId": { + "type": "string", + "description": "The ID of the member who maintains this experiment.", + "example": "12ab3c45de678910fgh12345" + }, + "_creationDate": { + "description": "Timestamp of when the experiment was created", + "example": "1654104600000", + "$ref": "#/components/schemas/UnixMillis" + }, + "environmentKey": { + "type": "string" + }, + "archivedDate": { + "description": "Timestamp of when the experiment was archived", + "example": "1654104600000", + "$ref": "#/components/schemas/UnixMillis" + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "parent": { + "href": "/api/v2/projects/my-project/environments/my-environment", + "type": "application/json" + }, + "self": { + "href": "/api/v2/projects/my-project/environments/my-environment/experiments/my-experiment", + "type": "application/json" + } + } + }, + "currentIteration": { + "description": "Details on the current iteration", + "$ref": "#/components/schemas/IterationRep" + }, + "draftIteration": { + "description": "Details on the current iteration. This iteration may be already started, or may still be a draft.", + "$ref": "#/components/schemas/IterationRep" + }, + "previousIterations": { + "type": "array", + "description": "Details on the previous iterations for this experiment.", + "items": { + "$ref": "#/components/schemas/IterationRep" + } + } + } + }, + "ExperimentAllocationRep": { + "type": "object", + "required": [ + "defaultVariation", + "canReshuffle" + ], + "properties": { + "defaultVariation": { + "type": "integer" + }, + "canReshuffle": { + "type": "boolean" + } + } + }, + "ExperimentBayesianResultsRep": { + "type": "object", + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + }, + "treatmentResults": { + "type": "array", + "description": "Deprecated, use results instead. Only populated when response does not contain results sliced by multiple attributes.", + "items": { + "$ref": "#/components/schemas/TreatmentResultRep" + }, + "deprecated": true + }, + "metricSeen": { + "$ref": "#/components/schemas/MetricSeen" + }, + "probabilityOfMismatch": { + "type": "number", + "description": "The probability of a Sample Ratio Mismatch", + "example": 0.9999999999999738 + }, + "results": { + "type": "array", + "description": "A list of attribute values and their corresponding treatment results", + "items": { + "$ref": "#/components/schemas/SlicedResultsRep" + } + } + } + }, + "ExperimentCollectionRep": { + "type": "object", + "required": [ + "items" + ], + "properties": { + "items": { + "type": "array", + "description": "An array of experiments", + "items": { + "$ref": "#/components/schemas/Experiment" + } + }, + "total_count": { + "type": "integer", + "description": "The total number of experiments in this project and environment. Does not include legacy experiments." + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + } + } + }, + "ExperimentEnabledPeriodRep": { + "type": "object", + "properties": { + "startDate": { + "$ref": "#/components/schemas/UnixMillis" + }, + "stopDate": { + "$ref": "#/components/schemas/UnixMillis" + } + } + }, + "ExperimentEnvironmentSettingRep": { + "type": "object", + "properties": { + "startDate": { + "$ref": "#/components/schemas/UnixMillis" + }, + "stopDate": { + "$ref": "#/components/schemas/UnixMillis" + }, + "enabledPeriods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExperimentEnabledPeriodRep" + } + } + } + }, + "ExperimentInfoRep": { + "type": "object", + "required": [ + "baselineIdx", + "items" + ], + "properties": { + "baselineIdx": { + "type": "integer" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LegacyExperimentRep" + } + } + } + }, + "ExperimentMetadataRep": { + "type": "object", + "properties": { + "key": {} + } + }, + "ExperimentPatchInput": { + "type": "object", + "required": [ + "instructions" + ], + "properties": { + "comment": { + "type": "string", + "description": "Optional comment describing the update", + "example": "Optional comment" + }, + "instructions": { + "description": "The instructions to perform when updating. This should be an array with objects that look like {\"kind\": \"update_action\"}. Some instructions also require a value field in the array element.", + "example": "[{\"kind\": \"updateName\", \"value\": \"Updated experiment name\"}]", + "$ref": "#/components/schemas/Instructions" + } + } + }, + "ExperimentPost": { + "type": "object", + "required": [ + "name", + "key", + "iteration" + ], + "properties": { + "name": { + "type": "string", + "description": "The experiment name", + "example": "Example experiment" + }, + "description": { + "type": "string", + "description": "The experiment description", + "example": "An example experiment, used in testing" + }, + "maintainerId": { + "type": "string", + "description": "The ID of the member who maintains this experiment", + "example": "12ab3c45de678910fgh12345" + }, + "key": { + "type": "string", + "description": "The experiment key", + "example": "experiment-key-123abc" + }, + "iteration": { + "description": "Details on the construction of the initial iteration", + "$ref": "#/components/schemas/IterationInput" + } + } + }, + "ExperimentResults": { + "type": "object", + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "metadata": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExperimentMetadataRep" + } + }, + "totals": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExperimentTotalsRep" + } + }, + "series": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExperimentTimeSeriesSlice" + } + }, + "stats": { + "$ref": "#/components/schemas/ExperimentStatsRep" + }, + "granularity": { + "type": "string" + }, + "metricSeen": { + "$ref": "#/components/schemas/MetricSeen" + } + } + }, + "ExperimentStatsRep": { + "type": "object", + "properties": { + "pValue": { + "type": "number" + }, + "chi2": { + "type": "number" + }, + "winningVariationIdx": { + "type": "integer" + }, + "minSampleSizeMet": { + "type": "boolean" + } + } + }, + "ExperimentTimeSeriesSlice": { + "type": "object", + "properties": { + "Time": { + "$ref": "#/components/schemas/UnixMillis" + }, + "VariationData": { + "$ref": "#/components/schemas/ExperimentTimeSeriesVariationSlices" + } + } + }, + "ExperimentTimeSeriesVariationSlice": { + "type": "object", + "properties": { + "value": { + "type": "number" + }, + "count": { + "type": "integer", + "format": "int64" + }, + "cumulativeValue": { + "type": "number" + }, + "cumulativeCount": { + "type": "integer", + "format": "int64" + }, + "conversionRate": { + "type": "number" + }, + "cumulativeConversionRate": { + "type": "number" + }, + "confidenceInterval": { + "$ref": "#/components/schemas/ConfidenceIntervalRep" + }, + "cumulativeConfidenceInterval": { + "$ref": "#/components/schemas/ConfidenceIntervalRep" + } + } + }, + "ExperimentTimeSeriesVariationSlices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExperimentTimeSeriesVariationSlice" + } + }, + "ExperimentTotalsRep": { + "type": "object", + "properties": { + "cumulativeValue": { + "type": "number" + }, + "cumulativeCount": { + "type": "integer", + "format": "int64" + }, + "cumulativeImpressionCount": { + "type": "integer", + "format": "int64" + }, + "cumulativeConversionRate": { + "type": "number" + }, + "cumulativeConfidenceInterval": { + "$ref": "#/components/schemas/ConfidenceIntervalRep" + }, + "pValue": { + "type": "number" + }, + "improvement": { + "type": "number" + }, + "minSampleSize": { + "type": "integer", + "format": "int64" + } + } + }, + "ExpiringTarget": { + "type": "object", + "required": [ + "_id", + "_version", + "expirationDate", + "contextKind", + "contextKey", + "_resourceId" + ], + "properties": { + "_id": { + "type": "string", + "description": "The ID of this expiring target", + "example": "12ab3c45de678910abc12345" + }, + "_version": { + "type": "integer", + "description": "The version of this expiring target", + "example": 1 + }, + "expirationDate": { + "description": "A timestamp for when the target expires", + "example": "1672358400000", + "$ref": "#/components/schemas/UnixMillis" + }, + "contextKind": { + "type": "string", + "description": "The context kind of the context to be removed", + "example": "user" + }, + "contextKey": { + "type": "string", + "description": "A unique key used to represent the context to be removed", + "example": "context-key-123abc" + }, + "targetType": { + "type": "string", + "description": "A segment's target type, included or excluded. Included when expiring targets are updated on a segment.", + "example": "included" + }, + "variationId": { + "type": "string", + "description": "A unique ID used to represent the flag variation. Included when expiring targets are updated on a feature flag.", + "example": "cc4332e2-bd4d-4fe0-b509-dfd2caf8dd73" + }, + "_resourceId": { + "description": "Details on the segment or flag this expiring target belongs to, its environment, and its project", + "$ref": "#/components/schemas/ResourceId" + } + } + }, + "ExpiringTargetError": { + "type": "object", + "required": [ + "instructionIndex", + "message" + ], + "properties": { + "instructionIndex": { + "type": "integer", + "description": "The index of the PATCH instruction where the error occurred", + "example": 1 + }, + "message": { + "type": "string", + "description": "The error message related to a failed PATCH instruction", + "example": "example error message" + } + } + }, + "ExpiringTargetGetResponse": { + "type": "object", + "required": [ + "items" + ], + "properties": { + "items": { + "type": "array", + "description": "A list of expiring targets", + "items": { + "$ref": "#/components/schemas/ExpiringTarget" + } + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + } + } + }, + "ExpiringTargetPatchResponse": { + "type": "object", + "required": [ + "items" + ], + "properties": { + "items": { + "type": "array", + "description": "A list of the results from each instruction", + "items": { + "$ref": "#/components/schemas/ExpiringTarget" + } + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + }, + "totalInstructions": { + "type": "integer" + }, + "successfulInstructions": { + "type": "integer" + }, + "failedInstructions": { + "type": "integer" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExpiringTargetError" + } + } + } + }, + "ExpiringUserTargetGetResponse": { + "type": "object", + "required": [ + "items" + ], + "properties": { + "items": { + "type": "array", + "description": "An array of expiring user targets", + "items": { + "$ref": "#/components/schemas/ExpiringUserTargetItem" + } + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + } + } + }, + "ExpiringUserTargetItem": { + "type": "object", + "required": [ + "_id", + "_version", + "expirationDate", + "userKey", + "_resourceId" + ], + "properties": { + "_id": { + "type": "string", + "description": "The ID of this expiring user target", + "example": "12ab3c45de678910fgh12345" + }, + "_version": { + "type": "integer", + "description": "The version of this expiring user target", + "example": 1 + }, + "expirationDate": { + "description": "A timestamp for when the user target expires", + "example": "1658192820000", + "$ref": "#/components/schemas/UnixMillis" + }, + "userKey": { + "type": "string", + "description": "A unique key used to represent the user", + "example": "example-user-key" + }, + "targetType": { + "type": "string", + "description": "A segment's target type. Included when expiring user targets are updated on a segment.", + "example": "included" + }, + "variationId": { + "type": "string", + "description": "A unique key used to represent the flag variation. Included when expiring user targets are updated on a feature flag.", + "example": "ce67d625-a8b9-4fb5-a344-ab909d9d4f4d" + }, + "_resourceId": { + "description": "Details on the resource from which the user is expiring", + "$ref": "#/components/schemas/ResourceIDResponse" + } + } + }, + "ExpiringUserTargetPatchResponse": { + "type": "object", + "required": [ + "items" + ], + "properties": { + "items": { + "type": "array", + "description": "An array of expiring user targets", + "items": { + "$ref": "#/components/schemas/ExpiringUserTargetItem" + } + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + }, + "totalInstructions": { + "type": "integer", + "description": "The total count of instructions sent in the PATCH request", + "example": 1 + }, + "successfulInstructions": { + "type": "integer", + "description": "The total count of successful instructions sent in the PATCH request", + "example": 1 + }, + "failedInstructions": { + "type": "integer", + "description": "The total count of the failed instructions sent in the PATCH request", + "example": 0 + }, + "errors": { + "type": "array", + "description": "An array of error messages for the failed instructions", + "items": { + "$ref": "#/components/schemas/ExpiringTargetError" + } + } + } + }, + "Export": { + "type": "object", + "required": [ + "id", + "segmentKey", + "creationTime", + "status", + "sizeBytes", + "size", + "initiator", + "_links" + ], + "properties": { + "id": { + "type": "string", + "description": "The export ID", + "example": "1234a567-bcd8-9123-4567-abcd1234567f" + }, + "segmentKey": { + "type": "string", + "description": "The segment key", + "example": "example-big-segment" + }, + "creationTime": { + "description": "Timestamp of when this export was created", + "example": "1654104600000", + "$ref": "#/components/schemas/UnixMillis" + }, + "status": { + "type": "string", + "description": "The export status", + "example": "complete" + }, + "sizeBytes": { + "type": "integer", + "format": "int64", + "description": "The export size, in bytes", + "example": 18 + }, + "size": { + "type": "string", + "description": "The export size, with units", + "example": "18 B" + }, + "initiator": { + "description": "Details on the member who initiated the export", + "example": "{\"name\": \"Ariel Flores\", \"email\": \"ariel@acme.com\"}", + "$ref": "#/components/schemas/InitiatorRep" + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources, including the location of the exported file" + } + } + }, + "Extinction": { + "type": "object", + "required": [ + "revision", + "message", + "time", + "flagKey", + "projKey" + ], + "properties": { + "revision": { + "type": "string", + "description": "The identifier for the revision where flag became extinct. For example, a commit SHA.", + "example": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3" + }, + "message": { + "type": "string", + "description": "Description of the extinction. For example, the commit message for the revision.", + "example": "Remove flag for launched feature" + }, + "time": { + "description": "Time of extinction", + "example": "1636558831870", + "$ref": "#/components/schemas/UnixMillis" + }, + "flagKey": { + "type": "string", + "description": "The feature flag key", + "example": "enable-feature" + }, + "projKey": { + "type": "string", + "description": "The project key", + "example": "default" + } + } + }, + "ExtinctionCollectionRep": { + "type": "object", + "required": [ + "_links", + "items" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + }, + "items": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Extinction" + } + }, + "description": "An array of extinction events" + } + } + }, + "ExtinctionListPost": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Extinction" + } + }, + "FeatureFlag": { + "type": "object", + "required": [ + "name", + "kind", + "key", + "_version", + "creationDate", + "variations", + "temporary", + "tags", + "_links", + "experiments", + "customProperties", + "archived", + "deprecated", + "environments" + ], + "properties": { + "name": { + "type": "string", + "description": "A human-friendly name for the feature flag", + "example": "My Flag" + }, + "kind": { + "type": "string", + "description": "Kind of feature flag", + "example": "boolean", + "enum": [ + "boolean", + "multivariate" + ] + }, + "description": { + "type": "string", + "description": "Description of the feature flag", + "example": "This flag controls the example widgets" + }, + "key": { + "type": "string", + "description": "A unique key used to reference the flag in your code", + "example": "flag-key-123abc" + }, + "_version": { + "type": "integer", + "description": "Version of the feature flag", + "example": 1 + }, + "creationDate": { + "description": "Timestamp of flag creation date", + "example": "1494437420312", + "$ref": "#/components/schemas/UnixMillis" + }, + "includeInSnippet": { + "type": "boolean", + "description": "Deprecated, use clientSideAvailability. Whether this flag should be made available to the client-side JavaScript SDK", + "example": true, + "deprecated": true + }, + "clientSideAvailability": { + "description": "Which type of client-side SDKs the feature flag is available to", + "example": "{\"usingMobileKey\":true,\"usingEnvironmentId\":false}", + "$ref": "#/components/schemas/ClientSideAvailability" + }, + "variations": { + "type": "array", + "description": "An array of possible variations for the flag", + "items": { + "$ref": "#/components/schemas/Variation" + }, + "example": [ + { + "_id": "e432f62b-55f6-49dd-a02f-eb24acf39d05", + "value": true + }, + { + "_id": "a00bf58d-d252-476c-b915-15a74becacb4", + "value": false + } + ] + }, + "temporary": { + "type": "boolean", + "description": "Whether the flag is a temporary flag", + "example": true + }, + "tags": { + "type": "array", + "description": "Tags for the feature flag", + "items": { + "type": "string" + }, + "example": [ + "example-tag" + ] + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "parent": { + "href": "/api/v2/flags/my-project", + "type": "application/json" + }, + "self": { + "href": "/api/v2/flags/my-project/my-flag", + "type": "application/json" + } + } + }, + "maintainerId": { + "type": "string", + "description": "Associated maintainerId for the feature flag", + "example": "569f183514f4432160000007" + }, + "_maintainer": { + "description": "Associated maintainer member info for the feature flag", + "$ref": "#/components/schemas/MemberSummary" + }, + "maintainerTeamKey": { + "type": "string", + "description": "The key of the associated team that maintains this feature flag", + "example": "team-1" + }, + "_maintainerTeam": { + "description": "Associated maintainer team info for the feature flag", + "$ref": "#/components/schemas/MaintainerTeam" + }, + "goalIds": { + "type": "array", + "description": "Deprecated, use experiments instead", + "items": { + "type": "string" + }, + "example": [], + "deprecated": true + }, + "experiments": { + "description": "Experimentation data for the feature flag", + "example": "{\"baselineIdx\": 0,\"items\": []}", + "$ref": "#/components/schemas/ExperimentInfoRep" + }, + "customProperties": { + "description": "Metadata attached to the feature flag, in the form of the property key associated with a name and array of values for the metadata to associate with this flag. Typically used to store data related to an integration.", + "example": "{\"jira.issues\":{\"name\":\"Jira issues\",\"value\":[\"is-123\",\"is-456\"]}}", + "$ref": "#/components/schemas/CustomProperties" + }, + "archived": { + "type": "boolean", + "description": "Boolean indicating if the feature flag is archived", + "example": false + }, + "archivedDate": { + "description": "If archived is true, date of archive", + "example": "1494437420312", + "$ref": "#/components/schemas/UnixMillis" + }, + "deprecated": { + "type": "boolean", + "description": "Boolean indicating if the feature flag is deprecated", + "example": false + }, + "deprecatedDate": { + "description": "If deprecated is true, date of deprecation", + "example": "1494437420312", + "$ref": "#/components/schemas/UnixMillis" + }, + "defaults": { + "description": "The indices, from the array of variations, for the variations to serve by default when targeting is on and when targeting is off. These variations will be used for this flag in new environments. If omitted, the first and last variation will be used.", + "example": "{\"onVariation\":0,\"offVariation\":1}", + "$ref": "#/components/schemas/Defaults" + }, + "_purpose": { + "type": "string" + }, + "migrationSettings": { + "description": "Migration-related settings for the flag", + "$ref": "#/components/schemas/FlagMigrationSettingsRep" + }, + "environments": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/FeatureFlagConfig" + }, + "description": "Details on the environments for this flag. Only returned if the request is filtered by environment, using the filterEnv query parameter.", + "example": { + "my-environment": { + "_environmentName": "My Environment", + "_site": { + "href": "/default/my-environment/features/client-side-flag", + "type": "text/html" + }, + "_summary": { + "prerequisites": 0, + "variations": { + "0": { + "contextTargets": 1, + "isFallthrough": true, + "nullRules": 0, + "rules": 0, + "targets": 1 + }, + "1": { + "isOff": true, + "nullRules": 0, + "rules": 0, + "targets": 0 + } + } + }, + "archived": false, + "contextTargets": [ + { + "contextKind": "device", + "values": [ + "device-key-123abc" + ], + "variation": 0 + } + ], + "fallthrough": { + "variation": 0 + }, + "lastModified": 1627071171347, + "offVariation": 1, + "on": false, + "prerequisites": [], + "rules": [], + "salt": "61eddeadbeef4da1facecafe3a60a397", + "sel": "810edeadbeef4844facecafe438f2999492", + "targets": [ + { + "contextKind": "user", + "values": [ + "user-key-123abc" + ], + "variation": 0 + } + ], + "trackEvents": false, + "trackEventsFallthrough": false, + "version": 1 + } + } + } + } + }, + "FeatureFlagBody": { + "type": "object", + "required": [ + "name", + "key" + ], + "properties": { + "name": { + "type": "string", + "description": "A human-friendly name for the feature flag", + "example": "My flag" + }, + "key": { + "type": "string", + "description": "A unique key used to reference the flag in your code", + "example": "flag-key-123abc" + }, + "description": { + "type": "string", + "description": "Description of the feature flag. Defaults to an empty string.", + "example": "This flag controls the example widgets" + }, + "includeInSnippet": { + "type": "boolean", + "description": "Deprecated, use clientSideAvailability. Whether this flag should be made available to the client-side JavaScript SDK. Defaults to false.", + "deprecated": true + }, + "clientSideAvailability": { + "description": "Which type of client-side SDKs the feature flag is available to", + "example": "{\"usingMobileKey\":true,\"usingEnvironmentId\":false}", + "$ref": "#/components/schemas/ClientSideAvailabilityPost" + }, + "variations": { + "type": "array", + "description": "An array of possible variations for the flag. The variation values must be unique. If omitted, two boolean variations of true and false will be used.", + "items": { + "$ref": "#/components/schemas/Variation" + }, + "example": [ + { + "value": true + }, + { + "value": false + } + ] + }, + "temporary": { + "type": "boolean", + "description": "Whether the flag is a temporary flag. Defaults to true.", + "example": false + }, + "tags": { + "type": "array", + "description": "Tags for the feature flag. Defaults to an empty array.", + "items": { + "type": "string" + }, + "example": [ + "example-tag" + ] + }, + "customProperties": { + "description": "Metadata attached to the feature flag, in the form of the property key associated with a name and array of values for the metadata to associate with this flag. Typically used to store data related to an integration.", + "example": "{ \"jira.issues\": {\"name\": \"Jira issues\", \"value\": [\"is-123\", \"is-456\"]} }", + "$ref": "#/components/schemas/CustomProperties" + }, + "defaults": { + "description": "The indices, from the array of variations, for the variations to serve by default when targeting is on and when targeting is off. These variations will be used for this flag in new environments. If omitted, the first and last variation will be used.", + "example": "{\"onVariation\":0, \"offVariation\":1}", + "$ref": "#/components/schemas/Defaults" + }, + "purpose": { + "type": "string", + "description": "Purpose of the flag", + "example": "migration", + "enum": [ + "migration" + ] + }, + "migrationSettings": { + "description": "Settings relevant to flags where purpose is migration", + "$ref": "#/components/schemas/MigrationSettingsPost" + }, + "maintainerId": { + "type": "string", + "description": "The ID of the member who maintains this feature flag", + "example": "12ab3c45de678910fgh12345" + }, + "maintainerTeamKey": { + "type": "string", + "description": "The key of the team that maintains this feature flag", + "example": "team-1" + } + } + }, + "FeatureFlagConfig": { + "type": "object", + "required": [ + "on", + "archived", + "salt", + "sel", + "lastModified", + "version", + "_site", + "_environmentName", + "trackEvents", + "trackEventsFallthrough" + ], + "properties": { + "on": { + "type": "boolean", + "description": "Whether the flag is on" + }, + "archived": { + "type": "boolean", + "description": "Boolean indicating if the feature flag is archived" + }, + "salt": { + "type": "string" + }, + "sel": { + "type": "string" + }, + "lastModified": { + "description": "Timestamp of when the flag configuration was most recently modified", + "$ref": "#/components/schemas/UnixMillis" + }, + "version": { + "type": "integer", + "description": "Version of the feature flag" + }, + "targets": { + "type": "array", + "description": "An array of the individual targets that will receive a specific variation based on their key. Individual targets with a context kind of 'user' are included here.", + "items": { + "$ref": "#/components/schemas/Target" + } + }, + "contextTargets": { + "type": "array", + "description": "An array of the individual targets that will receive a specific variation based on their key. Individual targets with context kinds other than 'user' are included here.", + "items": { + "$ref": "#/components/schemas/Target" + } + }, + "rules": { + "type": "array", + "description": "An array of the rules for how to serve a variation to specific targets based on their attributes", + "items": { + "$ref": "#/components/schemas/Rule" + } + }, + "fallthrough": { + "description": "Details on the variation or rollout to serve as part of the flag's default rule", + "$ref": "#/components/schemas/VariationOrRolloutRep" + }, + "offVariation": { + "type": "integer", + "description": "The ID of the variation to serve when the flag is off" + }, + "prerequisites": { + "type": "array", + "description": "An array of the prerequisite flags and their variations that are required before this flag takes effect", + "items": { + "$ref": "#/components/schemas/Prerequisite" + } + }, + "_site": { + "description": "Details on how to access the flag configuration in the LaunchDarkly UI", + "$ref": "#/components/schemas/Link" + }, + "_access": { + "description": "Details on the allowed and denied actions for this flag", + "$ref": "#/components/schemas/Access" + }, + "_environmentName": { + "type": "string", + "description": "The environment name" + }, + "trackEvents": { + "type": "boolean", + "description": "Whether LaunchDarkly tracks events for the feature flag, for all rules" + }, + "trackEventsFallthrough": { + "type": "boolean", + "description": "Whether LaunchDarkly tracks events for the feature flag, for the default rule" + }, + "_debugEventsUntilDate": { + "$ref": "#/components/schemas/UnixMillis" + }, + "_summary": { + "description": "A summary of the prerequisites and variations for this flag", + "$ref": "#/components/schemas/FlagSummary" + }, + "evaluation": { + "description": "Evaluation information for the flag", + "$ref": "#/components/schemas/FlagConfigEvaluation" + }, + "migrationSettings": { + "description": "Migration-related settings for the flag configuration", + "$ref": "#/components/schemas/FlagConfigMigrationSettingsRep" + } + } + }, + "FeatureFlagScheduledChange": { + "type": "object", + "required": [ + "_id", + "_creationDate", + "_maintainerId", + "_version", + "executionDate", + "instructions" + ], + "properties": { + "_id": { + "description": "The ID of this scheduled change", + "example": "12ab3c45de678910abc12345", + "$ref": "#/components/schemas/FeatureWorkflowId" + }, + "_creationDate": { + "description": "Timestamp of when the scheduled change was created", + "example": "1654123897062", + "$ref": "#/components/schemas/UnixMillis" + }, + "_maintainerId": { + "type": "string", + "description": "The ID of the scheduled change maintainer", + "example": "12ab3c45de678910abc12345" + }, + "_version": { + "type": "integer", + "description": "Version of the scheduled change", + "example": 1 + }, + "executionDate": { + "description": "When the scheduled changes should be executed", + "example": "1636558831870", + "$ref": "#/components/schemas/UnixMillis" + }, + "instructions": { + "description": "The actions to perform on the execution date for these scheduled changes", + "example": "[ { \"kind\": \"turnFlagOn\" }]", + "$ref": "#/components/schemas/Instructions" + }, + "conflicts": { + "description": "Details on any conflicting scheduled changes" + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + } + } + }, + "FeatureFlagScheduledChanges": { + "type": "object", + "required": [ + "items" + ], + "properties": { + "items": { + "type": "array", + "description": "Array of scheduled changes", + "items": { + "$ref": "#/components/schemas/FeatureFlagScheduledChange" + } + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + } + } + }, + "FeatureFlagStatus": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "Status of the flag", + "example": "inactive" + }, + "lastRequested": { + "type": "string", + "format": "date-time", + "description": "Timestamp of last time flag was requested", + "example": "2020-02-05T18:17:01.514Z" + }, + "default": { + "description": "Default value seen from code" + } + } + }, + "FeatureFlagStatusAcrossEnvironments": { + "type": "object", + "required": [ + "environments", + "key", + "_links" + ], + "properties": { + "environments": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/FeatureFlagStatus" + }, + "description": "Flag status for environment.", + "example": { + "production": { + "lastRequested": "2020-02-05T18:17:01.514Z", + "name": "inactive" + } + } + }, + "key": { + "type": "string", + "description": "feature flag key", + "example": "flag-key-123abc" + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "example": { + "parent": { + "href": "/api/v2/flag-status", + "type": "application/json" + }, + "self": { + "href": "/api/v2/flag-status/my-project/my-flag", + "type": "application/json" + } + } + } + } + }, + "FeatureFlagStatuses": { + "type": "object", + "required": [ + "_links" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "example": { + "self": { + "href": "/api/v2/flag-statuses/my-project/my-environment", + "type": "application/json" + } + } + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FlagStatusRep" + } + } + } + }, + "FeatureFlags": { + "type": "object", + "required": [ + "items", + "_links" + ], + "properties": { + "items": { + "type": "array", + "description": "An array of feature flags", + "items": { + "$ref": "#/components/schemas/FeatureFlag" + } + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "self": { + "href": "/api/v2/flags/default", + "type": "application/json" + } + } + }, + "totalCount": { + "type": "integer", + "description": "The total number of flags", + "example": 1 + }, + "totalCountWithDifferences": { + "type": "integer", + "description": "The number of flags that have differences between environments. Only shown when query parameter compare is true.", + "example": 0 + } + } + }, + "FeatureWorkflowId": { + "type": "string" + }, + "FileRep": { + "type": "object", + "properties": { + "filename": { + "type": "string", + "description": "The imported file name, including the extension", + "example": "bigsegimport.csv" + }, + "status": { + "type": "string", + "description": "The imported file status", + "example": "complete" + } + } + }, + "FlagConfigApprovalRequestResponse": { + "type": "object", + "required": [ + "_id", + "_version", + "creationDate", + "serviceKind", + "reviewStatus", + "allReviews", + "notifyMemberIds", + "status", + "instructions", + "conflicts", + "_links" + ], + "properties": { + "_id": { + "type": "string", + "description": "The ID of this approval request", + "example": "12ab3c45de678910abc12345" + }, + "_version": { + "type": "integer", + "description": "Version of the approval request", + "example": 1 + }, + "creationDate": { + "description": "Timestamp of when the approval request was created", + "example": "1654104600000", + "$ref": "#/components/schemas/UnixMillis" + }, + "serviceKind": { + "description": "The approval service for this request. May be LaunchDarkly or an external approval service, such as ServiceNow or JIRA.", + "example": "launchdarkly", + "$ref": "#/components/schemas/ApprovalRequestServiceKind" + }, + "requestorId": { + "type": "string", + "description": "The ID of the member who requested the approval", + "example": "12ab3c45de678910abc12345" + }, + "description": { + "type": "string", + "description": "A human-friendly name for the approval request", + "example": "example: request approval from someone" + }, + "reviewStatus": { + "type": "string", + "description": "Current status of the review of this approval request", + "example": "pending", + "enum": [ + "approved", + "declined", + "pending" + ] + }, + "allReviews": { + "type": "array", + "description": "An array of individual reviews of this approval request", + "items": { + "$ref": "#/components/schemas/ReviewResponse" + } + }, + "notifyMemberIds": { + "type": "array", + "description": "An array of member IDs. These members are notified to review the approval request.", + "items": { + "type": "string" + }, + "example": [ + "1234a56b7c89d012345e678f" + ] + }, + "appliedDate": { + "description": "Timestamp of when the approval request was applied", + "example": "1654104600000", + "$ref": "#/components/schemas/UnixMillis" + }, + "appliedByMemberId": { + "type": "string", + "description": "The member ID of the member who applied the approval request", + "example": "1234a56b7c89d012345e678f" + }, + "appliedByServiceTokenId": { + "type": "string", + "description": "The service token ID of the service token which applied the approval request", + "example": "1234a56b7c89d012345e678f" + }, + "status": { + "type": "string", + "description": "Current status of the approval request", + "example": "pending", + "enum": [ + "pending", + "completed", + "failed", + "scheduled" + ] + }, + "instructions": { + "description": "List of instructions in semantic patch format to be applied to the feature flag", + "example": "[{\"kind\": \"turnFlagOn\"}]", + "$ref": "#/components/schemas/Instructions" + }, + "conflicts": { + "type": "array", + "description": "Details on any conflicting approval requests", + "items": { + "$ref": "#/components/schemas/Conflict" + } + }, + "_links": { + "type": "object", + "additionalProperties": {}, + "description": "The location and content type of related resources" + }, + "executionDate": { + "description": "Timestamp for when instructions will be executed", + "example": "1654104600000", + "$ref": "#/components/schemas/UnixMillis" + }, + "operatingOnId": { + "type": "string", + "description": "ID of scheduled change to edit or delete", + "example": "12ab3c45de678910abc12345" + }, + "integrationMetadata": { + "description": "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", + "$ref": "#/components/schemas/IntegrationMetadata" + }, + "source": { + "description": "Details about the source feature flag, if copied", + "$ref": "#/components/schemas/CopiedFromEnv" + }, + "customWorkflowMetadata": { + "description": "Details about the custom workflow, if this approval request is part of a custom workflow", + "$ref": "#/components/schemas/CustomWorkflowMeta" + } + } + }, + "FlagConfigApprovalRequestsResponse": { + "type": "object", + "required": [ + "items", + "_links" + ], + "properties": { + "items": { + "type": "array", + "description": "An array of approval requests", + "items": { + "$ref": "#/components/schemas/FlagConfigApprovalRequestResponse" + } + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + } + } + }, + "FlagConfigEvaluation": { + "type": "object", + "properties": { + "contextKinds": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "FlagConfigMigrationSettingsRep": { + "type": "object", + "properties": { + "checkRatio": { + "type": "integer" + } + } + }, + "FlagCopyConfigEnvironment": { + "type": "object", + "required": [ + "key" + ], + "properties": { + "key": { + "type": "string", + "description": "The environment key" + }, + "currentVersion": { + "type": "integer", + "description": "Optional flag version. If you include this, the operation only succeeds if the current flag version in the environment matches this version." + } + } + }, + "FlagCopyConfigPost": { + "type": "object", + "required": [ + "source", + "target" + ], + "properties": { + "source": { + "description": "The source environment", + "example": "{\"key\": \"source-env-key-123abc\", \"currentVersion\": 1}", + "$ref": "#/components/schemas/FlagCopyConfigEnvironment" + }, + "target": { + "description": "The target environment", + "example": "{\"key\": \"target-env-key-123abc\", \"currentVersion\": 1}", + "$ref": "#/components/schemas/FlagCopyConfigEnvironment" + }, + "comment": { + "type": "string", + "description": "Optional comment" + }, + "includedActions": { + "type": "array", + "description": "Optional list of the flag changes to copy from the source environment to the target environment. You may include either includedActions or excludedActions, but not both. If you include neither, then all flag changes will be copied.", + "items": { + "type": "string", + "enum": [ + "updateOn", + "updateRules", + "updateFallthrough", + "updateOffVariation", + "updatePrerequisites", + "updateTargets", + "updateFlagConfigMigrationSettings" + ] + }, + "example": [ + "updateOn" + ] + }, + "excludedActions": { + "type": "array", + "description": "Optional list of the flag changes NOT to copy from the source environment to the target environment. You may include either includedActions or excludedActions, but not both. If you include neither, then all flag changes will be copied.", + "items": { + "type": "string", + "enum": [ + "updateOn", + "updateRules", + "updateFallthrough", + "updateOffVariation", + "updatePrerequisites", + "updateTargets", + "updateFlagConfigMigrationSettings" + ] + }, + "example": [ + "updateOn" + ] + } + } + }, + "FlagFollowersByProjEnvGetRep": { + "type": "object", + "required": [ + "_links" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "self": { + "href": "/api/v2/projects/my-project/flags/my-flay/environments/my-environment/followers", + "type": "application/json" + } + } + }, + "items": { + "type": "array", + "description": "An array of flags and their followers", + "items": { + "$ref": "#/components/schemas/followersPerFlag" + } + } + } + }, + "FlagFollowersGetRep": { + "type": "object", + "required": [ + "_links", + "items" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "self": { + "href": "/api/v2/projects/my-project/flags/my-flay/environments/my-environment/followers", + "type": "application/json" + } + } + }, + "items": { + "type": "array", + "description": "An array of members who are following this flag", + "items": { + "$ref": "#/components/schemas/FollowFlagMember" + } + } + } + }, + "FlagInput": { + "type": "object", + "required": [ + "ruleId", + "flagConfigVersion" + ], + "properties": { + "ruleId": { + "type": "string", + "description": "The ID of the variation or rollout of the flag to use. Use \"fallthrough\" for the default targeting behavior when the flag is on.", + "example": "e432f62b-55f6-49dd-a02f-eb24acf39d05" + }, + "flagConfigVersion": { + "type": "integer", + "description": "The flag version", + "example": 12 + } + } + }, + "FlagLinkCollectionRep": { + "type": "object", + "required": [ + "items", + "_links" + ], + "properties": { + "items": { + "type": "array", + "description": "An array of flag links", + "items": { + "$ref": "#/components/schemas/FlagLinkRep" + } + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + } + } + }, + "FlagLinkMember": { + "type": "object", + "required": [ + "_links", + "_id" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "_id": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + }, + "FlagLinkRep": { + "type": "object", + "required": [ + "_links", + "_id", + "_deepLink", + "_timestamp", + "_createdAt" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + }, + "_key": { + "type": "string", + "description": "The flag link key", + "example": "flag-link-key-123abc" + }, + "_integrationKey": { + "type": "string", + "description": "The integration key for an integration whose manifest.json includes the flagLink capability, if this is a flag link for an existing integration" + }, + "_id": { + "type": "string", + "description": "The ID of this flag link", + "example": "1234a56b7c89d012345e678f" + }, + "_deepLink": { + "type": "string", + "description": "The URL for the external resource the flag is linked to", + "example": "https://example.com/archives/123123123" + }, + "_timestamp": { + "description": "The time to mark this flag link as associated with the external URL. Defaults to the creation time of the flag link, but can be set to another time during creation.", + "example": "{\"milliseconds\": 1655342199935, \"seconds\": 1655342199, \"rfc3339\": \"2022-06-16T01:16:39Z\", \"simple\": \"2022-06-16 01:16:39\"}", + "$ref": "#/components/schemas/TimestampRep" + }, + "title": { + "type": "string", + "description": "The title of the flag link", + "example": "Example link title" + }, + "description": { + "type": "string", + "description": "The description of the flag link", + "example": "Example link description" + }, + "_metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "The metadata required by this integration in order to create a flag link, if this is a flag link for an existing integration. Defined in the integration's manifest.json file under flagLink." + }, + "_createdAt": { + "description": "Timestamp of when the flag link was created", + "example": "1654104600000", + "$ref": "#/components/schemas/UnixMillis" + }, + "_member": { + "description": "Details on the member associated with this flag link", + "$ref": "#/components/schemas/FlagLinkMember" + } + } + }, + "FlagListingRep": { + "type": "object", + "required": [ + "name", + "key" + ], + "properties": { + "name": { + "type": "string", + "description": "The flag name", + "example": "Example flag" + }, + "key": { + "type": "string", + "description": "The flag key", + "example": "flag-key-123abc" + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "_site": { + "$ref": "#/components/schemas/Link" + } + } + }, + "FlagMigrationSettingsRep": { + "type": "object", + "properties": { + "contextKind": { + "type": "string", + "description": "The context kind targeted by this migration flag. Only applicable for six-stage migrations.", + "example": "device" + }, + "stageCount": { + "type": "integer", + "description": "The number of stages for this migration flag", + "example": 6 + } + } + }, + "FlagRep": { + "type": "object", + "required": [ + "_links" + ], + "properties": { + "targetingRule": { + "type": "string", + "description": "The targeting rule", + "example": "fallthrough" + }, + "targetingRuleDescription": { + "type": "string", + "description": "The rule description", + "example": "Customers who live in Canada" + }, + "targetingRuleClauses": { + "type": "array", + "description": "An array of clauses used for individual targeting based on attributes", + "items": {} + }, + "flagConfigVersion": { + "type": "integer", + "description": "The flag version", + "example": 12 + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "self": { + "href": "/api/v2/flags/my-project/my-flag", + "type": "application/json" + } + } + } + } + }, + "FlagScheduledChangesInput": { + "type": "object", + "required": [ + "instructions" + ], + "properties": { + "comment": { + "type": "string", + "description": "Optional comment describing the update to the scheduled changes", + "example": "optional comment" + }, + "instructions": { + "description": "The instructions to perform when updating. This should be an array with objects that look like {\"kind\": \"update_action\"}. Some instructions also require a value field in the array element.", + "example": "[ { \"kind\": \"replaceScheduledChangesInstructions\", \"value\": [ { \"kind\": \"turnFlagOff\" } ] } ]", + "$ref": "#/components/schemas/Instructions" + } + } + }, + "FlagStatusRep": { + "type": "object", + "required": [ + "_links" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "example": { + "parent": { + "href": "/api/v2/flags/my-project/my-flag", + "type": "application/json" + }, + "self": { + "href": "/api/v2/flag-statuses/my-project/my-flag", + "type": "application/json" + } + } + }, + "name": { + "type": "string", + "description": "Status of the flag", + "example": "inactive" + }, + "lastRequested": { + "type": "string", + "format": "date-time", + "description": "Timestamp of last time flag was requested", + "example": "2020-02-05T18:17:01.514Z" + }, + "default": { + "description": "Default value seen from code" + } + } + }, + "FlagSummary": { + "type": "object", + "required": [ + "variations", + "prerequisites" + ], + "properties": { + "variations": { + "description": "A summary of the variations for this flag", + "$ref": "#/components/schemas/AllVariationsSummary" + }, + "prerequisites": { + "type": "integer", + "description": "The number of prerequisites for this flag" + } + } + }, + "FlagTriggerInput": { + "type": "object", + "properties": { + "comment": { + "type": "string", + "description": "Optional comment describing the update", + "example": "optional comment" + }, + "instructions": { + "type": "array", + "description": "The instructions to perform when updating. This should be an array with objects that look like {\"kind\": \"trigger_action\"}.", + "items": { + "$ref": "#/components/schemas/Instruction" + }, + "example": [ + { + "kind": "disableTrigger" + } + ] + } + } + }, + "FlagsInput": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/FlagInput" + } + }, + "FollowFlagMember": { + "type": "object", + "required": [ + "_links", + "_id", + "role", + "email" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "self": { + "href": "/api/v2/members/569f183514f4432160000007", + "type": "application/json" + } + } + }, + "_id": { + "type": "string", + "description": "The member's ID", + "example": "569f183514f4432160000007" + }, + "firstName": { + "type": "string", + "description": "The member's first name", + "example": "Ariel" + }, + "lastName": { + "type": "string", + "description": "The member's last name", + "example": "Flores" + }, + "role": { + "type": "string", + "description": "The member's built-in role. If the member has no custom roles, this role will be in effect.", + "example": "admin" + }, + "email": { + "type": "string", + "description": "The member's email address", + "example": "ariel@acme.com" + } + } + }, + "ForbiddenErrorRep": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string", + "description": "Specific error code encountered", + "example": "forbidden" + }, + "message": { + "type": "string", + "description": "Description of the error", + "example": "Forbidden. Access to the requested resource was denied." + } + } + }, + "FormVariableConfig": { + "type": "object", + "additionalProperties": {} + }, + "HunkRep": { + "type": "object", + "required": [ + "startingLineNumber" + ], + "properties": { + "startingLineNumber": { + "type": "integer", + "description": "Line number of beginning of code reference hunk", + "example": 45 + }, + "lines": { + "type": "string", + "description": "Contextual lines of code that include the referenced feature flag", + "example": "var enableFeature = 'enable-feature';" + }, + "projKey": { + "type": "string", + "description": "The project key", + "example": "default" + }, + "flagKey": { + "type": "string", + "description": "The feature flag key", + "example": "enable-feature" + }, + "aliases": { + "type": "array", + "description": "An array of flag key aliases", + "items": { + "type": "string" + }, + "example": [ + "enableFeature", + "EnableFeature" + ] + } + } + }, + "Import": { + "type": "object", + "required": [ + "id", + "segmentKey", + "creationTime", + "mode", + "status", + "_links" + ], + "properties": { + "id": { + "type": "string", + "description": "The import ID", + "example": "1234a567-bcd8-9123-4567-abcd1234567f" + }, + "segmentKey": { + "type": "string", + "description": "The segment key", + "example": "example-big-segment" + }, + "creationTime": { + "description": "Timestamp of when this import was created", + "example": "1654104600000", + "$ref": "#/components/schemas/UnixMillis" + }, + "mode": { + "type": "string", + "description": "The import mode used, either merge or replace", + "example": "replace" + }, + "status": { + "type": "string", + "description": "The import status", + "example": "complete" + }, + "files": { + "type": "array", + "description": "The imported files and their status", + "items": { + "$ref": "#/components/schemas/FileRep" + }, + "example": [ + { + "filename": "bigsegimport.csv", + "status": "complete" + } + ] + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + } + } + }, + "InitiatorRep": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the member who initiated the export", + "example": "Bob Loblaw" + }, + "email": { + "type": "string", + "description": "The email address of the member who initiated the export", + "example": "ariel@acme.com" + } + } + }, + "Instruction": { + "type": "object", + "additionalProperties": {} + }, + "Instructions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Instruction" + } + }, + "Integration": { + "type": "object", + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + }, + "_id": { + "type": "string", + "description": "The ID for this integration audit log subscription", + "example": "1234a56b7c89d012345e678f" + }, + "kind": { + "type": "string", + "description": "The type of integration", + "example": "datadog" + }, + "name": { + "type": "string", + "description": "A human-friendly name for the integration", + "example": "Example Datadog integration" + }, + "config": { + "type": "object", + "additionalProperties": {}, + "description": "Details on configuration for an integration of this type. Refer to the formVariables field in the corresponding manifest.json for a full list of fields for each integration." + }, + "statements": { + "type": "array", + "description": "Represents a Custom role policy, defining a resource kinds filter the integration audit log subscription responds to.", + "items": { + "$ref": "#/components/schemas/Statement" + } + }, + "on": { + "type": "boolean", + "description": "Whether the integration is currently active", + "example": true + }, + "tags": { + "type": "array", + "description": "An array of tags for this integration", + "items": { + "type": "string" + }, + "example": [ + "testing" + ] + }, + "_access": { + "description": "Details on the allowed and denied actions for this subscription", + "$ref": "#/components/schemas/Access" + }, + "_status": { + "description": "Details on the most recent successes and errors for this integration", + "$ref": "#/components/schemas/IntegrationSubscriptionStatusRep" + }, + "url": { + "type": "string", + "description": "Slack webhook receiver URL. Only used for legacy Slack webhook integrations." + }, + "apiKey": { + "type": "string", + "description": "Datadog API key. Only used for legacy Datadog webhook integrations." + } + } + }, + "IntegrationDeliveryConfiguration": { + "type": "object", + "required": [ + "_links", + "_id", + "integrationKey", + "projectKey", + "environmentKey", + "config", + "on", + "tags", + "name", + "version" + ], + "properties": { + "_links": { + "description": "The location and content type of related resources", + "$ref": "#/components/schemas/IntegrationDeliveryConfigurationLinks" + }, + "_id": { + "type": "string", + "description": "The integration ID", + "example": "12ab3c4d5ef1a2345bcde67f" + }, + "integrationKey": { + "type": "string", + "description": "The integration key", + "example": "example-integration-key" + }, + "projectKey": { + "type": "string", + "description": "The project key", + "example": "default" + }, + "environmentKey": { + "type": "string", + "description": "The environment key", + "example": "development" + }, + "config": { + "description": "The delivery configuration for the given integration provider. Only included when requesting a single integration by ID. Refer to the formVariables field in the corresponding manifest.json for a full list of fields for each integration.", + "$ref": "#/components/schemas/FormVariableConfig" + }, + "on": { + "type": "boolean", + "description": "Whether the configuration is turned on", + "example": true + }, + "tags": { + "type": "array", + "description": "List of tags for this configuration", + "items": { + "type": "string" + }, + "example": [] + }, + "name": { + "type": "string", + "description": "Name of the configuration", + "example": "Development environment configuration" + }, + "version": { + "type": "integer", + "description": "Version of the current configuration", + "example": 1 + }, + "_access": { + "description": "Details on the allowed and denied actions for this configuration", + "$ref": "#/components/schemas/Access" + } + } + }, + "IntegrationDeliveryConfigurationCollection": { + "type": "object", + "required": [ + "_links", + "items" + ], + "properties": { + "_links": { + "description": "The location and content type of related resources", + "$ref": "#/components/schemas/IntegrationDeliveryConfigurationCollectionLinks" + }, + "items": { + "type": "array", + "description": "An array of integration delivery configurations", + "items": { + "$ref": "#/components/schemas/IntegrationDeliveryConfiguration" + } + } + } + }, + "IntegrationDeliveryConfigurationCollectionLinks": { + "type": "object", + "required": [ + "self" + ], + "properties": { + "self": { + "$ref": "#/components/schemas/Link" + }, + "parent": { + "$ref": "#/components/schemas/Link" + } + } + }, + "IntegrationDeliveryConfigurationLinks": { + "type": "object", + "required": [ + "self", + "parent", + "project", + "environment" + ], + "properties": { + "self": { + "$ref": "#/components/schemas/Link" + }, + "parent": { + "$ref": "#/components/schemas/Link" + }, + "project": { + "$ref": "#/components/schemas/Link" + }, + "environment": { + "$ref": "#/components/schemas/Link" + } + } + }, + "IntegrationDeliveryConfigurationPost": { + "type": "object", + "required": [ + "config" + ], + "properties": { + "on": { + "type": "boolean", + "description": "Whether the integration configuration is active. Default value is false.", + "example": false + }, + "config": { + "description": "The global integration settings, as specified by the formVariables in the manifest.json for this integration.", + "example": "{\"required\": \"example value for required formVariables property for sample-integration\", \"optional\": \"example value for optional formVariables property for sample-integration\"}", + "$ref": "#/components/schemas/FormVariableConfig" + }, + "tags": { + "type": "array", + "description": "Tags to associate with the integration", + "items": { + "type": "string" + }, + "example": [ + "example-tag" + ] + }, + "name": { + "type": "string", + "description": "Name to identify the integration", + "example": "Sample integration" + } + } + }, + "IntegrationDeliveryConfigurationResponse": { + "type": "object", + "properties": { + "statusCode": { + "type": "integer", + "description": "The status code returned by the validation", + "example": 200 + }, + "error": { + "type": "string" + }, + "timestamp": { + "description": "Timestamp of when the validation was performed", + "example": "1654104600000", + "$ref": "#/components/schemas/UnixMillis" + }, + "responseBody": { + "type": "string", + "description": "JSON response to the validation request" + } + } + }, + "IntegrationMetadata": { + "type": "object", + "required": [ + "externalId", + "externalStatus", + "externalUrl", + "lastChecked" + ], + "properties": { + "externalId": { + "type": "string" + }, + "externalStatus": { + "$ref": "#/components/schemas/IntegrationStatus" + }, + "externalUrl": { + "type": "string" + }, + "lastChecked": { + "$ref": "#/components/schemas/UnixMillis" + } + } + }, + "IntegrationStatus": { + "type": "object", + "required": [ + "display", + "value" + ], + "properties": { + "display": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "IntegrationStatusRep": { + "type": "object", + "properties": { + "statusCode": { + "type": "integer" + }, + "responseBody": { + "type": "string" + }, + "timestamp": { + "$ref": "#/components/schemas/UnixMillis" + } + } + }, + "IntegrationSubscriptionStatusRep": { + "type": "object", + "properties": { + "successCount": { + "type": "integer" + }, + "lastSuccess": { + "$ref": "#/components/schemas/UnixMillis" + }, + "lastError": { + "$ref": "#/components/schemas/UnixMillis" + }, + "errorCount": { + "type": "integer" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/IntegrationStatusRep" + } + } + } + }, + "Integrations": { + "type": "object", + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Integration" + } + }, + "key": { + "type": "string" + } + } + }, + "InvalidRequestErrorRep": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string", + "description": "Specific error code encountered", + "example": "invalid_request" + }, + "message": { + "type": "string", + "description": "Description of the error", + "example": "Invalid request body" + } + } + }, + "IterationInput": { + "type": "object", + "required": [ + "hypothesis", + "metrics", + "treatments", + "flags" + ], + "properties": { + "hypothesis": { + "type": "string", + "description": "The expected outcome of this experiment", + "example": "Example hypothesis, the new button placement will increase conversion" + }, + "canReshuffleTraffic": { + "type": "boolean", + "description": "Whether to allow the experiment to reassign traffic to different variations when you increase or decrease the traffic in your experiment audience (true) or keep all traffic assigned to its initial variation (false). Defaults to true.", + "example": true + }, + "metrics": { + "description": "Details on the metrics for this experiment", + "$ref": "#/components/schemas/MetricsInput" + }, + "primarySingleMetricKey": { + "type": "string", + "description": "The key of the primary metric for this experiment. Either primarySingleMetricKey or primaryFunnelKey must be present.", + "example": "metric-key-123abc" + }, + "primaryFunnelKey": { + "type": "string", + "description": "The key of the primary funnel group for this experiment. Either primarySingleMetricKey or primaryFunnelKey must be present.", + "example": "metric-group-key-123abc" + }, + "treatments": { + "description": "Details on the variations you are testing in the experiment. You establish these variations in feature flags, and then reuse them in experiments.", + "$ref": "#/components/schemas/TreatmentsInput" + }, + "flags": { + "description": "Details on the feature flag and targeting rules for this iteration", + "$ref": "#/components/schemas/FlagsInput" + }, + "randomizationUnit": { + "type": "string", + "description": "The unit of randomization for this iteration. Defaults to user.", + "example": "user" + } + } + }, + "IterationRep": { + "type": "object", + "required": [ + "hypothesis", + "status", + "createdAt" + ], + "properties": { + "_id": { + "type": "string", + "description": "The iteration ID", + "example": "12ab3c45de678910fgh12345" + }, + "hypothesis": { + "type": "string", + "description": "The expected outcome of this experiment", + "example": "The new button placement will increase conversion" + }, + "status": { + "type": "string", + "description": "The status of the iteration: not_started, running, stopped", + "example": "running" + }, + "createdAt": { + "description": "Timestamp of when the iteration was created", + "example": "1654104600000", + "$ref": "#/components/schemas/UnixMillis" + }, + "startedAt": { + "description": "Timestamp of when the iteration started", + "example": "1655314200000", + "$ref": "#/components/schemas/UnixMillis" + }, + "endedAt": { + "description": "Timestamp of when the iteration ended", + "example": "1656610200000", + "$ref": "#/components/schemas/UnixMillis" + }, + "winningTreatmentId": { + "type": "string", + "description": "The ID of the treatment chosen when the experiment stopped", + "example": "122c9f3e-da26-4321-ba68-e0fc02eced58" + }, + "winningReason": { + "type": "string", + "description": "The reason you stopped the experiment", + "example": "We ran this iteration for two weeks and the winning variation was clear" + }, + "canReshuffleTraffic": { + "type": "boolean", + "description": "Whether the experiment may reassign traffic to different variations when the experiment audience changes (true) or must keep all traffic assigned to its initial variation (false).", + "example": true + }, + "flags": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/FlagRep" + }, + "description": "Details on the flag used in this experiment" + }, + "primaryMetric": { + "description": "Deprecated, use primarySingleMetric and primaryFunnel instead. Details on the primary metric for this experiment.", + "deprecated": true, + "$ref": "#/components/schemas/DependentMetricOrMetricGroupRep" + }, + "primarySingleMetric": { + "description": "Details on the primary metric for this experiment", + "$ref": "#/components/schemas/MetricV2Rep" + }, + "primaryFunnel": { + "description": "Details on the primary funnel group for this experiment", + "$ref": "#/components/schemas/DependentMetricGroupRepWithMetrics" + }, + "randomizationUnit": { + "type": "string", + "description": "The unit of randomization for this iteration", + "example": "user" + }, + "treatments": { + "type": "array", + "description": "Details on the variations you are testing in the experiment", + "items": { + "$ref": "#/components/schemas/TreatmentRep" + } + }, + "secondaryMetrics": { + "type": "array", + "description": "Deprecated, use metrics instead. Details on the secondary metrics for this experiment.", + "items": { + "$ref": "#/components/schemas/MetricV2Rep" + }, + "deprecated": true + }, + "metrics": { + "type": "array", + "description": "Details on the metrics for this experiment", + "items": { + "$ref": "#/components/schemas/DependentMetricOrMetricGroupRep" + } + } + } + }, + "JSONPatch": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PatchOperation" + } + }, + "LastSeenMetadata": { + "type": "object", + "properties": { + "tokenId": { + "type": "string", + "description": "The ID of the token used in the member's last session", + "example": "5b52207f8ca8e631d31fdb2b" + } + } + }, + "LegacyExperimentRep": { + "type": "object", + "properties": { + "metricKey": { + "type": "string", + "example": "my-metric" + }, + "_metric": { + "$ref": "#/components/schemas/MetricListingRep" + }, + "environments": { + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "production", + "test", + "my-environment" + ] + }, + "_environmentSettings": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/ExperimentEnvironmentSettingRep" + } + } + } + }, + "Link": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "MaintainerRep": { + "type": "object", + "properties": { + "member": { + "description": "Details on the member who maintains this resource", + "$ref": "#/components/schemas/MemberSummary" + }, + "team": { + "description": "Details on the team that maintains this resource", + "$ref": "#/components/schemas/MemberTeamSummaryRep" + } + } + }, + "MaintainerTeam": { + "type": "object", + "required": [ + "key", + "name" + ], + "properties": { + "key": { + "type": "string", + "description": "The key of the maintainer team", + "example": "team-key-123abc" + }, + "name": { + "type": "string", + "description": "A human-friendly name for the maintainer team", + "example": "Example team" + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "parent": { + "href": "/api/v2/teams", + "type": "application/json" + }, + "roles": { + "href": "/api/v2/teams/example-team/roles", + "type": "application/json" + }, + "self": { + "href": "/api/v2/teams/example-team", + "type": "application/json" + } + } + } + } + }, + "Member": { + "type": "object", + "required": [ + "_links", + "_id", + "role", + "email", + "_pendingInvite", + "_verified", + "customRoles", + "mfa", + "_lastSeen", + "creationDate" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + }, + "_id": { + "type": "string", + "description": "The member's ID", + "example": "507f1f77bcf86cd799439011" + }, + "firstName": { + "type": "string", + "description": "The member's first name", + "example": "Ariel" + }, + "lastName": { + "type": "string", + "description": "The member's last name", + "example": "Flores" + }, + "role": { + "type": "string", + "description": "The member's built-in role. If the member has no custom roles, this role will be in effect.", + "example": "reader" + }, + "email": { + "type": "string", + "description": "The member's email address", + "example": "ariel@acme.com" + }, + "_pendingInvite": { + "type": "boolean", + "description": "Whether the member has a pending invitation", + "example": false + }, + "_verified": { + "type": "boolean", + "description": "Whether the member's email address has been verified", + "example": true + }, + "_pendingEmail": { + "type": "string", + "description": "The member's email address before it has been verified, for accounts where email verification is required" + }, + "customRoles": { + "type": "array", + "description": "The set of custom roles (as keys) assigned to the member", + "items": { + "type": "string" + }, + "example": [ + "devOps", + "backend-devs" + ] + }, + "mfa": { + "type": "string", + "description": "Whether multi-factor authentication is enabled for this member" + }, + "excludedDashboards": { + "type": "array", + "description": "Default dashboards that the member has chosen to ignore", + "items": { + "type": "string" + } + }, + "_lastSeen": { + "description": "The member's last session date (as Unix milliseconds since epoch)", + "example": "1608260796147", + "$ref": "#/components/schemas/UnixMillis" + }, + "_lastSeenMetadata": { + "description": "Additional metadata associated with the member's last session, for example, whether a token was used", + "$ref": "#/components/schemas/LastSeenMetadata" + }, + "_integrationMetadata": { + "description": "Details on the member account in an external source, if this member is provisioned externally", + "$ref": "#/components/schemas/IntegrationMetadata" + }, + "teams": { + "type": "array", + "description": "Details on the teams this member is assigned to", + "items": { + "$ref": "#/components/schemas/MemberTeamSummaryRep" + } + }, + "permissionGrants": { + "type": "array", + "description": "A list of permission grants. Permission grants allow a member to have access to a specific action, without having to create or update a custom role.", + "items": { + "$ref": "#/components/schemas/MemberPermissionGrantSummaryRep" + } + }, + "creationDate": { + "description": "Timestamp of when the member was created", + "example": "1628001602644", + "$ref": "#/components/schemas/UnixMillis" + }, + "oauthProviders": { + "type": "array", + "description": "A list of OAuth providers", + "items": { + "$ref": "#/components/schemas/OAuthProviderKind" + } + } + } + }, + "MemberDataRep": { + "type": "object", + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "_id": { + "type": "string", + "description": "The member ID", + "example": "507f1f77bcf86cd799439011" + }, + "email": { + "type": "string", + "description": "The member email", + "example": "ariel@acme.com" + }, + "firstName": { + "type": "string", + "description": "The member first name", + "example": "Ariel" + }, + "lastName": { + "type": "string", + "description": "The member last name", + "example": "Flores" + } + } + }, + "MemberImportItem": { + "type": "object", + "required": [ + "status", + "value" + ], + "properties": { + "message": { + "type": "string", + "description": "An error message, including CSV line number, if the status is error" + }, + "status": { + "type": "string", + "description": "Whether this member can be successfully imported (success) or not (error). Even if the status is success, members are only added to a team on a 201 response.", + "example": "error" + }, + "value": { + "type": "string", + "description": "The email address for the member requested to be added to this team. May be blank or an error, such as 'invalid email format', if the email address cannot be found or parsed.", + "example": "new-team-member@acme.com" + } + } + }, + "MemberPermissionGrantSummaryRep": { + "type": "object", + "required": [ + "resource" + ], + "properties": { + "actionSet": { + "type": "string", + "description": "The name of the group of related actions to allow. A permission grant may have either an actionSet or a list of actions but not both at the same time." + }, + "actions": { + "type": "array", + "description": "A list of actions to allow. A permission grant may have either an actionSet or a list of actions but not both at the same time.", + "items": { + "type": "string" + }, + "example": [ + "maintainTeam" + ] + }, + "resource": { + "type": "string", + "description": "The resource for which the actions are allowed", + "example": "team/qa-team" + } + } + }, + "MemberSummary": { + "type": "object", + "required": [ + "_links", + "_id", + "role", + "email" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "self": { + "href": "/api/v2/members/569f183514f4432160000007", + "type": "application/json" + } + } + }, + "_id": { + "type": "string", + "description": "The member's ID", + "example": "569f183514f4432160000007" + }, + "firstName": { + "type": "string", + "description": "The member's first name", + "example": "Ariel" + }, + "lastName": { + "type": "string", + "description": "The member's last name", + "example": "Flores" + }, + "role": { + "type": "string", + "description": "The member's built-in role. If the member has no custom roles, this role will be in effect.", + "example": "admin" + }, + "email": { + "type": "string", + "description": "The member's email address", + "example": "ariel@acme.com" + } + } + }, + "MemberTeamSummaryRep": { + "type": "object", + "required": [ + "customRoleKeys", + "key", + "name" + ], + "properties": { + "customRoleKeys": { + "type": "array", + "description": "A list of keys of the custom roles this team has access to", + "items": { + "type": "string" + }, + "example": [ + "access-to-test-projects" + ] + }, + "key": { + "type": "string", + "description": "The team key", + "example": "team-key-123abc" + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "name": { + "type": "string", + "description": "The team name", + "example": "QA Team" + } + } + }, + "MemberTeamsPostInput": { + "type": "object", + "required": [ + "teamKeys" + ], + "properties": { + "teamKeys": { + "type": "array", + "description": "List of team keys", + "items": { + "type": "string" + }, + "example": [ + "team1", + "team2" + ] + } + } + }, + "Members": { + "type": "object", + "required": [ + "items", + "_links" + ], + "properties": { + "items": { + "type": "array", + "description": "An array of members", + "items": { + "$ref": "#/components/schemas/Member" + } + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + }, + "totalCount": { + "type": "integer", + "description": "The number of members returned" + } + } + }, + "MethodNotAllowedErrorRep": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string", + "description": "Specific error code encountered", + "example": "method_not_allowed" + }, + "message": { + "type": "string", + "description": "Description of the error", + "example": "Method not allowed" + } + } + }, + "MetricCollectionRep": { + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "An array of metrics", + "items": { + "$ref": "#/components/schemas/MetricListingRep" + } + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "self": { + "href": "/api/v2/metrics/my-project?limit=20", + "type": "application/json" + } + } + } + } + }, + "MetricEventDefaultRep": { + "type": "object", + "properties": { + "disabled": { + "type": "boolean", + "description": "Whether to disable defaulting missing unit events when calculating results. Defaults to false" + }, + "value": { + "type": "number", + "description": "The default value applied to missing unit events. Only available when disabled is false. Defaults to 0" + } + } + }, + "MetricGroupCollectionRep": { + "type": "object", + "required": [ + "items" + ], + "properties": { + "items": { + "type": "array", + "description": "An array of metric groups", + "items": { + "$ref": "#/components/schemas/MetricGroupRep" + } + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "parent": { + "href": "/api/v2/projects/my-project", + "type": "application/json" + }, + "self": { + "href": "/api/v2/projects/my-project/metric-groups", + "type": "application/json" + } + } + } + } + }, + "MetricGroupPost": { + "type": "object", + "required": [ + "key", + "name", + "kind", + "maintainerId", + "tags", + "metrics" + ], + "properties": { + "key": { + "type": "string", + "description": "A unique key to reference the metric group", + "example": "metric-group-key-123abc" + }, + "name": { + "type": "string", + "description": "A human-friendly name for the metric group", + "example": "My metric group" + }, + "kind": { + "type": "string", + "description": "The type of the metric group", + "example": "funnel", + "enum": [ + "funnel" + ] + }, + "description": { + "type": "string", + "description": "Description of the metric group", + "example": "Description of the metric group" + }, + "maintainerId": { + "type": "string", + "description": "The ID of the member who maintains this metric group", + "example": "569fdeadbeef1644facecafe" + }, + "tags": { + "type": "array", + "description": "Tags for the metric group", + "items": { + "type": "string" + }, + "example": [ + "ops" + ] + }, + "metrics": { + "type": "array", + "description": "An ordered list of the metrics in this metric group", + "items": { + "$ref": "#/components/schemas/MetricInMetricGroupInput" + } + } + } + }, + "MetricGroupRep": { + "type": "object", + "required": [ + "_id", + "key", + "name", + "kind", + "_links", + "tags", + "_creationDate", + "_lastModified", + "maintainer", + "metrics", + "_version" + ], + "properties": { + "_id": { + "type": "string", + "description": "The ID of this metric group", + "example": "bc3e5be1-02d2-40c7-9926-26d0aacd7aab" + }, + "key": { + "type": "string", + "description": "A unique key to reference the metric group", + "example": "metric-group-key-123abc" + }, + "name": { + "type": "string", + "description": "A human-friendly name for the metric group", + "example": "My metric group" + }, + "kind": { + "type": "string", + "description": "The type of the metric group", + "example": "funnel", + "enum": [ + "funnel", + "standard" + ] + }, + "description": { + "type": "string", + "description": "Description of the metric group", + "example": "Description of the metric group" + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "parent": { + "href": "/api/v2/projects/my-project", + "type": "application/json" + }, + "self": { + "href": "/api/v2/projects/my-project/metric-groups/my-metric-group", + "type": "application/json" + } + } + }, + "_access": { + "description": "Details on the allowed and denied actions for this metric group", + "$ref": "#/components/schemas/Access" + }, + "tags": { + "type": "array", + "description": "Tags for the metric group", + "items": { + "type": "string" + }, + "example": [ + "ops" + ] + }, + "_creationDate": { + "description": "Timestamp of when the metric group was created", + "example": "1628192791148", + "$ref": "#/components/schemas/UnixMillis" + }, + "_lastModified": { + "description": "Timestamp of when the metric group was last modified", + "example": "1628192791148", + "$ref": "#/components/schemas/UnixMillis" + }, + "maintainer": { + "description": "The maintainer of this metric", + "$ref": "#/components/schemas/MaintainerRep" + }, + "metrics": { + "type": "array", + "description": "An ordered list of the metrics in this metric group", + "items": { + "$ref": "#/components/schemas/MetricInGroupRep" + } + }, + "_version": { + "type": "integer", + "description": "The version of this metric group", + "example": 1 + }, + "experiments": { + "description": "Experiments that use this metric group. Only included if specified in the expand query parameter in a getMetricGroup request.", + "$ref": "#/components/schemas/DependentExperimentListRep" + }, + "experimentCount": { + "type": "integer", + "description": "The number of experiments using this metric group", + "example": 0 + } + } + }, + "MetricGroupResultsRep": { + "type": "object", + "required": [ + "_links", + "metrics" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + }, + "metrics": { + "type": "array", + "description": "An ordered list of the metrics in this metric group, and each of their results", + "items": { + "$ref": "#/components/schemas/MetricInGroupResultsRep" + } + } + } + }, + "MetricInGroupRep": { + "type": "object", + "required": [ + "key", + "name", + "kind", + "_links" + ], + "properties": { + "key": { + "type": "string", + "description": "The metric key", + "example": "metric-key-123abc" + }, + "_versionId": { + "type": "string", + "description": "The version ID of the metric", + "example": "version-id-123abc" + }, + "name": { + "type": "string", + "description": "The metric name", + "example": "Example metric" + }, + "kind": { + "type": "string", + "description": "The kind of event the metric tracks", + "example": "custom", + "enum": [ + "pageview", + "click", + "custom" + ] + }, + "isNumeric": { + "type": "boolean", + "description": "For custom metrics, whether to track numeric changes in value against a baseline (true) or to track a conversion when an end user takes an action (false).", + "example": true + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "self": { + "href": "/api/v2/metrics/my-project/my-metric", + "type": "application/json" + } + } + }, + "nameInGroup": { + "type": "string", + "description": "Name of the metric when used within the associated metric group. Can be different from the original name of the metric. Required if and only if the metric group is a funnel.", + "example": "Step 1" + }, + "randomizationUnits": { + "type": "array", + "description": "The randomization units for the metric", + "items": { + "type": "string" + }, + "example": [ + "user" + ] + } + } + }, + "MetricInGroupResultsRep": { + "type": "object", + "required": [ + "metric", + "results" + ], + "properties": { + "metric": { + "description": "Metric metadata", + "$ref": "#/components/schemas/MetricInGroupRep" + }, + "results": { + "description": "The results of this metric", + "$ref": "#/components/schemas/ExperimentBayesianResultsRep" + } + } + }, + "MetricInMetricGroupInput": { + "type": "object", + "required": [ + "key", + "nameInGroup" + ], + "properties": { + "key": { + "type": "string", + "description": "The metric key", + "example": "metric-key-123abc" + }, + "nameInGroup": { + "type": "string", + "description": "Name of the metric when used within the associated metric group. Can be different from the original name of the metric", + "example": "Step 1" + } + } + }, + "MetricInput": { + "type": "object", + "required": [ + "key" + ], + "properties": { + "key": { + "type": "string", + "description": "The metric key", + "example": "metric-key-123abc" + }, + "isGroup": { + "type": "boolean", + "description": "Whether this is a metric group (true) or a metric (false). Defaults to false", + "example": true + }, + "primary": { + "type": "boolean", + "description": "Deprecated, use primarySingleMetricKey and primaryFunnelKey. Whether this is a primary metric (true) or a secondary metric (false)", + "example": true, + "deprecated": true + } + } + }, + "MetricListingRep": { + "type": "object", + "required": [ + "_id", + "_versionId", + "key", + "name", + "kind", + "_links", + "tags", + "_creationDate" + ], + "properties": { + "experimentCount": { + "type": "integer", + "description": "The number of experiments using this metric", + "example": 0 + }, + "metricGroupCount": { + "type": "integer", + "description": "The number of metric groups using this metric", + "example": 0 + }, + "_id": { + "type": "string", + "description": "The ID of this metric", + "example": "5902deadbeef667524a01290" + }, + "_versionId": { + "type": "string", + "description": "The version ID of the metric", + "example": "version-id-123abc" + }, + "key": { + "type": "string", + "description": "A unique key to reference the metric", + "example": "metric-key-123abc" + }, + "name": { + "type": "string", + "description": "A human-friendly name for the metric", + "example": "My metric" + }, + "kind": { + "type": "string", + "description": "The kind of event the metric tracks", + "example": "custom", + "enum": [ + "pageview", + "click", + "custom" + ] + }, + "_attachedFlagCount": { + "type": "integer", + "description": "The number of feature flags currently attached to this metric", + "example": 0 + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "parent": { + "href": "/api/v2/metrics/my-project", + "type": "application/json" + }, + "self": { + "href": "/api/v2/metrics/my-project/my-metric", + "type": "application/json" + } + } + }, + "_site": { + "description": "Details on how to access the metric in the LaunchDarkly UI", + "example": "{\"href\":\"/experiments/metrics/my-metric/edit\",\"type\":\"text/html\"}", + "$ref": "#/components/schemas/Link" + }, + "_access": { + "description": "Details on the allowed and denied actions for this metric", + "$ref": "#/components/schemas/Access" + }, + "tags": { + "type": "array", + "description": "Tags for the metric", + "items": { + "type": "string" + }, + "example": [] + }, + "_creationDate": { + "description": "Timestamp of when the metric was created", + "example": "1628192791148", + "$ref": "#/components/schemas/UnixMillis" + }, + "lastModified": { + "$ref": "#/components/schemas/Modification" + }, + "maintainerId": { + "type": "string", + "description": "The ID of the member who maintains this metric", + "example": "569fdeadbeef1644facecafe" + }, + "_maintainer": { + "description": "Details on the member who maintains this metric", + "example": "{\"_links\":{\"self\":{\"href\":\"/api/v2/members/569fdeadbeef1644facecafe\",\"type\":\"application/json\"}},\"_id\":\"569fdeadbeef1644facecafe\",\"firstName\":\"Ariel\",\"lastName\":\"Flores\",\"role\":\"owner\",\"email\":\"ariel@acme.com\"}", + "$ref": "#/components/schemas/MemberSummary" + }, + "description": { + "type": "string", + "description": "Description of the metric" + }, + "isNumeric": { + "type": "boolean", + "description": "For custom metrics, whether to track numeric changes in value against a baseline (true) or to track a conversion when an end user takes an action (false).", + "example": true + }, + "successCriteria": { + "type": "string", + "description": "For custom metrics, the success criteria", + "enum": [ + "HigherThanBaseline", + "LowerThanBaseline" + ] + }, + "unit": { + "type": "string", + "description": "For numeric custom metrics, the unit of measure" + }, + "eventKey": { + "type": "string", + "description": "For custom metrics, the event key to use in your code" + }, + "randomizationUnits": { + "type": "array", + "description": "An array of randomization units allowed for this metric", + "items": { + "type": "string" + }, + "example": [ + "user" + ] + }, + "unitAggregationType": { + "type": "string", + "description": "The method by which multiple unit event values are aggregated", + "example": "average", + "enum": [ + "average", + "sum" + ] + }, + "analysisType": { + "type": "string", + "description": "The method for analyzing metric events", + "example": "mean", + "enum": [ + "mean", + "percentile" + ] + }, + "percentileValue": { + "type": "integer", + "description": "The percentile for the analysis method. An integer denoting the target percentile between 0 and 100. Required when analysisType is percentile.", + "example": 95 + }, + "eventDefault": { + "$ref": "#/components/schemas/MetricEventDefaultRep" + } + } + }, + "MetricPost": { + "type": "object", + "required": [ + "key", + "kind" + ], + "properties": { + "key": { + "type": "string", + "description": "A unique key to reference the metric", + "example": "metric-key-123abc" + }, + "name": { + "type": "string", + "description": "A human-friendly name for the metric", + "example": "Example metric" + }, + "description": { + "type": "string", + "description": "Description of the metric", + "example": "optional description" + }, + "kind": { + "type": "string", + "description": "The kind of event your metric will track", + "example": "custom", + "enum": [ + "pageview", + "click", + "custom" + ] + }, + "selector": { + "type": "string", + "description": "One or more CSS selectors. Required for click metrics only.", + "example": ".dropdown-toggle" + }, + "urls": { + "type": "array", + "description": "One or more target URLs. Required for click and pageview metrics only.", + "items": { + "$ref": "#/components/schemas/UrlPost" + }, + "example": "invalid example" + }, + "isActive": { + "type": "boolean", + "description": "Whether the metric is active. Set to true to record click or pageview metrics. Not applicable for custom metrics.", + "example": true + }, + "isNumeric": { + "type": "boolean", + "description": "Whether to track numeric changes in value against a baseline (true) or to track a conversion when an end user takes an action (false). Required for custom metrics only.", + "example": false + }, + "unit": { + "type": "string", + "description": "The unit of measure. Applicable for numeric custom metrics only.", + "example": "orders" + }, + "eventKey": { + "type": "string", + "description": "The event key to use in your code. Required for custom conversion/binary and custom numeric metrics only.", + "example": "sales generated" + }, + "successCriteria": { + "type": "string", + "description": "Success criteria. Required for custom numeric metrics, optional for custom conversion metrics.", + "example": "HigherThanBaseline", + "enum": [ + "HigherThanBaseline", + "LowerThanBaseline" + ] + }, + "tags": { + "type": "array", + "description": "Tags for the metric", + "items": { + "type": "string" + }, + "example": [ + "example-tag" + ] + }, + "randomizationUnits": { + "type": "array", + "description": "An array of randomization units allowed for this metric", + "items": { + "type": "string" + }, + "example": [ + "user" + ] + }, + "unitAggregationType": { + "type": "string", + "description": "The method by which multiple unit event values are aggregated", + "example": "average", + "enum": [ + "average", + "sum" + ] + }, + "analysisType": { + "type": "string", + "description": "The method for analyzing metric events", + "example": "mean" + }, + "percentileValue": { + "type": "integer", + "description": "The percentile for the analysis method. An integer denoting the target percentile between 0 and 100. Required when analysisType is percentile.", + "example": 95 + }, + "eventDefault": { + "$ref": "#/components/schemas/MetricEventDefaultRep" + } + } + }, + "MetricRep": { + "type": "object", + "required": [ + "_id", + "_versionId", + "key", + "name", + "kind", + "_links", + "tags", + "_creationDate" + ], + "properties": { + "experimentCount": { + "type": "integer", + "description": "The number of experiments using this metric", + "example": 0 + }, + "metricGroupCount": { + "type": "integer", + "description": "The number of metric groups using this metric", + "example": 0 + }, + "_id": { + "type": "string", + "description": "The ID of this metric", + "example": "5902deadbeef667524a01290" + }, + "_versionId": { + "type": "string", + "description": "The version ID of the metric", + "example": "version-id-123abc" + }, + "key": { + "type": "string", + "description": "A unique key to reference the metric", + "example": "metric-key-123abc" + }, + "name": { + "type": "string", + "description": "A human-friendly name for the metric", + "example": "My metric" + }, + "kind": { + "type": "string", + "description": "The kind of event the metric tracks", + "example": "custom", + "enum": [ + "pageview", + "click", + "custom" + ] + }, + "_attachedFlagCount": { + "type": "integer", + "description": "The number of feature flags currently attached to this metric", + "example": 0 + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "parent": { + "href": "/api/v2/metrics/my-project", + "type": "application/json" + }, + "self": { + "href": "/api/v2/metrics/my-project/my-metric", + "type": "application/json" + } + } + }, + "_site": { + "description": "Details on how to access the metric in the LaunchDarkly UI", + "example": "{\"href\":\"/experiments/metrics/my-metric/edit\",\"type\":\"text/html\"}", + "$ref": "#/components/schemas/Link" + }, + "_access": { + "description": "Details on the allowed and denied actions for this metric", + "$ref": "#/components/schemas/Access" + }, + "tags": { + "type": "array", + "description": "Tags for the metric", + "items": { + "type": "string" + }, + "example": [] + }, + "_creationDate": { + "description": "Timestamp of when the metric was created", + "example": "1628192791148", + "$ref": "#/components/schemas/UnixMillis" + }, + "lastModified": { + "$ref": "#/components/schemas/Modification" + }, + "maintainerId": { + "type": "string", + "description": "The ID of the member who maintains this metric", + "example": "569fdeadbeef1644facecafe" + }, + "_maintainer": { + "description": "Details on the member who maintains this metric", + "example": "{\"_links\":{\"self\":{\"href\":\"/api/v2/members/569fdeadbeef1644facecafe\",\"type\":\"application/json\"}},\"_id\":\"569fdeadbeef1644facecafe\",\"firstName\":\"Ariel\",\"lastName\":\"Flores\",\"role\":\"owner\",\"email\":\"ariel@acme.com\"}", + "$ref": "#/components/schemas/MemberSummary" + }, + "description": { + "type": "string", + "description": "Description of the metric" + }, + "isNumeric": { + "type": "boolean", + "description": "For custom metrics, whether to track numeric changes in value against a baseline (true) or to track a conversion when an end user takes an action (false).", + "example": true + }, + "successCriteria": { + "type": "string", + "description": "For custom metrics, the success criteria", + "enum": [ + "HigherThanBaseline", + "LowerThanBaseline" + ] + }, + "unit": { + "type": "string", + "description": "For numeric custom metrics, the unit of measure" + }, + "eventKey": { + "type": "string", + "description": "For custom metrics, the event key to use in your code" + }, + "randomizationUnits": { + "type": "array", + "description": "An array of randomization units allowed for this metric", + "items": { + "type": "string" + }, + "example": [ + "user" + ] + }, + "unitAggregationType": { + "type": "string", + "description": "The method by which multiple unit event values are aggregated", + "example": "average", + "enum": [ + "average", + "sum" + ] + }, + "analysisType": { + "type": "string", + "description": "The method for analyzing metric events", + "example": "mean", + "enum": [ + "mean", + "percentile" + ] + }, + "percentileValue": { + "type": "integer", + "description": "The percentile for the analysis method. An integer denoting the target percentile between 0 and 100. Required when analysisType is percentile.", + "example": 95 + }, + "eventDefault": { + "$ref": "#/components/schemas/MetricEventDefaultRep" + }, + "experiments": { + "description": "Experiments that use this metric, including those using a metric group that contains this metric", + "$ref": "#/components/schemas/DependentExperimentListRep" + }, + "metricGroups": { + "type": "array", + "description": "Metric groups that use this metric", + "items": { + "$ref": "#/components/schemas/DependentMetricGroupRep" + } + }, + "isActive": { + "type": "boolean", + "description": "Whether the metric is active", + "example": true + }, + "_attachedFeatures": { + "type": "array", + "description": "Details on the flags attached to this metric", + "items": { + "$ref": "#/components/schemas/FlagListingRep" + } + }, + "_version": { + "type": "integer", + "description": "Version of the metric", + "example": 1 + }, + "selector": { + "type": "string", + "description": "For click metrics, the CSS selectors" + }, + "urls": { + "description": "For click and pageview metrics, the target URLs", + "$ref": "#/components/schemas/UrlMatchers" + } + } + }, + "MetricSeen": { + "type": "object", + "properties": { + "ever": { + "type": "boolean", + "description": "Whether the metric has received an event for this iteration", + "example": true + }, + "timestamp": { + "type": "integer", + "format": "int64", + "description": "Timestamp of when the metric most recently received an event for this iteration", + "example": 1657129307 + } + } + }, + "MetricV2Rep": { + "type": "object", + "required": [ + "key", + "name", + "kind", + "_links" + ], + "properties": { + "key": { + "type": "string", + "description": "The metric key", + "example": "metric-key-123abc" + }, + "_versionId": { + "type": "string", + "description": "The version ID of the metric", + "example": "version-id-123abc" + }, + "name": { + "type": "string", + "description": "The metric name", + "example": "Example metric" + }, + "kind": { + "type": "string", + "description": "The kind of event the metric tracks", + "example": "custom", + "enum": [ + "pageview", + "click", + "custom" + ] + }, + "isNumeric": { + "type": "boolean", + "description": "For custom metrics, whether to track numeric changes in value against a baseline (true) or to track a conversion when an end user takes an action (false).", + "example": true + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "self": { + "href": "/api/v2/metrics/my-project/my-metric", + "type": "application/json" + } + } + } + } + }, + "MetricsInput": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MetricInput" + } + }, + "MigrationFlagStageCount": { + "type": "integer" + }, + "MigrationSafetyIssueRep": { + "type": "object", + "properties": { + "causingRuleId": { + "type": "string", + "description": "The ID of the rule which caused this issue" + }, + "affectedRuleIds": { + "type": "array", + "description": "A list of the IDs of the rules which are affected by this issue. fallthrough is a sentinel value for the default rule.", + "items": { + "type": "string" + } + }, + "issue": { + "type": "string", + "description": "A description of the issue that causingRuleId has caused for affectedRuleIds." + }, + "oldSystemAffected": { + "type": "boolean", + "description": "Whether the changes caused by causingRuleId bring inconsistency to the old system" + } + } + }, + "MigrationSettingsPost": { + "type": "object", + "required": [ + "stageCount" + ], + "properties": { + "contextKind": { + "type": "string", + "description": "Context kind for a migration with 6 stages, where data is being moved" + }, + "stageCount": { + "enum": [ + "2", + "4", + "6" + ], + "$ref": "#/components/schemas/MigrationFlagStageCount" + } + } + }, + "Modification": { + "type": "object", + "properties": { + "date": { + "type": "string", + "format": "date-time", + "example": "2021-08-05T19:46:31.148082Z" + } + } + }, + "MultiEnvironmentDependentFlag": { + "type": "object", + "required": [ + "key", + "environments" + ], + "properties": { + "name": { + "type": "string", + "description": "The flag name", + "example": "Example dependent flag" + }, + "key": { + "type": "string", + "description": "The flag key", + "example": "dependent-flag-key-123abc" + }, + "environments": { + "type": "array", + "description": "A list of environments in which the dependent flag appears", + "items": { + "$ref": "#/components/schemas/DependentFlagEnvironment" + } + } + } + }, + "MultiEnvironmentDependentFlags": { + "type": "object", + "required": [ + "items", + "_links", + "_site" + ], + "properties": { + "items": { + "type": "array", + "description": "An array of dependent flags with their environment information", + "items": { + "$ref": "#/components/schemas/MultiEnvironmentDependentFlag" + } + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + }, + "_site": { + "description": "Details on how to access the prerequisite flag in the LaunchDarkly UI", + "example": "{ \"href\": \"/example-project/~/features/example-prereq-flag\", \"type\": \"text/html\" }", + "$ref": "#/components/schemas/Link" + } + } + }, + "NewMemberForm": { + "type": "object", + "required": [ + "email" + ], + "properties": { + "email": { + "type": "string", + "description": "The member's email", + "example": "sandy@acme.com" + }, + "password": { + "type": "string", + "description": "The member's password", + "example": "***" + }, + "firstName": { + "type": "string", + "description": "The member's first name", + "example": "Ariel" + }, + "lastName": { + "type": "string", + "description": "The member's last name", + "example": "Flores" + }, + "role": { + "type": "string", + "description": "The member's built-in role", + "example": "reader", + "enum": [ + "reader", + "writer", + "admin", + "no_access" + ] + }, + "customRoles": { + "type": "array", + "description": "An array of the member's custom roles", + "items": { + "type": "string" + }, + "example": [ + "customRole1", + "customRole2" + ] + }, + "teamKeys": { + "type": "array", + "description": "An array of the member's teams", + "items": { + "type": "string" + }, + "example": [ + "team-1", + "team-2" + ] + } + } + }, + "NewMemberFormListPost": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NewMemberForm" + } + }, + "NotFoundErrorRep": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string", + "description": "Specific error code encountered", + "example": "not_found" + }, + "message": { + "type": "string", + "description": "Description of the error", + "example": "Invalid resource identifier" + } + } + }, + "OAuthProviderKind": { + "type": "string" + }, + "ObjectId": { + "type": "string" + }, + "Operator": { + "type": "string" + }, + "ParameterDefault": { + "type": "object", + "properties": { + "value": { + "description": "The default value for the given parameter" + }, + "booleanVariationValue": { + "type": "boolean", + "description": "Variation value for boolean flags. Not applicable for non-boolean flags." + }, + "ruleClause": { + "description": "Metadata related to add rule instructions", + "$ref": "#/components/schemas/RuleClause" + } + } + }, + "ParameterRep": { + "type": "object", + "properties": { + "variationId": { + "type": "string" + }, + "flagKey": { + "type": "string" + } + } + }, + "ParentResourceRep": { + "type": "object", + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "name": { + "type": "string", + "description": "The name of the parent resource" + }, + "resource": { + "type": "string", + "description": "The parent's resource specifier" + } + } + }, + "PatchFailedErrorRep": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string", + "description": "Specific error code encountered", + "example": "patch_failed" + }, + "message": { + "type": "string", + "description": "Description of the error", + "example": "Unprocessable entity. Could not apply patch." + } + } + }, + "PatchOperation": { + "type": "object", + "required": [ + "op", + "path", + "value" + ], + "properties": { + "op": { + "type": "string", + "description": "The type of operation to perform", + "example": "replace" + }, + "path": { + "type": "string", + "description": "A JSON Pointer string specifying the part of the document to operate on", + "example": "/exampleField" + }, + "value": { + "description": "A JSON value used in \"add\", \"replace\", and \"test\" operations", + "example": "new example value" + } + } + }, + "PatchWithComment": { + "type": "object", + "required": [ + "patch" + ], + "properties": { + "patch": { + "description": "A JSON patch representation of the change to make", + "$ref": "#/components/schemas/JSONPatch" + }, + "comment": { + "type": "string", + "description": "Optional comment" + } + } + }, + "Phase": { + "type": "object", + "required": [ + "id", + "audiences", + "name" + ], + "properties": { + "id": { + "type": "string", + "description": "The phase ID", + "example": "1234a56b7c89d012345e678f" + }, + "audiences": { + "description": "An ordered list of the audiences for this release phase. Each audience corresponds to a LaunchDarkly environment.", + "$ref": "#/components/schemas/Audiences" + }, + "name": { + "type": "string", + "description": "The release phase name", + "example": "Phase 1 - Testing" + } + } + }, + "PostFlagScheduledChangesInput": { + "type": "object", + "required": [ + "executionDate", + "instructions" + ], + "properties": { + "comment": { + "type": "string", + "description": "Optional comment describing the scheduled changes", + "example": "optional comment" + }, + "executionDate": { + "description": "When the scheduled changes should be executed", + "example": "1636558831870", + "$ref": "#/components/schemas/UnixMillis" + }, + "instructions": { + "description": "The actions to perform on the execution date for these scheduled changes. This should be an array with a single object that looks like {\"kind\": \"scheduled_action\"}. Supported scheduled actions are turnFlagOn and turnFlagOff.", + "example": "[ { \"kind\": \"turnFlagOn\" }]", + "$ref": "#/components/schemas/Instructions" + } + } + }, + "Prerequisite": { + "type": "object", + "required": [ + "key", + "variation" + ], + "properties": { + "key": { + "type": "string" + }, + "variation": { + "type": "integer" + } + } + }, + "Project": { + "type": "object", + "required": [ + "_links", + "_id", + "key", + "includeInSnippetByDefault", + "name", + "tags" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "environments": { + "href": "/api/v2/projects/my-project/environments", + "type": "application/json" + }, + "self": { + "href": "/api/v2/projects/my-project", + "type": "application/json" + } + } + }, + "_id": { + "type": "string", + "description": "The ID of this project", + "example": "57be1db38b75bf0772d11383" + }, + "key": { + "type": "string", + "description": "The key of this project", + "example": "project-key-123abc" + }, + "includeInSnippetByDefault": { + "type": "boolean", + "description": "Whether or not flags created in this project are made available to the client-side JavaScript SDK by default", + "example": true + }, + "defaultClientSideAvailability": { + "description": "Describes which client-side SDKs can use new flags by default", + "$ref": "#/components/schemas/ClientSideAvailability" + }, + "name": { + "type": "string", + "description": "A human-friendly name for the project", + "example": "My Project" + }, + "_access": { + "description": "Details on the allowed and denied actions for this project", + "$ref": "#/components/schemas/Access" + }, + "tags": { + "type": "array", + "description": "A list of tags for the project", + "items": { + "type": "string" + }, + "example": [ + "ops" + ] + }, + "defaultReleasePipelineKey": { + "type": "string", + "description": "The key of the default release pipeline for this project" + }, + "environments": { + "description": "A paginated list of environments for the project. By default this field is omitted unless expanded by the client.", + "$ref": "#/components/schemas/Environments" + } + } + }, + "ProjectPost": { + "type": "object", + "required": [ + "name", + "key" + ], + "properties": { + "name": { + "type": "string", + "description": "A human-friendly name for the project.", + "example": "My Project" + }, + "key": { + "type": "string", + "description": "A unique key used to reference the project in your code.", + "example": "project-key-123abc" + }, + "includeInSnippetByDefault": { + "type": "boolean", + "description": "Whether or not flags created in this project are made available to the client-side JavaScript SDK by default.", + "example": true + }, + "defaultClientSideAvailability": { + "description": "Controls which client-side SDKs can use new flags by default.", + "$ref": "#/components/schemas/DefaultClientSideAvailabilityPost" + }, + "tags": { + "type": "array", + "description": "Tags for the project", + "items": { + "type": "string" + }, + "example": [ + "ops" + ] + }, + "environments": { + "type": "array", + "description": "Creates the provided environments for this project. If omitted default environments will be created instead.", + "items": { + "$ref": "#/components/schemas/EnvironmentPost" + } + } + } + }, + "ProjectRep": { + "type": "object", + "required": [ + "_links", + "_id", + "key", + "includeInSnippetByDefault", + "name", + "tags", + "environments" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "environments": { + "href": "/api/v2/projects/my-project/environments", + "type": "application/json" + }, + "self": { + "href": "/api/v2/projects/my-project", + "type": "application/json" + } + } + }, + "_id": { + "type": "string", + "description": "The ID of this project", + "example": "57be1db38b75bf0772d11383" + }, + "key": { + "type": "string", + "description": "The key of this project", + "example": "project-key-123abc" + }, + "includeInSnippetByDefault": { + "type": "boolean", + "description": "Whether or not flags created in this project are made available to the client-side JavaScript SDK by default", + "example": true + }, + "defaultClientSideAvailability": { + "description": "Describes which client-side SDKs can use new flags by default", + "$ref": "#/components/schemas/ClientSideAvailability" + }, + "name": { + "type": "string", + "description": "A human-friendly name for the project", + "example": "My Project" + }, + "_access": { + "description": "Details on the allowed and denied actions for this project", + "$ref": "#/components/schemas/Access" + }, + "tags": { + "type": "array", + "description": "A list of tags for the project", + "items": { + "type": "string" + }, + "example": [ + "ops" + ] + }, + "defaultReleasePipelineKey": { + "type": "string", + "description": "The key of the default release pipeline for this project" + }, + "environments": { + "type": "array", + "description": "A list of environments for the project", + "items": { + "$ref": "#/components/schemas/Environment" + } + } + } + }, + "ProjectSummary": { + "type": "object", + "required": [ + "_id", + "_links", + "key", + "name" + ], + "properties": { + "_id": { + "type": "string", + "description": "The ID of this project", + "example": "57be1db38b75bf0772d11383" + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "environments": { + "href": "/api/v2/projects/example-project/environments", + "type": "application/json" + }, + "self": { + "href": "/api/v2/projects/example-project", + "type": "application/json" + } + } + }, + "key": { + "type": "string", + "description": "The project key", + "example": "project-key-123abc" + }, + "name": { + "type": "string", + "description": "The project name", + "example": "Example project" + } + } + }, + "Projects": { + "type": "object", + "required": [ + "_links", + "items" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "A link to this resource.", + "example": { + "self": { + "href": "/api/v2/projects", + "type": "application/json" + } + } + }, + "items": { + "type": "array", + "description": "List of projects.", + "items": { + "$ref": "#/components/schemas/Project" + } + }, + "totalCount": { + "type": "integer" + } + } + }, + "RandomizationSettingsPut": { + "type": "object", + "required": [ + "randomizationUnits" + ], + "properties": { + "randomizationUnits": { + "type": "array", + "description": "An array of randomization units allowed for this project.", + "items": { + "$ref": "#/components/schemas/RandomizationUnitInput" + } + } + } + }, + "RandomizationSettingsRep": { + "type": "object", + "properties": { + "_projectId": { + "type": "string", + "description": "The project ID", + "example": "12345abcde67890fghij" + }, + "_projectKey": { + "type": "string", + "description": "The project key", + "example": "project-key-123abc" + }, + "randomizationUnits": { + "type": "array", + "description": "An array of the randomization units in this project", + "items": { + "$ref": "#/components/schemas/RandomizationUnitRep" + } + }, + "_creationDate": { + "description": "Timestamp of when the experiment was created", + "example": "1654104600000", + "$ref": "#/components/schemas/UnixMillis" + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + } + } + }, + "RandomizationUnitInput": { + "type": "object", + "required": [ + "randomizationUnit", + "default", + "standardRandomizationUnit" + ], + "properties": { + "randomizationUnit": { + "type": "string", + "description": "The unit of randomization. Must match the key of an existing context kind in this project.", + "example": "user" + }, + "default": { + "type": "boolean", + "description": "If true, any experiment iterations created within this project will default to using this randomization unit. A project can only have one default randomization unit.", + "example": true + }, + "standardRandomizationUnit": { + "type": "string", + "description": "One of LaunchDarkly's fixed set of standard randomization units.", + "enum": [ + "guest", + "guestTime", + "organization", + "request", + "user", + "userTime" + ] + } + } + }, + "RandomizationUnitRep": { + "type": "object", + "properties": { + "randomizationUnit": { + "type": "string", + "description": "The unit of randomization. Defaults to user.", + "example": "user" + }, + "standardRandomizationUnit": { + "type": "string", + "description": "One of LaunchDarkly's fixed set of standard randomization units.", + "example": "user" + }, + "default": { + "type": "boolean", + "description": "Whether this randomization unit is the default for experiments", + "example": true + }, + "_hidden": { + "type": "boolean" + }, + "_displayName": { + "type": "string", + "description": "The display name for the randomization unit, displayed in the LaunchDarkly user interface.", + "example": "User" + } + } + }, + "RateLimitedErrorRep": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string", + "description": "Specific error code encountered", + "example": "rate_limited" + }, + "message": { + "type": "string", + "description": "Description of the error", + "example": "You've exceeded the API rate limit. Try again later." + } + } + }, + "RecentTriggerBody": { + "type": "object", + "properties": { + "timestamp": { + "description": "Timestamp of the incoming trigger webhook", + "example": "1654104600000", + "$ref": "#/components/schemas/UnixMillis" + }, + "jsonBody": { + "type": "object", + "additionalProperties": {}, + "description": "The marshalled JSON request body for the incoming trigger webhook. If this is empty or contains invalid JSON, the timestamp is recorded but this field will be empty." + } + } + }, + "ReferenceRep": { + "type": "object", + "required": [ + "path", + "hunks" + ], + "properties": { + "path": { + "type": "string", + "description": "File path of the reference", + "example": "/main/index.js" + }, + "hint": { + "type": "string", + "description": "Programming language used in the file", + "example": "javascript" + }, + "hunks": { + "type": "array", + "items": { + "$ref": "#/components/schemas/HunkRep" + } + } + } + }, + "RelativeDifferenceRep": { + "type": "object", + "properties": { + "upper": { + "type": "number", + "description": "An upper bound of the relative difference between the treatment and the fromTreatmentId", + "example": 0.42655970355712425 + }, + "lower": { + "type": "number", + "description": "A lower bound of the relative difference between the treatment and the fromTreatmentId", + "example": -0.13708601934659803 + }, + "fromTreatmentId": { + "type": "string", + "description": "The treatment ID of the treatment against which the relative difference is calculated", + "example": "92b8354e-360e-4d67-8f13-fa6a46ca8077" + } + } + }, + "RelayAutoConfigCollectionRep": { + "type": "object", + "required": [ + "items" + ], + "properties": { + "items": { + "type": "array", + "description": "An array of Relay Proxy configurations", + "items": { + "$ref": "#/components/schemas/RelayAutoConfigRep" + } + } + } + }, + "RelayAutoConfigPost": { + "type": "object", + "required": [ + "name", + "policy" + ], + "properties": { + "name": { + "type": "string", + "description": "A human-friendly name for the Relay Proxy configuration" + }, + "policy": { + "type": "array", + "description": "A description of what environments and projects the Relay Proxy should include or exclude. To learn more, read [Writing an inline policy](https://docs.launchdarkly.com/home/relay-proxy/automatic-configuration#writing-an-inline-policy).", + "items": { + "$ref": "#/components/schemas/Statement" + } + } + } + }, + "RelayAutoConfigRep": { + "type": "object", + "required": [ + "_id", + "name", + "policy", + "fullKey", + "displayKey", + "creationDate", + "lastModified" + ], + "properties": { + "_id": { + "description": "The ID of the Relay Proxy configuration", + "example": "12ab3c45de678910abc12345", + "$ref": "#/components/schemas/ObjectId" + }, + "_creator": { + "description": "Details on the member who created this Relay Proxy configuration", + "$ref": "#/components/schemas/MemberSummary" + }, + "_access": { + "description": "Details on the allowed and denied actions for this Relay Proxy configuration", + "$ref": "#/components/schemas/Access" + }, + "name": { + "type": "string", + "description": "A human-friendly name for the Relay Proxy configuration", + "example": "Relay Proxy Demo Config" + }, + "policy": { + "type": "array", + "description": "A description of what environments and projects the Relay Proxy should include or exclude", + "items": { + "$ref": "#/components/schemas/Statement" + } + }, + "fullKey": { + "type": "string", + "description": "The Relay Proxy configuration key" + }, + "displayKey": { + "type": "string", + "description": "The last few characters of the Relay Proxy configuration key, displayed in the LaunchDarkly UI", + "example": "7f30" + }, + "creationDate": { + "description": "Timestamp of when the Relay Proxy configuration was created", + "example": "1628001602644", + "$ref": "#/components/schemas/UnixMillis" + }, + "lastModified": { + "description": "Timestamp of when the Relay Proxy configuration was most recently modified", + "example": "1628001602644", + "$ref": "#/components/schemas/UnixMillis" + } + } + }, + "Release": { + "type": "object", + "required": [ + "name", + "releasePipelineKey", + "releasePipelineDescription", + "phases", + "_version" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + }, + "name": { + "type": "string", + "description": "The release pipeline name", + "example": "Example release pipeline" + }, + "releasePipelineKey": { + "type": "string", + "description": "The release pipeline key", + "example": "example-release-pipeline" + }, + "releasePipelineDescription": { + "type": "string", + "description": "The release pipeline description", + "example": "Our release pipeline for typical testing and deployment" + }, + "phases": { + "type": "array", + "description": "An ordered list of the release pipeline phases", + "items": { + "$ref": "#/components/schemas/ReleasePhase" + } + }, + "_version": { + "type": "integer", + "description": "The release version", + "example": 1 + } + } + }, + "ReleaseAudience": { + "type": "object", + "required": [ + "environment", + "name" + ], + "properties": { + "environment": { + "description": "Details about the environment", + "$ref": "#/components/schemas/EnvironmentSummary" + }, + "name": { + "type": "string", + "description": "The release phase name", + "example": "Phase 1 - Testing" + } + } + }, + "ReleasePhase": { + "type": "object", + "required": [ + "_id", + "_name", + "complete", + "_creationDate", + "_audiences" + ], + "properties": { + "_id": { + "type": "string", + "description": "The phase ID", + "example": "1234a56b7c89d012345e678f" + }, + "_name": { + "type": "string", + "description": "The release phase name", + "example": "Phase 1 - Testing" + }, + "complete": { + "type": "boolean", + "description": "Whether this phase is complete", + "example": true + }, + "_creationDate": { + "description": "Timestamp of when the release phase was created", + "example": "1684262711507", + "$ref": "#/components/schemas/UnixMillis" + }, + "_completionDate": { + "description": "Timestamp of when the release phase was completed", + "example": "1684262711509", + "$ref": "#/components/schemas/UnixMillis" + }, + "_completedBy": { + "description": "Details about how this phase was marked as complete", + "$ref": "#/components/schemas/CompletedBy" + }, + "_audiences": { + "type": "array", + "description": "A logical grouping of one or more environments that share attributes for rolling out changes", + "items": { + "$ref": "#/components/schemas/ReleaseAudience" + } + } + } + }, + "ReleasePipeline": { + "type": "object", + "required": [ + "createdAt", + "key", + "name", + "phases" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "description": "Timestamp of when the release pipeline was created", + "example": "1684262711507" + }, + "description": { + "type": "string", + "description": "The release pipeline description", + "example": "Standard pipeline to roll out to production" + }, + "key": { + "type": "string", + "description": "The release pipeline key", + "example": "standard-pipeline" + }, + "name": { + "type": "string", + "description": "The release pipeline name", + "example": "Standard Pipeline" + }, + "phases": { + "type": "array", + "description": "An ordered list of the release pipeline phases. Each phase is a logical grouping of one or more environments that share attributes for rolling out changes.", + "items": { + "$ref": "#/components/schemas/Phase" + } + }, + "tags": { + "type": "array", + "description": "A list of the release pipeline's tags", + "items": { + "type": "string" + }, + "example": [ + "example-tag" + ] + }, + "_version": { + "type": "integer", + "description": "The release pipeline version", + "example": 1 + }, + "_access": { + "description": "Details on the allowed and denied actions for this release pipeline", + "$ref": "#/components/schemas/Access" + } + } + }, + "ReleasePipelineCollection": { + "type": "object", + "required": [ + "items", + "totalCount" + ], + "properties": { + "items": { + "type": "array", + "description": "An array of release pipelines", + "items": { + "$ref": "#/components/schemas/ReleasePipeline" + } + }, + "totalCount": { + "type": "integer", + "description": "Total number of release pipelines", + "example": 1 + } + } + }, + "RepositoryCollectionRep": { + "type": "object", + "required": [ + "_links", + "items" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "items": { + "type": "array", + "description": "An array of repositories", + "items": { + "$ref": "#/components/schemas/RepositoryRep" + } + } + } + }, + "RepositoryRep": { + "type": "object", + "required": [ + "name", + "type", + "defaultBranch", + "enabled", + "version", + "_links" + ], + "properties": { + "name": { + "type": "string", + "description": "The repository name", + "example": "LaunchDarkly-Docs" + }, + "sourceLink": { + "type": "string", + "description": "A URL to access the repository", + "example": "https://github.com/launchdarkly/LaunchDarkly-Docs" + }, + "commitUrlTemplate": { + "type": "string", + "description": "A template for constructing a valid URL to view the commit", + "example": "https://github.com/launchdarkly/LaunchDarkly-Docs/commit/${sha}" + }, + "hunkUrlTemplate": { + "type": "string", + "description": "A template for constructing a valid URL to view the hunk", + "example": "https://github.com/launchdarkly/LaunchDarkly-Docs/blob/${sha}/${filePath}#L${lineNumber}" + }, + "type": { + "type": "string", + "description": "The type of repository", + "example": "github", + "enum": [ + "bitbucket", + "custom", + "github", + "gitlab" + ] + }, + "defaultBranch": { + "type": "string", + "description": "The repository's default branch", + "example": "main" + }, + "enabled": { + "type": "boolean", + "description": "Whether or not a repository is enabled for code reference scanning", + "example": true + }, + "version": { + "type": "integer", + "description": "The version of the repository's saved information", + "example": 3 + }, + "branches": { + "type": "array", + "description": "An array of the repository's branches that have been scanned for code references", + "items": { + "$ref": "#/components/schemas/BranchRep" + } + }, + "_links": { + "type": "object", + "additionalProperties": {} + }, + "_access": { + "$ref": "#/components/schemas/Access" + } + } + }, + "ResourceAccess": { + "type": "object", + "properties": { + "action": { + "$ref": "#/components/schemas/ActionIdentifier" + }, + "resource": { + "type": "string" + } + } + }, + "ResourceIDResponse": { + "type": "object", + "properties": { + "kind": { + "type": "string" + }, + "projectKey": { + "type": "string" + }, + "environmentKey": { + "type": "string" + }, + "flagKey": { + "type": "string" + }, + "key": { + "type": "string" + } + } + }, + "ResourceId": { + "type": "object", + "properties": { + "environmentKey": { + "type": "string", + "description": "The environment key", + "example": "environment-key-123abc" + }, + "flagKey": { + "type": "string", + "description": "Deprecated, use key instead", + "deprecated": true + }, + "key": { + "type": "string", + "description": "The key of the flag or segment", + "example": "segment-key-123abc" + }, + "kind": { + "description": "The type of resource, flag or segment", + "example": "segment", + "$ref": "#/components/schemas/ResourceKind" + }, + "projectKey": { + "type": "string", + "description": "The project key", + "example": "project-key-123abc" + } + } + }, + "ResourceKind": { + "type": "string" + }, + "ReviewOutput": { + "type": "object", + "required": [ + "_id", + "kind" + ], + "properties": { + "_id": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "creationDate": { + "$ref": "#/components/schemas/UnixMillis" + }, + "comment": { + "type": "string" + }, + "memberId": { + "type": "string" + }, + "serviceTokenId": { + "type": "string" + } + } + }, + "ReviewResponse": { + "type": "object", + "required": [ + "_id", + "kind" + ], + "properties": { + "_id": { + "type": "string", + "description": "The approval request ID", + "example": "12ab3c45de678910abc12345" + }, + "kind": { + "type": "string", + "description": "The type of review action to take", + "example": "approve", + "enum": [ + "approve", + "decline", + "comment" + ] + }, + "creationDate": { + "description": "Timestamp of when the request was created", + "example": "1653606981113", + "$ref": "#/components/schemas/UnixMillis" + }, + "comment": { + "type": "string", + "description": "A comment describing the approval response", + "example": "Approved!" + }, + "memberId": { + "type": "string", + "description": "ID of account member that reviewed request", + "example": "12ab3c45de678910abc12345" + }, + "serviceTokenId": { + "type": "string", + "description": "ID of account service token that reviewed request", + "example": "12ab3c45de678910abc12345" + } + } + }, + "RoleType": { + "type": "string" + }, + "Rollout": { + "type": "object", + "required": [ + "variations" + ], + "properties": { + "variations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WeightedVariation" + } + }, + "experimentAllocation": { + "$ref": "#/components/schemas/ExperimentAllocationRep" + }, + "seed": { + "type": "integer" + }, + "bucketBy": { + "type": "string" + }, + "contextKind": { + "type": "string" + } + } + }, + "RootResponse": { + "type": "object", + "required": [ + "links" + ], + "properties": { + "links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + } + } + }, + "Rule": { + "type": "object", + "required": [ + "clauses", + "trackEvents" + ], + "properties": { + "_id": { + "type": "string", + "description": "The flag rule ID" + }, + "variation": { + "type": "integer", + "description": "The index of the variation, from the array of variations for this flag" + }, + "rollout": { + "description": "Details on the percentage rollout, if it exists", + "$ref": "#/components/schemas/Rollout" + }, + "clauses": { + "type": "array", + "description": "An array of clauses used for individual targeting based on attributes", + "items": { + "$ref": "#/components/schemas/Clause" + } + }, + "trackEvents": { + "type": "boolean", + "description": "Whether LaunchDarkly tracks events for this rule" + }, + "description": { + "type": "string", + "description": "The rule description" + }, + "ref": { + "type": "string" + } + } + }, + "RuleClause": { + "type": "object", + "properties": { + "attribute": { + "type": "string", + "description": "The attribute the rule applies to, for example, last name or email address" + }, + "op": { + "type": "string", + "description": "The operator to apply to the given attribute", + "enum": [ + "in", + "endsWith", + "startsWith", + "matches", + "contains", + "lessThan", + "lessThanOrEqual", + "greaterThan", + "greaterThanOrEqual", + "before", + "after", + "segmentMatch", + "semVerEqual", + "semVerLessThan", + "semVerGreaterThan" + ] + }, + "negate": { + "type": "boolean", + "description": "Whether the operator should be negated" + } + } + }, + "ScheduleKind": { + "type": "string" + }, + "SdkListRep": { + "type": "object", + "required": [ + "_links", + "sdks" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": {}, + "description": "The location and content type of related resources" + }, + "sdks": { + "type": "array", + "description": "The list of SDK names", + "items": { + "type": "string" + }, + "example": [ + "Android", + "Java", + "Node.js" + ] + } + } + }, + "SdkVersionListRep": { + "type": "object", + "required": [ + "_links", + "sdkVersions" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": {}, + "description": "The location and content type of related resources" + }, + "sdkVersions": { + "type": "array", + "description": "The list of SDK names and versions", + "items": { + "$ref": "#/components/schemas/SdkVersionRep" + }, + "example": [ + { + "sdk": "Android", + "version": "3.1.2" + }, + { + "sdk": "Android", + "version": "3.1.5" + }, + { + "sdk": "C", + "version": "2.4.6" + } + ] + } + } + }, + "SdkVersionRep": { + "type": "object", + "required": [ + "sdk", + "version" + ], + "properties": { + "sdk": { + "type": "string", + "description": "The SDK name, or \"Unknown\"" + }, + "version": { + "type": "string", + "description": "The version number, or \"Unknown\"" + } + } + }, + "SegmentBody": { + "type": "object", + "required": [ + "name", + "key" + ], + "properties": { + "name": { + "type": "string", + "description": "A human-friendly name for the segment", + "example": "Example segment" + }, + "key": { + "type": "string", + "description": "A unique key used to reference the segment", + "example": "segment-key-123abc" + }, + "description": { + "type": "string", + "description": "A description of the segment's purpose", + "example": "Bundle our sample customers together" + }, + "tags": { + "type": "array", + "description": "Tags for the segment", + "items": { + "type": "string" + }, + "example": [ + "testing" + ] + }, + "unbounded": { + "type": "boolean", + "description": "Whether to create a standard segment (false) or a big segment (true). Standard segments include rule-based and smaller list-based segments. Big segments include larger list-based segments and synced segments. Only use a big segment if you need to add more than 15,000 individual targets.", + "example": false + }, + "unboundedContextKind": { + "type": "string", + "description": "For big segments, the targeted context kind.", + "example": "device" + } + } + }, + "SegmentId": { + "type": "string" + }, + "SegmentMetadata": { + "type": "object", + "properties": { + "envId": { + "type": "string" + }, + "segmentId": { + "$ref": "#/components/schemas/SegmentId" + }, + "version": { + "type": "integer" + }, + "includedCount": { + "type": "integer" + }, + "excludedCount": { + "type": "integer" + }, + "lastModified": { + "$ref": "#/components/schemas/UnixMillis" + }, + "deleted": { + "type": "boolean" + } + } + }, + "SegmentTarget": { + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "string" + } + }, + "contextKind": { + "type": "string" + } + } + }, + "SegmentUserList": { + "type": "object", + "properties": { + "add": { + "type": "array", + "items": { + "type": "string" + } + }, + "remove": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "SegmentUserState": { + "type": "object", + "properties": { + "included": { + "$ref": "#/components/schemas/SegmentUserList" + }, + "excluded": { + "$ref": "#/components/schemas/SegmentUserList" + } + } + }, + "Series": { + "type": "object", + "required": [ + "time", + "value" + ], + "properties": { + "time": { + "type": "integer", + "format": "int64", + "description": "The timestamp", + "example": 1676332800000 + }, + "value": { + "type": "number", + "description": "The value for the given timestamp", + "example": 92 + } + } + }, + "SeriesIntervalsRep": { + "type": "object", + "required": [ + "series", + "_links" + ], + "properties": { + "series": { + "type": "array", + "description": "An array of timestamps and values for a given meter", + "items": { + "$ref": "#/components/schemas/Series" + } + }, + "_links": { + "type": "object", + "additionalProperties": {}, + "description": "The location and content type of related resources" + } + } + }, + "SeriesListRep": { + "type": "object", + "required": [ + "_links", + "metadata", + "series" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": {}, + "description": "The location and content type of related resources" + }, + "metadata": { + "type": "array", + "description": "Metadata about each series", + "items": { + "$ref": "#/components/schemas/SeriesMetadataRep" + } + }, + "series": { + "type": "array", + "description": "An array of data points with timestamps. Each element of the array is an object with a 'time' field, whose value is the timestamp, and one or more key fields. If there are multiple key fields, they are labeled '0', '1', and so on, and are explained in the metadata.", + "items": { + "$ref": "#/components/schemas/SeriesTimeSliceRep" + }, + "example": [ + { + "0": 11, + "1": 15, + "time": 1677888000000 + } + ] + } + } + }, + "SeriesMetadataRep": { + "type": "object", + "additionalProperties": {} + }, + "SeriesTimeSliceRep": { + "type": "object", + "additionalProperties": { + "type": "integer" + } + }, + "SlicedResultsRep": { + "type": "object", + "properties": { + "attribute": { + "type": "string", + "description": "An attribute that results are sliced by", + "example": "country" + }, + "attributeValue": { + "type": "string", + "description": "Attribute Value for 'attribute'", + "example": "Canada" + }, + "treatmentResults": { + "type": "array", + "description": "A list of the results for each treatment", + "items": { + "$ref": "#/components/schemas/TreatmentResultRep" + } + } + } + }, + "SourceEnv": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "The key of the source environment to clone from" + }, + "version": { + "type": "integer", + "description": "(Optional) The version number of the source environment to clone from. Used for optimistic locking" + } + } + }, + "StageInput": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The stage name", + "example": "10% rollout on day 1" + }, + "executeConditionsInSequence": { + "type": "boolean", + "description": "Whether to execute the conditions in sequence for the given stage", + "example": true + }, + "conditions": { + "type": "array", + "description": "An array of conditions for the stage", + "items": { + "$ref": "#/components/schemas/ConditionInput" + }, + "example": [ + { + "kind": "schedule", + "scheduleKind": "relative", + "waitDuration": 2, + "waitDurationUnit": "calendarDay" + } + ] + }, + "action": { + "description": "An instructions field containing an array of instructions for the stage. Each object in the array uses the semantic patch format for updating a feature flag.", + "example": "{\"instructions\": [{ \"kind\": \"turnFlagOn\"}]}", + "$ref": "#/components/schemas/ActionInput" + } + } + }, + "StageOutput": { + "type": "object", + "required": [ + "_id", + "conditions", + "action", + "_execution" + ], + "properties": { + "_id": { + "type": "string", + "description": "The ID of this stage", + "example": "12ab3c45de678910abc12345" + }, + "name": { + "type": "string", + "description": "The stage name", + "example": "10% rollout on day 1" + }, + "conditions": { + "type": "array", + "description": "An array of conditions for the stage", + "items": { + "$ref": "#/components/schemas/ConditionOutput" + }, + "example": [ + { + "_execution": { + "status": "completed" + }, + "id": "12ab3c45de678910abc12345", + "kind": "schedule", + "scheduleKind": "relative", + "waitDuration": 2, + "waitDurationUnit": "calendarDay" + } + ] + }, + "action": { + "description": "The type of instruction, and an array of instructions for the stage. Each object in the array uses the semantic patch format for updating a feature flag.", + "example": "{ \"kind\": \"patch\", \"instructions\": [{ \"kind\": \"turnFlagOn\"}] }", + "$ref": "#/components/schemas/ActionOutput" + }, + "_execution": { + "description": "Details on the execution of this stage", + "example": "{ \"status\": \"completed\" }", + "$ref": "#/components/schemas/ExecutionOutput" + } + } + }, + "Statement": { + "type": "object", + "required": [ + "effect" + ], + "properties": { + "resources": { + "type": "array", + "description": "Resource specifier strings", + "items": { + "type": "string" + }, + "example": [ + "proj/*:env/*;qa_*:/flag/*" + ] + }, + "notResources": { + "type": "array", + "description": "Targeted resources are the resources NOT in this list. The resources and notActions fields must be empty to use this field.", + "items": { + "type": "string" + } + }, + "actions": { + "type": "array", + "description": "Actions to perform on a resource", + "items": { + "$ref": "#/components/schemas/ActionSpecifier" + }, + "example": [ + "*" + ] + }, + "notActions": { + "type": "array", + "description": "Targeted actions are the actions NOT in this list. The actions and notResources fields must be empty to use this field.", + "items": { + "$ref": "#/components/schemas/ActionSpecifier" + } + }, + "effect": { + "type": "string", + "description": "Whether this statement should allow or deny actions on the resources.", + "example": "allow", + "enum": [ + "allow", + "deny" + ] + } + } + }, + "StatementPost": { + "type": "object", + "required": [ + "effect" + ], + "properties": { + "resources": { + "type": "array", + "description": "Resource specifier strings", + "items": { + "type": "string" + }, + "example": [ + "proj/*:env/*:flag/*;testing-tag" + ] + }, + "notResources": { + "type": "array", + "description": "Targeted resources are the resources NOT in this list. The resources field must be empty to use this field.", + "items": { + "type": "string" + } + }, + "actions": { + "type": "array", + "description": "Actions to perform on a resource", + "items": { + "$ref": "#/components/schemas/ActionSpecifier" + }, + "example": [ + "*" + ] + }, + "notActions": { + "type": "array", + "description": "Targeted actions are the actions NOT in this list. The actions field must be empty to use this field.", + "items": { + "$ref": "#/components/schemas/ActionSpecifier" + } + }, + "effect": { + "type": "string", + "description": "Whether this statement should allow or deny actions on the resources.", + "example": "allow", + "enum": [ + "allow", + "deny" + ] + } + } + }, + "StatementPostList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StatementPost" + } + }, + "StatisticCollectionRep": { + "type": "object", + "required": [ + "flags", + "_links" + ], + "properties": { + "flags": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StatisticRep" + } + }, + "description": "A map of flag keys to a list of code reference statistics for each code repository in which the flag key appears" + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + } + } + }, + "StatisticRep": { + "type": "object", + "required": [ + "name", + "type", + "sourceLink", + "defaultBranch", + "enabled", + "version", + "hunkCount", + "fileCount", + "_links" + ], + "properties": { + "name": { + "type": "string", + "description": "The repository name", + "example": "LaunchDarkly-Docs" + }, + "type": { + "type": "string", + "description": "The type of repository", + "example": "github", + "enum": [ + "bitbucket", + "custom", + "github", + "gitlab" + ] + }, + "sourceLink": { + "type": "string", + "description": "A URL to access the repository", + "example": "https://github.com/launchdarkly/LaunchDarkly-Docs" + }, + "defaultBranch": { + "type": "string", + "description": "The repository's default branch", + "example": "main" + }, + "enabled": { + "type": "boolean", + "description": "Whether or not a repository is enabled for code reference scanning", + "example": true + }, + "version": { + "type": "integer", + "description": "The version of the repository's saved information", + "example": 3 + }, + "hunkCount": { + "type": "integer", + "description": "The number of code reference hunks in which the flag appears in this repository" + }, + "fileCount": { + "type": "integer", + "description": "The number of files in which the flag appears in this repository" + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + } + } + }, + "StatisticsRoot": { + "type": "object", + "properties": { + "projects": { + "type": "array", + "description": "The location and content type of all projects that have code references", + "items": { + "$ref": "#/components/schemas/Link" + }, + "example": [ + { + "href": "/api/v2/code-refs/statistics/example-project-with-code-refs", + "type": "application/json" + } + ] + }, + "self": { + "description": "The location and content type for accessing this resource", + "example": "{\"href\": \"/api/v2/code-refs/statistics\", \"type\": \"application/json\"}", + "$ref": "#/components/schemas/Link" + } + } + }, + "StatusConflictErrorRep": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string", + "description": "Specific error code encountered", + "example": "optimistic_locking_error" + }, + "message": { + "type": "string", + "description": "Description of the error", + "example": "Conflict. Optimistic lock error. Try again later." + } + } + }, + "StatusServiceUnavailable": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string", + "description": "Specific error code encountered", + "example": "service_unavailable" + }, + "message": { + "type": "string", + "description": "Description of the error", + "example": "Requested service unavailable" + } + } + }, + "StoreIntegrationError": { + "type": "object", + "properties": { + "statusCode": { + "type": "integer" + }, + "message": { + "type": "string" + }, + "timestamp": { + "$ref": "#/components/schemas/UnixMillis" + } + } + }, + "SubjectDataRep": { + "type": "object", + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "name": { + "type": "string", + "description": "The subject's name" + }, + "avatarUrl": { + "type": "string", + "description": "The subject's avatar" + } + } + }, + "TagCollection": { + "type": "object", + "required": [ + "items", + "_links" + ], + "properties": { + "items": { + "type": "array", + "description": "List of tags", + "items": { + "type": "string" + }, + "example": [ + "ops", + "pro" + ] + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "totalCount": { + "type": "integer", + "description": "The total number of tags", + "example": 103 + } + } + }, + "Target": { + "type": "object", + "required": [ + "values", + "variation" + ], + "properties": { + "values": { + "type": "array", + "description": "A list of the keys for targets that will receive this variation because of individual targeting", + "items": { + "type": "string" + } + }, + "variation": { + "type": "integer", + "description": "The index, from the array of variations for this flag, of the variation to serve this list of targets" + }, + "contextKind": { + "type": "string", + "description": "The context kind of the individual target" + } + } + }, + "TargetResourceRep": { + "type": "object", + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "name": { + "type": "string", + "description": "The name of the resource", + "example": "Example flag name" + }, + "resources": { + "type": "array", + "description": "The resource specifier", + "items": { + "type": "string" + }, + "example": [ + "proj/example-project:env/production:flag/example-flag" + ] + } + } + }, + "Team": { + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "A description of the team", + "example": "Description for this team." + }, + "key": { + "type": "string", + "description": "The team key", + "example": "team-key-123abc" + }, + "name": { + "type": "string", + "description": "A human-friendly name for the team", + "example": "Example team" + }, + "_access": { + "description": "Details on the allowed and denied actions for this team", + "$ref": "#/components/schemas/Access" + }, + "_creationDate": { + "description": "Timestamp of when the team was created", + "example": "1648671956143", + "$ref": "#/components/schemas/UnixMillis" + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "parent": { + "href": "/api/v2/teams", + "type": "application/json" + }, + "roles": { + "href": "/api/v2/teams/example-team/roles", + "type": "application/json" + }, + "self": { + "href": "/api/v2/teams/example-team", + "type": "application/json" + } + } + }, + "_lastModified": { + "description": "Timestamp of when the team was most recently updated", + "example": "1648672446072", + "$ref": "#/components/schemas/UnixMillis" + }, + "_version": { + "type": "integer", + "description": "The team version", + "example": 3 + }, + "_idpSynced": { + "type": "boolean", + "description": "Whether the team has been synced with an external identity provider (IdP). Team sync is available to customers on an Enterprise plan.", + "example": true + }, + "roles": { + "description": "Paginated list of the custom roles assigned to this team. Only included if specified in the expand query parameter.", + "$ref": "#/components/schemas/TeamCustomRoles" + }, + "members": { + "description": "Details on the total count of members that belong to the team. Only included if specified in the expand query parameter.", + "$ref": "#/components/schemas/TeamMembers" + }, + "projects": { + "description": "Paginated list of the projects that the team has any write access to. Only included if specified in the expand query parameter.", + "$ref": "#/components/schemas/TeamProjects" + }, + "maintainers": { + "description": "Paginated list of the maintainers assigned to this team. Only included if specified in the expand query parameter.", + "$ref": "#/components/schemas/TeamMaintainers" + } + } + }, + "TeamCustomRole": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "The key of the custom role", + "example": "role-key-123abc" + }, + "name": { + "type": "string", + "description": "The name of the custom role", + "example": "Example role" + }, + "projects": { + "description": "Details on the projects where team members have write privileges on at least one resource type (e.g. flags)", + "$ref": "#/components/schemas/TeamProjects" + }, + "appliedOn": { + "description": "Timestamp of when the custom role was assigned to this team", + "example": "1648672018410", + "$ref": "#/components/schemas/UnixMillis" + } + } + }, + "TeamCustomRoles": { + "type": "object", + "properties": { + "totalCount": { + "type": "integer", + "description": "The number of custom roles assigned to this team", + "example": 1 + }, + "items": { + "type": "array", + "description": "An array of the custom roles that have been assigned to this team", + "items": { + "$ref": "#/components/schemas/TeamCustomRole" + } + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "self": { + "href": "/api/v2/teams/example-team/roles?limit=25", + "type": "application/json" + } + } + } + } + }, + "TeamImportsRep": { + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "An array of details about the members requested to be added to this team", + "items": { + "$ref": "#/components/schemas/MemberImportItem" + } + } + } + }, + "TeamMaintainers": { + "type": "object", + "properties": { + "totalCount": { + "type": "integer", + "description": "The number of maintainers of the team", + "example": 1 + }, + "items": { + "type": "array", + "description": "Details on the members that have been assigned as maintainers of the team", + "items": { + "$ref": "#/components/schemas/MemberSummary" + }, + "example": [ + { + "_id": "569f183514f4432160000007", + "_links": { + "self": { + "href": "/api/v2/members/569f183514f4432160000007", + "type": "application/json" + } + }, + "email": "ariel@acme.com", + "firstName": "Ariel", + "lastName": "Flores", + "role": "reader" + } + ] + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "self": { + "href": "/api/v2/teams/example-team/maintainers?limit=5", + "type": "application/json" + } + } + } + } + }, + "TeamMembers": { + "type": "object", + "properties": { + "totalCount": { + "type": "integer", + "description": "The total count of members that belong to the team", + "example": 15 + } + } + }, + "TeamProjects": { + "type": "object", + "properties": { + "totalCount": { + "type": "integer", + "example": 1 + }, + "items": { + "type": "array", + "description": "Details on each project where team members have write privileges on at least one resource type (e.g. flags)", + "items": { + "$ref": "#/components/schemas/ProjectSummary" + }, + "example": [ + { + "_links": { + "environments": { + "href": "/api/v2/projects/example-project/environments", + "type": "application/json" + }, + "self": { + "href": "/api/v2/projects/example-project", + "type": "application/json" + } + }, + "key": "project-key-123abc", + "name": "Example project" + } + ] + } + } + }, + "Teams": { + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "An array of teams", + "items": { + "$ref": "#/components/schemas/Team" + } + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "self": { + "href": "/api/v2/teams?expand=maintainers%2Cmembers%2Croles%2Cprojects&limit=20", + "type": "application/json" + } + } + }, + "totalCount": { + "type": "integer", + "description": "The number of teams", + "example": 1 + } + } + }, + "TimestampRep": { + "type": "object", + "properties": { + "milliseconds": { + "$ref": "#/components/schemas/UnixMillis" + }, + "seconds": { + "type": "integer", + "format": "int64" + }, + "rfc3339": { + "type": "string" + }, + "simple": { + "type": "string" + } + } + }, + "Token": { + "type": "object", + "required": [ + "_id", + "ownerId", + "memberId", + "creationDate", + "lastModified", + "_links" + ], + "properties": { + "_id": { + "description": "The ID of the access token", + "example": "61095542756dba551110ae21", + "$ref": "#/components/schemas/ObjectId" + }, + "ownerId": { + "description": "The ID of the owner of the account for the access token", + "example": "569f514156e003339cfd3917", + "$ref": "#/components/schemas/ObjectId" + }, + "memberId": { + "description": "The ID of the member who created the access token", + "example": "569f514183f2164430000002", + "$ref": "#/components/schemas/ObjectId" + }, + "_member": { + "description": "Details on the member who created the access token", + "$ref": "#/components/schemas/MemberSummary" + }, + "name": { + "type": "string", + "description": "A human-friendly name for the access token", + "example": "Example reader token" + }, + "description": { + "type": "string", + "description": "A description for the access token", + "example": "A reader token used in testing and examples" + }, + "creationDate": { + "description": "Timestamp of when the access token was created", + "example": "1628001602644", + "$ref": "#/components/schemas/UnixMillis" + }, + "lastModified": { + "description": "Timestamp of the last modification of the access token", + "example": "1628001602644", + "$ref": "#/components/schemas/UnixMillis" + }, + "customRoleIds": { + "type": "array", + "description": "A list of custom role IDs to use as access limits for the access token", + "items": { + "$ref": "#/components/schemas/ObjectId" + }, + "example": [] + }, + "inlineRole": { + "type": "array", + "description": "An array of policy statements, with three attributes: effect, resources, actions. May be used in place of a built-in or custom role.", + "items": { + "$ref": "#/components/schemas/Statement" + }, + "example": [] + }, + "role": { + "type": "string", + "description": "Built-in role for the token", + "example": "reader" + }, + "token": { + "type": "string", + "description": "The token value. When creating or resetting, contains the entire token value. Otherwise, contains the last four characters.", + "example": "1234" + }, + "serviceToken": { + "type": "boolean", + "description": "Whether this is a service token or a personal token", + "example": false + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "parent": { + "href": "/api/v2/tokens", + "type": "application/json" + }, + "self": { + "href": "/api/v2/tokens/61095542756dba551110ae21", + "type": "application/json" + } + } + }, + "defaultApiVersion": { + "type": "integer", + "description": "The default API version for this token", + "example": 20220603 + }, + "lastUsed": { + "description": "Timestamp of when the access token was last used", + "example": "0", + "$ref": "#/components/schemas/UnixMillis" + } + } + }, + "TokenSummary": { + "type": "object", + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "_id": { + "type": "string" + }, + "name": { + "type": "string", + "description": "The name of the token", + "example": "DevOps token" + }, + "ending": { + "type": "string", + "description": "The last few characters of the token", + "example": "2345" + }, + "serviceToken": { + "type": "boolean", + "description": "Whether this is a service token", + "example": false + } + } + }, + "Tokens": { + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "An array of access tokens", + "items": { + "$ref": "#/components/schemas/Token" + } + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "totalCount": { + "type": "integer", + "description": "The number of access tokens returned" + } + } + }, + "TreatmentInput": { + "type": "object", + "required": [ + "name", + "baseline", + "allocationPercent", + "parameters" + ], + "properties": { + "name": { + "type": "string", + "description": "The treatment name", + "example": "Treatment 1" + }, + "baseline": { + "type": "boolean", + "description": "Whether this treatment is the baseline to compare other treatments against", + "example": true + }, + "allocationPercent": { + "type": "string", + "description": "The percentage of traffic allocated to this treatment during the iteration", + "example": "10" + }, + "parameters": { + "type": "array", + "description": "Details on the flag and variation to use for this treatment", + "items": { + "$ref": "#/components/schemas/TreatmentParameterInput" + } + } + } + }, + "TreatmentParameterInput": { + "type": "object", + "required": [ + "flagKey", + "variationId" + ], + "properties": { + "flagKey": { + "type": "string", + "description": "The flag key", + "example": "example-flag-for-experiment" + }, + "variationId": { + "type": "string", + "description": "The ID of the flag variation", + "example": "e432f62b-55f6-49dd-a02f-eb24acf39d05" + } + } + }, + "TreatmentRep": { + "type": "object", + "required": [ + "name", + "allocationPercent" + ], + "properties": { + "_id": { + "type": "string", + "description": "The treatment ID. This is the variation ID from the flag.", + "example": "122c9f3e-da26-4321-ba68-e0fc02eced58" + }, + "name": { + "type": "string", + "description": "The treatment name. This is the variation name from the flag.", + "example": "Treatment 1" + }, + "allocationPercent": { + "type": "string", + "description": "The percentage of traffic allocated to this treatment during the iteration", + "example": "10" + }, + "baseline": { + "type": "boolean", + "description": "Whether this treatment is the baseline to compare other treatments against", + "example": true + }, + "parameters": { + "type": "array", + "description": "Details on the flag and variation used for this treatment", + "items": { + "$ref": "#/components/schemas/ParameterRep" + } + } + } + }, + "TreatmentResultRep": { + "type": "object", + "properties": { + "treatmentId": { + "type": "string", + "description": "The ID of the treatment", + "example": "92b8354e-360e-4d67-8f13-fa6a46ca8077" + }, + "treatmentName": { + "type": "string", + "description": "The name of the treatment", + "example": "variation 25% off" + }, + "mean": { + "type": "number", + "description": "The average value of the variation in this sample. It doesn’t capture the uncertainty in the measurement, so it should not be the only measurement you use to make decisions.", + "example": 0.5432525951557093 + }, + "credibleInterval": { + "description": "The range of the metric's values that you should have 90% confidence in.", + "example": "{\"lower\": 0.4060771673663068, \"upper\": 0.6713222134386467}", + "$ref": "#/components/schemas/CredibleIntervalRep" + }, + "pBest": { + "type": "number", + "description": "The likelihood that this variation has the biggest effect on the primary metric. The variation with the highest probability is likely the best of the variations you're testing", + "example": 0.6083 + }, + "relativeDifferences": { + "type": "array", + "description": "Estimates of the relative difference between this treatment's mean and the mean of each other treatment", + "items": { + "$ref": "#/components/schemas/RelativeDifferenceRep" + }, + "example": [ + { + "fromTreatmentId": "92b8354e-360e-4d67-8f13-fa6a46ca8077", + "lower": -0.13708601934659803, + "upper": 0.42655970355712425 + } + ] + }, + "units": { + "type": "integer", + "format": "int64", + "description": "The number of units exposed to this treatment that have event values, including those that are configured to default to 0", + "example": 76 + }, + "traffic": { + "type": "integer", + "format": "int64", + "description": "The number of units exposed to this treatment.", + "example": 332 + }, + "distribution": { + "description": "The posterior distribution of the mean of the metric in this variation.", + "$ref": "#/components/schemas/Distribution" + } + } + }, + "TreatmentsInput": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TreatmentInput" + } + }, + "TriggerWorkflowCollectionRep": { + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "An array of flag triggers", + "items": { + "$ref": "#/components/schemas/TriggerWorkflowRep" + } + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + } + } + }, + "TriggerWorkflowRep": { + "type": "object", + "properties": { + "_id": { + "description": "The ID of this flag trigger", + "example": "12ab3c45de678910abc12345", + "$ref": "#/components/schemas/FeatureWorkflowId" + }, + "_version": { + "type": "integer", + "description": "The flag trigger version", + "example": 1 + }, + "_creationDate": { + "description": "Timestamp of when the flag trigger was created", + "example": "1654104600000", + "$ref": "#/components/schemas/UnixMillis" + }, + "_maintainerId": { + "type": "string", + "description": "The ID of the flag trigger maintainer", + "example": "12ab3c45de678910abc12345" + }, + "_maintainer": { + "description": "Details on the member who maintains this flag trigger", + "$ref": "#/components/schemas/MemberSummary" + }, + "enabled": { + "type": "boolean", + "description": "Whether the flag trigger is currently enabled", + "example": true + }, + "_integrationKey": { + "type": "string", + "description": "The unique identifier of the integration for your trigger", + "example": "generic-trigger" + }, + "instructions": { + "description": "Details on the action to perform when triggering", + "example": "[ { \"kind\": \"turnFlagOn\" }]", + "$ref": "#/components/schemas/Instructions" + }, + "_lastTriggeredAt": { + "description": "Timestamp of when the trigger was most recently executed", + "example": "1654114600000", + "$ref": "#/components/schemas/UnixMillis" + }, + "_recentTriggerBodies": { + "type": "array", + "description": "Details on recent flag trigger requests.", + "items": { + "$ref": "#/components/schemas/RecentTriggerBody" + } + }, + "_triggerCount": { + "type": "integer", + "description": "Number of times the trigger has been executed", + "example": 3 + }, + "triggerURL": { + "type": "string", + "description": "The unguessable URL for this flag trigger" + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + } + } + }, + "UnauthorizedErrorRep": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string", + "description": "Specific error code encountered", + "example": "unauthorized" + }, + "message": { + "type": "string", + "description": "Description of the error", + "example": "Invalid access token" + } + } + }, + "UnixMillis": { + "type": "integer", + "format": "int64" + }, + "UpsertContextKindPayload": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "The context kind name", + "example": "organization" + }, + "description": { + "type": "string", + "description": "The context kind description", + "example": "An example context kind for organizations" + }, + "hideInTargeting": { + "type": "boolean", + "description": "Alias for archived.", + "example": false + }, + "archived": { + "type": "boolean", + "description": "Whether the context kind is archived. Archived context kinds are unavailable for targeting.", + "example": false + }, + "version": { + "type": "integer", + "description": "The context kind version. If not specified when the context kind is created, defaults to 1.", + "example": 1 + } + } + }, + "UpsertFlagDefaultsPayload": { + "type": "object", + "required": [ + "tags", + "temporary", + "booleanDefaults", + "defaultClientSideAvailability" + ], + "properties": { + "tags": { + "type": "array", + "description": "A list of default tags for each flag", + "items": { + "type": "string" + }, + "example": [ + "tag-1", + "tag-2" + ] + }, + "temporary": { + "type": "boolean", + "description": "Whether the flag should be temporary by default", + "example": true + }, + "booleanDefaults": { + "$ref": "#/components/schemas/BooleanFlagDefaults" + }, + "defaultClientSideAvailability": { + "description": "Which client-side SDK types can use this flag by default.", + "$ref": "#/components/schemas/DefaultClientSideAvailability" + } + } + }, + "UpsertResponseRep": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "The status of the create or update operation", + "example": "success" + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + } + } + }, + "UrlMatcher": { + "type": "object", + "additionalProperties": {} + }, + "UrlMatchers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UrlMatcher" + } + }, + "UrlPost": { + "type": "object", + "properties": { + "kind": { + "type": "string", + "enum": [ + "exact", + "canonical", + "substring", + "regex" + ] + }, + "url": { + "type": "string" + }, + "substring": { + "type": "string" + }, + "pattern": { + "type": "string" + } + } + }, + "User": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "The user key. This is the only mandatory user attribute.", + "example": "user-key-123abc" + }, + "secondary": { + "type": "string", + "description": "If provided, used with the user key to generate a variation in percentage rollouts", + "example": "2398127" + }, + "ip": { + "type": "string", + "description": "The user's IP address", + "example": "10.10.10.10" + }, + "country": { + "type": "string", + "description": "The user's country", + "example": "United States" + }, + "email": { + "type": "string", + "description": "The user's email", + "example": "sandy@example.com" + }, + "firstName": { + "type": "string", + "description": "The user's first name", + "example": "Sandy" + }, + "lastName": { + "type": "string", + "description": "The user's last name", + "example": "Smith" + }, + "avatar": { + "type": "string", + "description": "An absolute URL to an avatar image.", + "example": "http://example.com/avatar.png" + }, + "name": { + "type": "string", + "description": "The user's full name", + "example": "Sandy Smith" + }, + "anonymous": { + "type": "boolean", + "description": "Whether the user is anonymous. If true, this user does not appear on the Contexts list in the LaunchDarkly user interface.", + "example": false + }, + "custom": { + "type": "object", + "additionalProperties": {}, + "description": "Any other custom attributes for this user. Custom attributes contain any other user data that you would like to use to conditionally target your users." + }, + "privateAttrs": { + "type": "array", + "description": "A list of attribute names that are marked as private. You can use these attributes in targeting rules and segments. If you are using a server-side SDK, the SDK will not send the private attribute back to LaunchDarkly. If you are using a client-side SDK, the SDK will send the private attribute back to LaunchDarkly for evaluation. However, the SDK won't send the attribute to LaunchDarkly in events data, LaunchDarkly won't store the private attribute, and the private attribute will not appear on the Contexts list.", + "items": { + "type": "string" + } + } + } + }, + "UserAttributeNamesRep": { + "type": "object", + "properties": { + "private": { + "type": "array", + "description": "private attributes", + "items": { + "type": "string" + }, + "example": [ + "SSN", + "credit_card_number" + ] + }, + "custom": { + "type": "array", + "description": "custom attributes", + "items": { + "type": "string" + }, + "example": [ + "Age", + "FavoriteFood", + "FavoriteColor" + ] + }, + "standard": { + "type": "array", + "description": "standard attributes", + "items": { + "type": "string" + }, + "example": [ + "key", + "ip", + "firstName", + "lastName", + "country", + "anonymous" + ] + } + } + }, + "UserFlagSetting": { + "type": "object", + "required": [ + "_links", + "_value", + "setting" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources.", + "example": { + "sort.order": { + "href": "/api/v2/users/lacuna/production/Abbie_Braun/flags/sort.order", + "type": "application/json" + } + } + }, + "_value": { + "description": "The value of the flag variation that the user receives. If there is no defined default rule, this is null.", + "example": "true" + }, + "setting": { + "description": "Whether the user is explicitly targeted to receive a particular variation. The setting is false if you have turned off a feature flag for a user. It is null if you haven't assigned that user to a specific variation.", + "example": "null" + }, + "reason": { + "description": "Contains information about why that variation was selected.", + "example": "{\"kind\": \"RULE_MATCH\"}", + "$ref": "#/components/schemas/EvaluationReason" + } + } + }, + "UserFlagSettings": { + "type": "object", + "required": [ + "items", + "_links" + ], + "properties": { + "items": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/UserFlagSetting" + }, + "description": "An array of flag settings for the user", + "example": { + "alternate.page": { + "_links": { + "self": { + "href": "/api/v2/users/lacuna/production/Abbie_Braun/flags/alternate.page", + "type": "application/json" + } + }, + "_value": false, + "setting": null + }, + "sort.order": { + "_links": { + "self": { + "href": "/api/v2/users/lacuna/production/Abbie_Braun/flags/sort.order", + "type": "application/json" + } + }, + "_value": true, + "setting": null + } + } + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "self": { + "href": "/api/v2/users/lacuna/production/Abbie_Braun/flags", + "type": "application/json" + } + } + } + } + }, + "UserRecord": { + "type": "object", + "properties": { + "lastPing": { + "type": "string", + "format": "date-time", + "description": "Timestamp of the last time this user was seen", + "example": "2022-06-28T23:21:29.176609596Z" + }, + "environmentId": { + "description": "The environment ID", + "example": "1234a56b7c89d012345e678f", + "$ref": "#/components/schemas/ObjectId" + }, + "ownerId": { + "description": "The ID of the member who is the owner for this account", + "example": "12ab3c45de678910abc12345", + "$ref": "#/components/schemas/ObjectId" + }, + "user": { + "description": "Details on the user", + "$ref": "#/components/schemas/User" + }, + "sortValue": { + "description": "If this record is returned as part of a list, the value used to sort the list. This is only included when the sort query parameter is specified. It is a time, in Unix milliseconds, if the sort is by lastSeen. It is a user key if the sort is by userKey.", + "example": "user-key-123abc" + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "parent": { + "href": "/api/v2/users/my-project/my-environment", + "type": "application/json" + }, + "self": { + "href": "/api/v2/users/my-project/my-environment/my-user", + "type": "application/json" + }, + "settings": { + "href": "/api/v2/users/my-project/my-environment/my-user/flags", + "type": "text/html" + }, + "site": { + "href": "/my-project/my-environment/users/my-user", + "type": "text/html" + } + } + }, + "_access": { + "description": "Details on the allowed and denied actions for this user", + "$ref": "#/components/schemas/Access" + } + } + }, + "UserSegment": { + "type": "object", + "required": [ + "name", + "tags", + "creationDate", + "lastModifiedDate", + "key", + "_links", + "rules", + "version", + "deleted", + "generation" + ], + "properties": { + "name": { + "type": "string", + "description": "A human-friendly name for the segment.", + "example": "Example segment" + }, + "description": { + "type": "string", + "description": "A description of the segment's purpose. Defaults to null and is omitted in the response if not provided.", + "example": "Bundle our sample customers together" + }, + "tags": { + "type": "array", + "description": "Tags for the segment. Defaults to an empty array.", + "items": { + "type": "string" + }, + "example": [ + "testing" + ] + }, + "creationDate": { + "description": "Timestamp of when the segment was created", + "example": "1654104600000", + "$ref": "#/components/schemas/UnixMillis" + }, + "lastModifiedDate": { + "description": "Timestamp of when the segment was last modified", + "example": "1654104600000", + "$ref": "#/components/schemas/UnixMillis" + }, + "key": { + "type": "string", + "description": "A unique key used to reference the segment", + "example": "segment-key-123abc" + }, + "included": { + "type": "array", + "description": "An array of keys for included targets. Included individual targets are always segment members, regardless of segment rules. For list-based segments over 15,000 entries, also called big segments, this array is either empty or omitted.", + "items": { + "type": "string" + }, + "example": [ + "user-key-123abc" + ] + }, + "excluded": { + "type": "array", + "description": "An array of keys for excluded targets. Segment rules bypass individual excluded targets, so they will never be included based on rules. Excluded targets may still be included explicitly. This value is omitted for list-based segments over 15,000 entries, also called big segments.", + "items": { + "type": "string" + }, + "example": [ + "user-key-123abc" + ] + }, + "includedContexts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SegmentTarget" + } + }, + "excludedContexts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SegmentTarget" + } + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + }, + "rules": { + "type": "array", + "description": "An array of the targeting rules for this segment.", + "items": { + "$ref": "#/components/schemas/UserSegmentRule" + }, + "example": [ + { + "_id": "1234a56b7c89d012345e678f", + "clauses": [ + { + "_id": "12ab3c45de678910fab12345", + "attribute": "email", + "negate": false, + "op": "endsWith", + "values": [ + ".edu" + ] + } + ] + } + ] + }, + "version": { + "type": "integer", + "description": "Version of the segment", + "example": 1 + }, + "deleted": { + "type": "boolean", + "description": "Whether the segment has been deleted", + "example": false + }, + "_access": { + "$ref": "#/components/schemas/Access" + }, + "_flags": { + "type": "array", + "description": "A list of flags targeting this segment. Only included when getting a single segment, using the getSegment endpoint.", + "items": { + "$ref": "#/components/schemas/FlagListingRep" + } + }, + "unbounded": { + "type": "boolean", + "description": "Whether this is a standard segment (false) or a big segment (true). Standard segments include rule-based segments and smaller list-based segments. Big segments include larger list-based segments and synced segments. If omitted, the segment is a standard segment.", + "example": false + }, + "unboundedContextKind": { + "type": "string", + "description": "For big segments, the targeted context kind." + }, + "generation": { + "type": "integer", + "description": "For big segments, how many times this segment has been created." + }, + "_unboundedMetadata": { + "description": "Details on the external data store backing this segment. Only applies to big segments.", + "$ref": "#/components/schemas/SegmentMetadata" + }, + "_external": { + "type": "string", + "description": "The external data store backing this segment. Only applies to synced segments.", + "example": "amplitude" + }, + "_externalLink": { + "type": "string", + "description": "The URL for the external data store backing this segment. Only applies to synced segments.", + "example": "https://analytics.amplitude.com/org/1234/cohort/123abc" + }, + "_importInProgress": { + "type": "boolean", + "description": "Whether an import is currently in progress for the specified segment. Only applies to big segments.", + "example": false + } + } + }, + "UserSegmentRule": { + "type": "object", + "required": [ + "clauses" + ], + "properties": { + "_id": { + "type": "string" + }, + "clauses": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Clause" + } + }, + "weight": { + "type": "integer" + }, + "rolloutContextKind": { + "type": "string" + }, + "bucketBy": { + "type": "string" + }, + "description": { + "type": "string" + } + } + }, + "UserSegments": { + "type": "object", + "required": [ + "items", + "_links", + "totalCount" + ], + "properties": { + "items": { + "type": "array", + "description": "An array of segments", + "items": { + "$ref": "#/components/schemas/UserSegment" + } + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + }, + "totalCount": { + "type": "integer", + "description": "The total number of segments" + } + } + }, + "Users": { + "type": "object", + "required": [ + "totalCount", + "items" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "next": { + "href": "/api/v2/user-search/my-project/my-environment?after=1647993600000&limit=20&searchAfter=my-user&sort=userKey", + "type": "application/json" + }, + "self": { + "href": "/api/v2/user-search/my-project/my-environment?after=1647993600000&limit=20&sort=userKey", + "type": "application/json" + } + } + }, + "totalCount": { + "type": "integer", + "description": "The total number of users in the environment", + "example": 245 + }, + "items": { + "type": "array", + "description": "Details on the users", + "items": { + "$ref": "#/components/schemas/UserRecord" + } + } + } + }, + "UsersRep": { + "type": "object", + "required": [ + "totalCount", + "items" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources", + "example": { + "next": { + "href": "/api/v2/users/my-project/my-environment?after=1647993600000&limit=20&searchAfter=my-user", + "type": "application/json" + }, + "self": { + "href": "/api/v2/users/my-project/my-environment?after=1647993600000&limit=20", + "type": "application/json" + } + } + }, + "totalCount": { + "type": "integer", + "description": "The total number of users in the environment", + "example": 245 + }, + "items": { + "type": "array", + "description": "Details on the users", + "items": { + "$ref": "#/components/schemas/UserRecord" + } + } + } + }, + "ValuePut": { + "type": "object", + "properties": { + "setting": { + "description": "The variation value to set for the context. Must match the flag's variation type.", + "example": "existing_variation_value_to_use" + }, + "comment": { + "type": "string", + "description": "Optional comment describing the change", + "example": "make sure this context experiences a specific variation" + } + } + }, + "Variation": { + "type": "object", + "required": [ + "value" + ], + "properties": { + "_id": { + "type": "string", + "description": "The ID of the variation. Leave empty when you are creating a flag." + }, + "value": { + "description": "The value of the variation. For boolean flags, this must be true or false. For multivariate flags, this may be a string, number, or JSON object." + }, + "description": { + "type": "string", + "description": "Description of the variation. Defaults to an empty string, but is omitted from the response if not set." + }, + "name": { + "type": "string", + "description": "A human-friendly name for the variation. Defaults to an empty string, but is omitted from the response if not set." + } + } + }, + "VariationOrRolloutRep": { + "type": "object", + "properties": { + "variation": { + "type": "integer", + "description": "The index of the variation, from the array of variations for this flag" + }, + "rollout": { + "description": "Details on the percentage rollout, if it exists", + "$ref": "#/components/schemas/Rollout" + } + } + }, + "VariationSummary": { + "type": "object", + "required": [ + "rules", + "nullRules", + "targets", + "contextTargets" + ], + "properties": { + "rules": { + "type": "integer" + }, + "nullRules": { + "type": "integer" + }, + "targets": { + "type": "integer" + }, + "contextTargets": { + "type": "integer" + }, + "isFallthrough": { + "type": "boolean" + }, + "isOff": { + "type": "boolean" + }, + "rollout": { + "type": "integer" + }, + "bucketBy": { + "type": "string" + } + } + }, + "VersionsRep": { + "type": "object", + "required": [ + "validVersions", + "latestVersion", + "currentVersion" + ], + "properties": { + "validVersions": { + "type": "array", + "description": "A list of all valid API versions. To learn more about our versioning, read [Versioning](https://apidocs.launchdarkly.com/#section/Overview/Versioning).", + "items": { + "$ref": "#/components/schemas/DateVersion" + } + }, + "latestVersion": { + "description": "The most recently released version of the API", + "example": "20220603", + "$ref": "#/components/schemas/DateVersion" + }, + "currentVersion": { + "description": "The version of the API currently in use. Typically this is the API version specified for your access token. If you add the LD-API-Version: beta header to your request, this will be equal to the latestVersion.", + "example": "20220603", + "$ref": "#/components/schemas/DateVersion" + }, + "beta": { + "type": "boolean", + "description": "Whether the version of the API currently is use is a beta version. This is always true if you add the LD-API-Version: beta header to your request.", + "example": false + } + } + }, + "Webhook": { + "type": "object", + "required": [ + "_links", + "_id", + "url", + "on", + "tags" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + }, + "_id": { + "type": "string", + "description": "The ID of this webhook", + "example": "57be1db38b75bf0772d11384" + }, + "name": { + "type": "string", + "description": "A human-readable name for this webhook", + "example": "Example hook" + }, + "url": { + "type": "string", + "description": "The URL to which LaunchDarkly sends an HTTP POST payload for this webhook", + "example": "http://www.example.com" + }, + "secret": { + "type": "string", + "description": "The secret for this webhook", + "example": "frobozz" + }, + "statements": { + "type": "array", + "description": "Represents a Custom role policy, defining a resource kinds filter the webhook responds to.", + "items": { + "$ref": "#/components/schemas/Statement" + } + }, + "on": { + "type": "boolean", + "description": "Whether or not this webhook is enabled", + "example": true + }, + "tags": { + "type": "array", + "description": "List of tags for this webhook", + "items": { + "type": "string" + }, + "example": [ + "examples" + ] + }, + "_access": { + "description": "Details on the allowed and denied actions for this webhook", + "$ref": "#/components/schemas/Access" + } + } + }, + "Webhooks": { + "type": "object", + "required": [ + "_links", + "items" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + }, + "items": { + "type": "array", + "description": "An array of webhooks", + "items": { + "$ref": "#/components/schemas/Webhook" + } + } + } + }, + "WeightedVariation": { + "type": "object", + "required": [ + "variation", + "weight" + ], + "properties": { + "variation": { + "type": "integer" + }, + "weight": { + "type": "integer" + }, + "_untracked": { + "type": "boolean" + } + } + }, + "WorkflowTemplateMetadata": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WorkflowTemplateParameter" + } + } + } + }, + "WorkflowTemplateOutput": { + "type": "object", + "required": [ + "_id", + "_key", + "_creationDate", + "_ownerId", + "_maintainerId", + "_links" + ], + "properties": { + "_id": { + "type": "string" + }, + "_key": { + "type": "string" + }, + "name": { + "type": "string" + }, + "_creationDate": { + "$ref": "#/components/schemas/UnixMillis" + }, + "_ownerId": { + "type": "string" + }, + "_maintainerId": { + "type": "string" + }, + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + } + }, + "description": { + "type": "string" + }, + "stages": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StageOutput" + } + } + } + }, + "WorkflowTemplateParameter": { + "type": "object", + "properties": { + "_id": { + "description": "The ID of the condition or instruction referenced by this parameter", + "$ref": "#/components/schemas/ObjectId" + }, + "path": { + "type": "string", + "description": "The path of the property to parameterize, relative to its parent condition or instruction" + }, + "default": { + "description": "The default value of the parameter and other relevant metadata", + "$ref": "#/components/schemas/ParameterDefault" + }, + "valid": { + "type": "boolean", + "description": "Whether the default value is valid for the target flag and environment" + } + } + }, + "WorkflowTemplatesListingOutputRep": { + "type": "object", + "required": [ + "items" + ], + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WorkflowTemplateOutput" + } + } + } + }, + "createApprovalRequestRequest": { + "type": "object", + "required": [ + "resourceId", + "description", + "instructions" + ], + "properties": { + "resourceId": { + "type": "string", + "description": "String representation of a resource" + }, + "comment": { + "type": "string", + "description": "Optional comment describing the approval request", + "example": "optional comment" + }, + "description": { + "type": "string", + "description": "A brief description of the changes you're requesting", + "example": "Requesting to update targeting" + }, + "instructions": { + "description": "List of instructions in semantic patch format to be applied to the feature flag. Review the [Update feature flag](/tag/Feature-flags) documentation for details on available instructions.", + "example": "[{\"kind\": \"addUserTargets\", \"values\": [ \"user-key-123abc\"], \"variationId\": \"ce67d625-a8b9-4fb5-a344-ab909d9d4f4d\" }]", + "$ref": "#/components/schemas/Instructions" + }, + "notifyMemberIds": { + "type": "array", + "description": "An array of member IDs. These members are notified to review the approval request.", + "items": { + "type": "string" + }, + "example": [ + "1234a56b7c89d012345e678f" + ] + }, + "notifyTeamKeys": { + "type": "array", + "description": "An array of team keys. The members of these teams are notified to review the approval request.", + "items": { + "type": "string" + }, + "example": [ + "example-reviewer-team" + ] + }, + "integrationConfig": { + "description": "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.", + "$ref": "#/components/schemas/FormVariableConfig" + } + } + }, + "createCopyFlagConfigApprovalRequestRequest": { + "type": "object", + "required": [ + "description", + "source" + ], + "properties": { + "comment": { + "type": "string", + "description": "Optional comment describing the approval request", + "example": "optional comment" + }, + "description": { + "type": "string", + "description": "A brief description of your changes", + "example": "copy flag settings to another environment" + }, + "notifyMemberIds": { + "type": "array", + "description": "An array of member IDs. These members are notified to review the approval request.", + "items": { + "type": "string" + }, + "example": [ + "1234a56b7c89d012345e678f" + ] + }, + "notifyTeamKeys": { + "type": "array", + "description": "An array of team keys. The members of these teams are notified to review the approval request.", + "items": { + "type": "string" + }, + "example": [ + "example-reviewer-team" + ] + }, + "source": { + "description": "The flag to copy", + "$ref": "#/components/schemas/sourceFlag" + }, + "includedActions": { + "type": "array", + "description": "Optional list of the flag changes to copy from the source environment to the target environment. You may include either includedActions or excludedActions, but not both. If neither are included, then all flag changes will be copied.", + "items": { + "type": "string", + "enum": [ + "updateOn", + "updateFallthrough", + "updateOffVariation", + "updateRules", + "updateTargets", + "updatePrerequisites" + ] + }, + "example": [ + "updateOn" + ] + }, + "excludedActions": { + "type": "array", + "description": "Optional list of the flag changes NOT to copy from the source environment to the target environment. You may include either includedActions or excludedActions, but not both. If neither are included, then all flag changes will be copied.", + "items": { + "type": "string", + "enum": [ + "updateOn", + "updateFallthrough", + "updateOffVariation", + "updateRules", + "updateTargets", + "updatePrerequisites" + ] + }, + "example": [ + "updateOn" + ] + } + } + }, + "createFlagConfigApprovalRequestRequest": { + "type": "object", + "required": [ + "description", + "instructions" + ], + "properties": { + "comment": { + "type": "string", + "description": "Optional comment describing the approval request", + "example": "optional comment" + }, + "description": { + "type": "string", + "description": "A brief description of the changes you're requesting", + "example": "Requesting to update targeting" + }, + "instructions": { + "description": "List of instructions in semantic patch format to be applied to the feature flag. Review the [Update feature flag](/tag/Feature-flags) documentation for details on available instructions.", + "example": "[{\"kind\": \"addTargets\", \"values\": [ \"context-key-123abc\"], \"variationId\": \"ce67d625-a8b9-4fb5-a344-ab909d9d4f4d\" }]", + "$ref": "#/components/schemas/Instructions" + }, + "notifyMemberIds": { + "type": "array", + "description": "An array of member IDs. These members are notified to review the approval request.", + "items": { + "type": "string" + }, + "example": [ + "1234a56b7c89d012345e678f" + ] + }, + "notifyTeamKeys": { + "type": "array", + "description": "An array of team keys. The members of these teams are notified to review the approval request.", + "items": { + "type": "string" + }, + "example": [ + "example-reviewer-team" + ] + }, + "executionDate": { + "description": "Timestamp for when instructions will be executed", + "example": "1653926400000", + "$ref": "#/components/schemas/UnixMillis" + }, + "operatingOnId": { + "type": "string", + "description": "The ID of a scheduled change. Include this if your instructions include editing or deleting a scheduled change.", + "example": "6297ed79dee7dc14e1f9a80c" + }, + "integrationConfig": { + "description": "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.", + "$ref": "#/components/schemas/FormVariableConfig" + } + } + }, + "customProperty": { + "type": "object", + "required": [ + "name", + "value" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the custom property of this type.", + "example": "Jira issues" + }, + "value": { + "type": "array", + "description": "An array of values for the custom property data to associate with this flag.", + "items": { + "type": "string" + }, + "example": [ + "is-123", + "is-456" + ] + } + } + }, + "flagDefaultsRep": { + "type": "object", + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + }, + "key": { + "type": "string", + "description": "A unique key for the flag default" + }, + "tags": { + "type": "array", + "description": "A list of default tags for each flag", + "items": { + "type": "string" + }, + "example": [ + "tag-1", + "tag-2" + ] + }, + "temporary": { + "type": "boolean", + "description": "Whether the flag should be temporary by default", + "example": true + }, + "defaultClientSideAvailability": { + "description": "Which client-side SDK types can use this flag by default. Set usingMobileKey to make the flag available for mobile SDKs. Set usingEnvironmentId to make the flag available for client-side SDKs.", + "example": "{\"usingMobileKey\": true, \"usingEnvironmentId\": false}", + "$ref": "#/components/schemas/ClientSideAvailability" + }, + "booleanDefaults": { + "description": "Defaults for boolean flags within this project", + "$ref": "#/components/schemas/BooleanDefaults" + } + } + }, + "flagLinkPost": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "The flag link key", + "example": "flag-link-key-123abc" + }, + "integrationKey": { + "type": "string", + "description": "The integration key for an integration whose manifest.json includes the flagLink capability, if this is a flag link for an existing integration. Do not include for URL flag links." + }, + "timestamp": { + "description": "The time, in Unix milliseconds, to mark this flag link as associated with the external URL. If omitted, defaults to the creation time of this flag link.", + "$ref": "#/components/schemas/UnixMillis" + }, + "deepLink": { + "type": "string", + "description": "The URL for the external resource you are linking the flag to", + "example": "https://example.com/archives/123123123" + }, + "title": { + "type": "string", + "description": "The title of the flag link", + "example": "Example link title" + }, + "description": { + "type": "string", + "description": "The description of the flag link", + "example": "Example link description" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "The metadata required by this integration in order to create a flag link, if this is a flag link for an existing integration. Defined in the integration's manifest.json file under flagLink." + } + } + }, + "flagSempatch": { + "type": "object", + "required": [ + "instructions" + ], + "properties": { + "instructions": { + "description": "Semantic patch instructions. The same ones that are valid for flags are valid here.", + "$ref": "#/components/schemas/Instructions" + }, + "comment": { + "type": "string" + } + } + }, + "followersPerFlag": { + "type": "object", + "properties": { + "flagKey": { + "type": "string", + "description": "The flag key", + "example": "example-flag-key" + }, + "followers": { + "type": "array", + "description": "A list of members who are following this flag", + "items": { + "$ref": "#/components/schemas/FollowFlagMember" + } + } + } + }, + "instructionUserRequest": { + "type": "object", + "required": [ + "kind", + "flagKey", + "variationId" + ], + "properties": { + "kind": { + "type": "string", + "description": "The type of change to make to the removal date for this user from individual targeting for this flag.", + "example": "addExpireUserTargetDate", + "enum": [ + "addExpireUserTargetDate", + "updateExpireUserTargetDate", + "removeExpireUserTargetDate" + ] + }, + "flagKey": { + "type": "string", + "description": "The flag key", + "example": "sample-flag-key" + }, + "variationId": { + "type": "string", + "description": "ID of a variation on the flag", + "example": "ce12d345-a1b2-4fb5-a123-ab123d4d5f5d" + }, + "value": { + "type": "integer", + "description": "The time, in Unix milliseconds, when LaunchDarkly should remove the user from individual targeting for this flag. Required if kind is addExpireUserTargetDate or updateExpireUserTargetDate.", + "example": 1653469200000 + }, + "version": { + "type": "integer", + "description": "The version of the expiring user target to update. Optional and only used if kind is updateExpireUserTargetDate. If included, update will fail if version doesn't match current version of the expiring user target.", + "example": 1 + } + } + }, + "ipList": { + "type": "object", + "required": [ + "addresses", + "outboundAddresses" + ], + "properties": { + "addresses": { + "type": "array", + "description": "A list of the IP addresses LaunchDarkly's service uses", + "items": { + "type": "string" + }, + "example": [ + "104.156.80.0/20", + "151.101.0.0/16" + ] + }, + "outboundAddresses": { + "type": "array", + "description": "A list of the IP addresses outgoing webhook notifications use", + "items": { + "type": "string" + }, + "example": [ + "52.21.152.96/32" + ] + } + } + }, + "membersPatchInput": { + "type": "object", + "required": [ + "instructions" + ], + "properties": { + "comment": { + "type": "string", + "description": "Optional comment describing the update", + "example": "Optional comment about the update" + }, + "instructions": { + "description": "The instructions to perform when updating. This should be an array with objects that look like {\"kind\": \"update_action\"}. Some instructions also require additional parameters as part of this object.", + "example": "[ { \"kind\": \"replaceMemberRoles\", \"value\": \"reader\" } ]", + "$ref": "#/components/schemas/Instructions" + } + } + }, + "oauthClientPost": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of your new LaunchDarkly OAuth 2.0 client." + }, + "redirectUri": { + "type": "string", + "description": "The redirect URI for your new OAuth 2.0 application. This should be an absolute URL conforming with the standard HTTPS protocol." + }, + "description": { + "type": "string", + "description": "Description of your OAuth 2.0 client." + } + } + }, + "patchFlagsRequest": { + "type": "object", + "required": [ + "instructions" + ], + "properties": { + "comment": { + "type": "string", + "description": "Optional comment describing the change", + "example": "optional comment" + }, + "instructions": { + "type": "array", + "description": "The instructions to perform when updating", + "items": { + "$ref": "#/components/schemas/Instruction" + }, + "example": [ + { + "kind": "addExpireUserTargetDate", + "userKey": "sandy", + "value": 1686412800000, + "variationId": "ce12d345-a1b2-4fb5-a123-ab123d4d5f5d" + } + ] + } + } + }, + "patchSegmentExpiringTargetInputRep": { + "type": "object", + "required": [ + "instructions" + ], + "properties": { + "comment": { + "type": "string", + "description": "Optional description of changes", + "example": "optional comment" + }, + "instructions": { + "type": "array", + "description": "Semantic patch instructions for the desired changes to the resource", + "items": { + "$ref": "#/components/schemas/patchSegmentExpiringTargetInstruction" + }, + "example": [ + { + "contextKey": "user@email.com", + "contextKind": "user", + "kind": "updateExpiringTarget", + "targetType": "included", + "value": 1587582000000, + "version": 0 + } + ] + } + } + }, + "patchSegmentExpiringTargetInstruction": { + "type": "object", + "required": [ + "kind", + "contextKey", + "contextKind", + "targetType" + ], + "properties": { + "kind": { + "type": "string", + "description": "The type of change to make to the context's removal date from this segment", + "example": "addExpiringTarget", + "enum": [ + "addExpiringTarget", + "updateExpiringTarget", + "removeExpiringTarget" + ] + }, + "contextKey": { + "type": "string", + "description": "A unique key used to represent the context" + }, + "contextKind": { + "type": "string", + "description": "The kind of context", + "example": "user" + }, + "targetType": { + "type": "string", + "description": "The segment's target type", + "enum": [ + "included", + "excluded" + ] + }, + "value": { + "type": "integer", + "description": "The time, in Unix milliseconds, when the context should be removed from this segment. Required if kind is addExpiringTarget or updateExpiringTarget.", + "example": 1653469200000 + }, + "version": { + "type": "integer", + "description": "The version of the expiring target to update. Optional and only used if kind is updateExpiringTarget. If included, update will fail if version doesn't match current version of the expiring target.", + "example": 1 + } + } + }, + "patchSegmentInstruction": { + "type": "object", + "required": [ + "kind", + "userKey", + "targetType" + ], + "properties": { + "kind": { + "type": "string", + "description": "The type of change to make to the user's removal date from this segment", + "example": "addExpireUserTargetDate", + "enum": [ + "addExpireUserTargetDate", + "updateExpireUserTargetDate", + "removeExpireUserTargetDate" + ] + }, + "userKey": { + "type": "string", + "description": "A unique key used to represent the user" + }, + "targetType": { + "type": "string", + "description": "The segment's target type", + "enum": [ + "included", + "excluded" + ] + }, + "value": { + "type": "integer", + "description": "The time, in Unix milliseconds, when the user should be removed from this segment. Required if kind is addExpireUserTargetDate or updateExpireUserTargetDate.", + "example": 1653469200000 + }, + "version": { + "type": "integer", + "description": "The version of the segment to update. Required if kind is updateExpireUserTargetDate.", + "example": 1 + } + } + }, + "patchSegmentRequest": { + "type": "object", + "required": [ + "instructions" + ], + "properties": { + "comment": { + "type": "string", + "description": "Optional description of changes", + "example": "optional comment" + }, + "instructions": { + "type": "array", + "description": "Semantic patch instructions for the desired changes to the resource", + "items": { + "$ref": "#/components/schemas/patchSegmentInstruction" + }, + "example": [ + { + "contextKey": "contextKey", + "contextKind": "user", + "kind": "updateExpiringTarget", + "targetType": "included", + "value": 1587582000000, + "version": 0 + } + ] + } + } + }, + "patchUsersRequest": { + "type": "object", + "required": [ + "instructions" + ], + "properties": { + "comment": { + "type": "string", + "description": "Optional comment describing the change", + "example": "optional comment" + }, + "instructions": { + "type": "array", + "description": "The instructions to perform when updating", + "items": { + "$ref": "#/components/schemas/instructionUserRequest" + } + } + } + }, + "permissionGrantInput": { + "type": "object", + "properties": { + "actionSet": { + "type": "string", + "description": "A group of related actions to allow. Specify either actionSet or actions. Use maintainTeam to add team maintainers.", + "example": "maintainTeam", + "enum": [ + "maintainTeam" + ] + }, + "actions": { + "type": "array", + "description": "A list of actions to allow. Specify either actionSet or actions. To learn more, read [Role actions](https://docs.launchdarkly.com/home/members/role-actions).", + "items": { + "type": "string" + }, + "example": [ + "updateTeamMembers" + ] + }, + "memberIDs": { + "type": "array", + "description": "A list of member IDs who receive the permission grant.", + "items": { + "type": "string" + }, + "example": [ + "12ab3c45de678910fgh12345" + ] + } + } + }, + "postApprovalRequestApplyRequest": { + "type": "object", + "properties": { + "comment": { + "type": "string", + "description": "Optional comment about the approval request", + "example": "Looks good, thanks for updating" + } + } + }, + "postApprovalRequestReviewRequest": { + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "The type of review for this approval request", + "example": "approve", + "enum": [ + "approve", + "comment", + "decline" + ] + }, + "comment": { + "type": "string", + "description": "Optional comment about the approval request", + "example": "Looks good, thanks for updating" + } + } + }, + "putBranch": { + "type": "object", + "required": [ + "name", + "head", + "syncTime" + ], + "properties": { + "name": { + "type": "string", + "description": "The branch name", + "example": "main" + }, + "head": { + "type": "string", + "description": "An ID representing the branch HEAD. For example, a commit SHA.", + "example": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3" + }, + "updateSequenceId": { + "type": "integer", + "format": "int64", + "description": "An optional ID used to prevent older data from overwriting newer data. If no sequence ID is included, the newly submitted data will always be saved.", + "example": 25 + }, + "syncTime": { + "description": "A timestamp indicating when the branch was last synced", + "example": "1636558831870", + "$ref": "#/components/schemas/UnixMillis" + }, + "references": { + "type": "array", + "description": "An array of flag references found on the branch", + "items": { + "$ref": "#/components/schemas/ReferenceRep" + } + }, + "commitTime": { + "description": "A timestamp of the current commit", + "example": "1636558831870", + "$ref": "#/components/schemas/UnixMillis" + } + } + }, + "repositoryPost": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "The repository name", + "example": "LaunchDarkly-Docs" + }, + "sourceLink": { + "type": "string", + "description": "A URL to access the repository", + "example": "https://github.com/launchdarkly/LaunchDarkly-Docs" + }, + "commitUrlTemplate": { + "type": "string", + "description": "A template for constructing a valid URL to view the commit", + "example": "https://github.com/launchdarkly/LaunchDarkly-Docs/commit/${sha}" + }, + "hunkUrlTemplate": { + "type": "string", + "description": "A template for constructing a valid URL to view the hunk", + "example": "https://github.com/launchdarkly/LaunchDarkly-Docs/blob/${sha}/${filePath}#L${lineNumber}" + }, + "type": { + "type": "string", + "description": "The type of repository. If not specified, the default value is custom.", + "example": "github", + "enum": [ + "bitbucket", + "custom", + "github", + "gitlab" + ] + }, + "defaultBranch": { + "type": "string", + "description": "The repository's default branch. If not specified, the default value is main.", + "example": "main" + } + } + }, + "sourceFlag": { + "type": "object", + "required": [ + "key" + ], + "properties": { + "key": { + "type": "string", + "description": "The environment key for the source environment", + "example": "environment-key-123abc" + }, + "version": { + "type": "integer", + "description": "The version of the source flag from which to copy", + "example": 1 + } + } + }, + "subscriptionPost": { + "type": "object", + "required": [ + "name", + "config" + ], + "properties": { + "name": { + "type": "string", + "description": "A human-friendly name for your audit log subscription.", + "example": "Example audit log subscription." + }, + "statements": { + "description": "The set of resources you wish to subscribe to audit log notifications for.", + "$ref": "#/components/schemas/StatementPostList" + }, + "on": { + "type": "boolean", + "description": "Whether or not you want your subscription to actively send events.", + "example": false + }, + "tags": { + "type": "array", + "description": "An array of tags for this subscription.", + "items": { + "type": "string" + }, + "example": [ + "testing-tag" + ] + }, + "config": { + "type": "object", + "additionalProperties": {}, + "description": "The unique set of fields required to configure an audit log subscription integration of this type. Refer to the formVariables field in the corresponding manifest.json at https://github.com/launchdarkly/integration-framework/tree/main/integrations for a full list of fields for the integration you wish to configure.", + "example": { + "optional": "an optional property", + "required": "the required property", + "url": "https://example.com" + } + }, + "url": { + "type": "string", + "description": "Slack webhook receiver URL. Only necessary for legacy Slack webhook integrations." + }, + "apiKey": { + "type": "string", + "description": "Datadog API key. Only necessary for legacy Datadog webhook integrations." + } + } + }, + "teamPatchInput": { + "type": "object", + "required": [ + "instructions" + ], + "properties": { + "comment": { + "type": "string", + "description": "Optional comment describing the update", + "example": "Optional comment about the update" + }, + "instructions": { + "description": "The instructions to perform when updating. This should be an array with objects that look like {\"kind\": \"update_action\"}. Some instructions also require additional parameters as part of this object.", + "example": "[ { \"kind\": \"updateDescription\", \"value\": \"New description for the team\" } ]", + "$ref": "#/components/schemas/Instructions" + } + } + }, + "teamPostInput": { + "type": "object", + "required": [ + "key", + "name" + ], + "properties": { + "customRoleKeys": { + "type": "array", + "description": "List of custom role keys the team will access", + "items": { + "type": "string" + }, + "example": [ + "example-role1", + "example-role2" + ] + }, + "description": { + "type": "string", + "description": "A description of the team", + "example": "An example team" + }, + "key": { + "type": "string", + "description": "The team key", + "example": "team-key-123abc" + }, + "memberIDs": { + "type": "array", + "description": "A list of member IDs who belong to the team", + "items": { + "type": "string" + }, + "example": [ + "12ab3c45de678910fgh12345" + ] + }, + "name": { + "type": "string", + "description": "A human-friendly name for the team", + "example": "Example team" + }, + "permissionGrants": { + "type": "array", + "description": "A list of permission grants. Permission grants allow access to a specific action, without having to create or update a custom role.", + "items": { + "$ref": "#/components/schemas/permissionGrantInput" + } + } + } + }, + "teamsPatchInput": { + "type": "object", + "required": [ + "instructions" + ], + "properties": { + "comment": { + "type": "string", + "description": "Optional comment describing the update", + "example": "Optional comment about the update" + }, + "instructions": { + "description": "The instructions to perform when updating. This should be an array with objects that look like {\"kind\": \"update_action\"}. Some instructions also require additional parameters as part of this object.", + "example": "[ { \"kind\": \"updateDescription\", \"value\": \"New description for the team\" } ]", + "$ref": "#/components/schemas/Instructions" + } + } + }, + "triggerPost": { + "type": "object", + "required": [ + "integrationKey" + ], + "properties": { + "comment": { + "type": "string", + "description": "Optional comment describing the trigger", + "example": "example comment" + }, + "instructions": { + "type": "array", + "description": "The action to perform when triggering. This should be an array with a single object that looks like {\"kind\": \"flag_action\"}. Supported flag actions are turnFlagOn and turnFlagOff.", + "items": { + "$ref": "#/components/schemas/Instruction" + }, + "example": [ + { + "kind": "turnFlagOn" + } + ] + }, + "integrationKey": { + "type": "string", + "description": "The unique identifier of the integration for your trigger. Use generic-trigger for integrations not explicitly supported.", + "example": "generic-trigger" + } + } + }, + "upsertPayloadRep": { + "type": "object", + "required": [ + "tags", + "temporary", + "booleanDefaults", + "defaultClientSideAvailability" + ], + "properties": { + "_links": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Link" + }, + "description": "The location and content type of related resources" + }, + "tags": { + "type": "array", + "description": "A list of default tags for each flag", + "items": { + "type": "string" + }, + "example": [ + "tag-1", + "tag-2" + ] + }, + "temporary": { + "type": "boolean", + "description": "Whether the flag should be temporary by default", + "example": true + }, + "booleanDefaults": { + "$ref": "#/components/schemas/BooleanFlagDefaults" + }, + "defaultClientSideAvailability": { + "description": "Which client-side SDK types can use this flag by default.", + "$ref": "#/components/schemas/DefaultClientSideAvailability" + } + } + }, + "webhookPost": { + "type": "object", + "required": [ + "url", + "sign", + "on" + ], + "properties": { + "name": { + "type": "string", + "description": "A human-readable name for your webhook", + "example": "Example hook" + }, + "url": { + "type": "string", + "description": "The URL of the remote webhook", + "example": "http://www.example.com" + }, + "secret": { + "type": "string", + "description": "If sign is true, and the secret attribute is omitted, LaunchDarkly automatically generates a secret for you.", + "example": "frobozz" + }, + "statements": { + "description": "Represents a Custom role policy, defining a resource kinds filter the webhook should respond to.", + "$ref": "#/components/schemas/StatementPostList" + }, + "sign": { + "type": "boolean", + "description": "If sign is false, the webhook does not include a signature header, and the secret can be omitted.", + "example": true + }, + "on": { + "type": "boolean", + "description": "Whether or not this webhook is enabled.", + "example": true + }, + "tags": { + "type": "array", + "description": "List of tags for this webhook", + "items": { + "type": "string" + }, + "example": [] + } + } + } + }, + "securitySchemes": { + "ApiKey": { + "type": "apiKey", + "in": "header", + "name": "Authorization" + } + } + } +} \ No newline at end of file diff --git a/ld-teams-openapi.json b/ld-teams-openapi.json deleted file mode 100644 index 2ab56792..00000000 --- a/ld-teams-openapi.json +++ /dev/null @@ -1,1812 +0,0 @@ -{ - "openapi": "3.0.3", - "info": { - "title": "LaunchDarkly REST API", - "description": "# Overview\n\n## Authentication\n\nLaunchDarkly's REST API uses the HTTPS protocol with a minimum TLS version of 1.2.\n\nAll REST API resources are authenticated with either [personal or service access tokens](https://docs.launchdarkly.com/home/account-security/api-access-tokens), or session cookies. Other authentication mechanisms are not supported. You can manage personal access tokens on your [**Account settings**](https://app.launchdarkly.com/settings/tokens) page.\n\nLaunchDarkly also has SDK keys, mobile keys, and client-side IDs that are used by our server-side SDKs, mobile SDKs, and JavaScript-based SDKs, respectively. **These keys cannot be used to access our REST API**. These keys are environment-specific, and can only perform read-only operations such as fetching feature flag settings.\n\n| Auth mechanism | Allowed resources | Use cases |\n| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -------------------------------------------------- |\n| [Personal or service access tokens](https://docs.launchdarkly.com/home/account-security/api-access-tokens) | Can be customized on a per-token basis | Building scripts, custom integrations, data export. |\n| SDK keys | Can only access read-only resources specific to server-side SDKs. Restricted to a single environment. | Server-side SDKs |\n| Mobile keys | Can only access read-only resources specific to mobile SDKs, and only for flags marked available to mobile keys. Restricted to a single environment. | Mobile SDKs |\n| Client-side ID | Can only access read-only resources specific to JavaScript-based client-side SDKs, and only for flags marked available to client-side. Restricted to a single environment. | Client-side JavaScript |\n\n> #### Keep your access tokens and SDK keys private\n>\n> Access tokens should _never_ be exposed in untrusted contexts. Never put an access token in client-side JavaScript, or embed it in a mobile application. LaunchDarkly has special mobile keys that you can embed in mobile apps. If you accidentally expose an access token or SDK key, you can reset it from your [**Account settings**](https://app.launchdarkly.com/settings/tokens) page.\n>\n> The client-side ID is safe to embed in untrusted contexts. It's designed for use in client-side JavaScript.\n\n### Authentication using request header\n\nThe preferred way to authenticate with the API is by adding an `Authorization` header containing your access token to your requests. The value of the `Authorization` header must be your access token.\n\nManage personal access tokens from the [**Account settings**](https://app.launchdarkly.com/settings/tokens) page.\n\n### Authentication using session cookie\n\nFor testing purposes, you can make API calls directly from your web browser. If you are logged in to the LaunchDarkly application, the API will use your existing session to authenticate calls.\n\nIf you have a [role](https://docs.launchdarkly.com/home/team/built-in-roles) other than Admin, or have a [custom role](https://docs.launchdarkly.com/home/team/custom-roles) defined, you may not have permission to perform some API calls. You will receive a `401` response code in that case.\n\n> ### Modifying the Origin header causes an error\n>\n> LaunchDarkly validates that the Origin header for any API request authenticated by a session cookie matches the expected Origin header. The expected Origin header is `https://app.launchdarkly.com`.\n>\n> If the Origin header does not match what's expected, LaunchDarkly returns an error. This error can prevent the LaunchDarkly app from working correctly.\n>\n> Any browser extension that intentionally changes the Origin header can cause this problem. For example, the `Allow-Control-Allow-Origin: *` Chrome extension changes the Origin header to `http://evil.com` and causes the app to fail.\n>\n> To prevent this error, do not modify your Origin header.\n>\n> LaunchDarkly does not require origin matching when authenticating with an access token, so this issue does not affect normal API usage.\n\n## Representations\n\nAll resources expect and return JSON response bodies. Error responses also send a JSON body. To learn more about the error format of the API, read [Errors](/#section/Overview/Errors).\n\nIn practice this means that you always get a response with a `Content-Type` header set to `application/json`.\n\nIn addition, request bodies for `PATCH`, `POST`, and `PUT` requests must be encoded as JSON with a `Content-Type` header set to `application/json`.\n\n### Summary and detailed representations\n\nWhen you fetch a list of resources, the response includes only the most important attributes of each resource. This is a _summary representation_ of the resource. When you fetch an individual resource, such as a single feature flag, you receive a _detailed representation_ of the resource.\n\nThe best way to find a detailed representation is to follow links. Every summary representation includes a link to its detailed representation.\n\n### Expanding responses\n\nSometimes the detailed representation of a resource does not include all of the attributes of the resource by default. If this is the case, the request method will clearly document this and describe which attributes you can include in an expanded response.\n\nTo include the additional attributes, append the `expand` request parameter to your request and add a comma-separated list of the attributes to include. For example, when you append `?expand=members,roles` to the [Get team](/tag/Teams#operation/getTeam) endpoint, the expanded response includes both of these attributes.\n\n### Links and addressability\n\nThe best way to navigate the API is by following links. These are attributes in representations that link to other resources. The API always uses the same format for links:\n\n- Links to other resources within the API are encapsulated in a `_links` object\n- If the resource has a corresponding link to HTML content on the site, it is stored in a special `_site` link\n\nEach link has two attributes:\n\n- An `href`, which contains the URL\n- A `type`, which describes the content type\n\nFor example, a feature resource might return the following:\n\n```json\n{\n \"_links\": {\n \"parent\": {\n \"href\": \"/api/features\",\n \"type\": \"application/json\"\n },\n \"self\": {\n \"href\": \"/api/features/sort.order\",\n \"type\": \"application/json\"\n }\n },\n \"_site\": {\n \"href\": \"/features/sort.order\",\n \"type\": \"text/html\"\n }\n}\n```\n\nFrom this, you can navigate to the parent collection of features by following the `parent` link, or navigate to the site page for the feature by following the `_site` link.\n\nCollections are always represented as a JSON object with an `items` attribute containing an array of representations. Like all other representations, collections have `_links` defined at the top level.\n\nPaginated collections include `first`, `last`, `next`, and `prev` links containing a URL with the respective set of elements in the collection.\n\n## Updates\n\nResources that accept partial updates use the `PATCH` verb. Most resources support the [JSON patch](/reference#updates-using-json-patch) format. Some resources also support the [JSON merge patch](/reference#updates-using-json-merge-patch) format, and some resources support the [semantic patch](/reference#updates-using-semantic-patch) format, which is a way to specify the modifications to perform as a set of executable instructions. Each resource supports optional [comments](/reference#updates-with-comments) that you can submit with updates. Comments appear in outgoing webhooks, the audit log, and other integrations.\n\nWhen a resource supports both JSON patch and semantic patch, we document both in the request method. However, the specific request body fields and descriptions included in our documentation only match one type of patch or the other.\n\n### Updates using JSON patch\n\n[JSON patch](https://datatracker.ietf.org/doc/html/rfc6902) is a way to specify the modifications to perform on a resource. JSON patch uses paths and a limited set of operations to describe how to transform the current state of the resource into a new state. JSON patch documents are always arrays, where each element contains an operation, a path to the field to update, and the new value.\n\nFor example, in this feature flag representation:\n\n```json\n{\n \"name\": \"New recommendations engine\",\n \"key\": \"engine.enable\",\n \"description\": \"This is the description\",\n ...\n}\n```\nYou can change the feature flag's description with the following patch document:\n\n```json\n[{ \"op\": \"replace\", \"path\": \"/description\", \"value\": \"This is the new description\" }]\n```\n\nYou can specify multiple modifications to perform in a single request. You can also test that certain preconditions are met before applying the patch:\n\n```json\n[\n { \"op\": \"test\", \"path\": \"/version\", \"value\": 10 },\n { \"op\": \"replace\", \"path\": \"/description\", \"value\": \"The new description\" }\n]\n```\n\nThe above patch request tests whether the feature flag's `version` is `10`, and if so, changes the feature flag's description.\n\nAttributes that are not editable, such as a resource's `_links`, have names that start with an underscore.\n\n### Updates using JSON merge patch\n\n[JSON merge patch](https://datatracker.ietf.org/doc/html/rfc7386) is another format for specifying the modifications to perform on a resource. JSON merge patch is less expressive than JSON patch. However, in many cases it is simpler to construct a merge patch document. For example, you can change a feature flag's description with the following merge patch document:\n\n```json\n{\n \"description\": \"New flag description\"\n}\n```\n\n### Updates using semantic patch\n\nSome resources support the semantic patch format. A semantic patch is a way to specify the modifications to perform on a resource as a set of executable instructions.\n\nSemantic patch allows you to be explicit about intent using precise, custom instructions. In many cases, you can define semantic patch instructions independently of the current state of the resource. This can be useful when defining a change that may be applied at a future date.\n\nTo make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header.\n\nHere's how:\n\n```\nContent-Type: application/json; domain-model=launchdarkly.semanticpatch\n```\n\nIf you call a semantic patch resource without this header, you will receive a `400` response because your semantic patch will be interpreted as a JSON patch.\n\nThe body of a semantic patch request takes the following properties:\n\n* `comment` (string): (Optional) A description of the update.\n* `environmentKey` (string): (Required for some resources only) The environment key.\n* `instructions` (array): (Required) A list of actions the update should perform. Each action in the list must be an object with a `kind` property that indicates the instruction. If the instruction requires parameters, you must include those parameters as additional fields in the object. The documentation for each resource that supports semantic patch includes the available instructions and any additional parameters.\n\nFor example:\n\n```json\n{\n \"comment\": \"optional comment\",\n \"instructions\": [ {\"kind\": \"turnFlagOn\"} ]\n}\n```\n\nIf any instruction in the patch encounters an error, the endpoint returns an error and will not change the resource. In general, each instruction silently does nothing if the resource is already in the state you request.\n\n### Updates with comments\n\nYou can submit optional comments with `PATCH` changes.\n\nTo submit a comment along with a JSON patch document, use the following format:\n\n```json\n{\n \"comment\": \"This is a comment string\",\n \"patch\": [{ \"op\": \"replace\", \"path\": \"/description\", \"value\": \"The new description\" }]\n}\n```\n\nTo submit a comment along with a JSON merge patch document, use the following format:\n\n```json\n{\n \"comment\": \"This is a comment string\",\n \"merge\": { \"description\": \"New flag description\" }\n}\n```\n\nTo submit a comment along with a semantic patch, use the following format:\n\n```json\n{\n \"comment\": \"This is a comment string\",\n \"instructions\": [ {\"kind\": \"turnFlagOn\"} ]\n}\n```\n\n## Errors\n\nThe API always returns errors in a common format. Here's an example:\n\n```json\n{\n \"code\": \"invalid_request\",\n \"message\": \"A feature with that key already exists\",\n \"id\": \"30ce6058-87da-11e4-b116-123b93f75cba\"\n}\n```\n\nThe `code` indicates the general class of error. The `message` is a human-readable explanation of what went wrong. The `id` is a unique identifier. Use it when you're working with LaunchDarkly Support to debug a problem with a specific API call.\n\n### HTTP status error response codes\n\n| Code | Definition | Description | Possible Solution |\n| ---- | ----------------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |\n| 400 | Invalid request | The request cannot be understood. | Ensure JSON syntax in request body is correct. |\n| 401 | Invalid access token | Requestor is unauthorized or does not have permission for this API call. | Ensure your API access token is valid and has the appropriate permissions. |\n| 403 | Forbidden | Requestor does not have access to this resource. | Ensure that the account member or access token has proper permissions set. |\n| 404 | Invalid resource identifier | The requested resource is not valid. | Ensure that the resource is correctly identified by ID or key. |\n| 405 | Method not allowed | The request method is not allowed on this resource. | Ensure that the HTTP verb is correct. |\n| 409 | Conflict | The API request can not be completed because it conflicts with a concurrent API request. | Retry your request. |\n| 422 | Unprocessable entity | The API request can not be completed because the update description can not be understood. | Ensure that the request body is correct for the type of patch you are using, either JSON patch or semantic patch.\n| 429 | Too many requests | Read [Rate limiting](/#section/Overview/Rate-limiting). | Wait and try again later. |\n\n## CORS\n\nThe LaunchDarkly API supports Cross Origin Resource Sharing (CORS) for AJAX requests from any origin. If an `Origin` header is given in a request, it will be echoed as an explicitly allowed origin. Otherwise the request returns a wildcard, `Access-Control-Allow-Origin: *`. For more information on CORS, read the [CORS W3C Recommendation](http://www.w3.org/TR/cors). Example CORS headers might look like:\n\n```http\nAccess-Control-Allow-Headers: Accept, Content-Type, Content-Length, Accept-Encoding, Authorization\nAccess-Control-Allow-Methods: OPTIONS, GET, DELETE, PATCH\nAccess-Control-Allow-Origin: *\nAccess-Control-Max-Age: 300\n```\n\nYou can make authenticated CORS calls just as you would make same-origin calls, using either [token or session-based authentication](/#section/Overview/Authentication). If you are using session authentication, you should set the `withCredentials` property for your `xhr` request to `true`. You should never expose your access tokens to untrusted entities.\n\n## Rate limiting\n\nWe use several rate limiting strategies to ensure the availability of our APIs. Rate-limited calls to our APIs return a `429` status code. Calls to our APIs include headers indicating the current rate limit status. The specific headers returned depend on the API route being called. The limits differ based on the route, authentication mechanism, and other factors. Routes that are not rate limited may not contain any of the headers described below.\n\n> ### Rate limiting and SDKs\n>\n> LaunchDarkly SDKs are never rate limited and do not use the API endpoints defined here. LaunchDarkly uses a different set of approaches, including streaming/server-sent events and a global CDN, to ensure availability to the routes used by LaunchDarkly SDKs.\n\n### Global rate limits\n\nAuthenticated requests are subject to a global limit. This is the maximum number of calls that your account can make to the API per ten seconds. All service and personal access tokens on the account share this limit, so exceeding the limit with one access token will impact other tokens. Calls that are subject to global rate limits may return the headers below:\n\n| Header name | Description |\n| ------------------------------ | -------------------------------------------------------------------------------- |\n| `X-Ratelimit-Global-Remaining` | The maximum number of requests the account is permitted to make per ten seconds. |\n| `X-Ratelimit-Reset` | The time at which the current rate limit window resets in epoch milliseconds. |\n\nWe do not publicly document the specific number of calls that can be made globally. This limit may change, and we encourage clients to program against the specification, relying on the two headers defined above, rather than hardcoding to the current limit.\n\n### Route-level rate limits\n\nSome authenticated routes have custom rate limits. These also reset every ten seconds. Any service or personal access tokens hitting the same route share this limit, so exceeding the limit with one access token may impact other tokens. Calls that are subject to route-level rate limits return the headers below:\n\n| Header name | Description |\n| ----------------------------- | ----------------------------------------------------------------------------------------------------- |\n| `X-Ratelimit-Route-Remaining` | The maximum number of requests to the current route the account is permitted to make per ten seconds. |\n| `X-Ratelimit-Reset` | The time at which the current rate limit window resets in epoch milliseconds. |\n\nA _route_ represents a specific URL pattern and verb. For example, the [Delete environment](/tag/Environments#operation/deleteEnvironment) endpoint is considered a single route, and each call to delete an environment counts against your route-level rate limit for that route.\n\nWe do not publicly document the specific number of calls that an account can make to each endpoint per ten seconds. These limits may change, and we encourage clients to program against the specification, relying on the two headers defined above, rather than hardcoding to the current limits.\n\n### IP-based rate limiting\n\nWe also employ IP-based rate limiting on some API routes. If you hit an IP-based rate limit, your API response will include a `Retry-After` header indicating how long to wait before re-trying the call. Clients must wait at least `Retry-After` seconds before making additional calls to our API, and should employ jitter and backoff strategies to avoid triggering rate limits again.\n\n## OpenAPI (Swagger) and client libraries\n\nWe have a [complete OpenAPI (Swagger) specification](https://app.launchdarkly.com/api/v2/openapi.json) for our API.\n\nWe auto-generate multiple client libraries based on our OpenAPI specification. To learn more, visit the [collection of client libraries on GitHub](https://github.com/search?q=topic%3Alaunchdarkly-api+org%3Alaunchdarkly&type=Repositories). You can also use this specification to generate client libraries to interact with our REST API in your language of choice.\n\nOur OpenAPI specification is supported by several API-based tools such as Postman and Insomnia. In many cases, you can directly import our specification to explore our APIs.\n\n## Method overriding\n\nSome firewalls and HTTP clients restrict the use of verbs other than `GET` and `POST`. In those environments, our API endpoints that use `DELETE`, `PATCH`, and `PUT` verbs are inaccessible.\n\nTo avoid this issue, our API supports the `X-HTTP-Method-Override` header, allowing clients to \"tunnel\" `DELETE`, `PATCH`, and `PUT` requests using a `POST` request.\n\nFor example, to call a `PATCH` endpoint using a `POST` request, you can include `X-HTTP-Method-Override:PATCH` as a header.\n\n## Beta resources\n\nWe sometimes release new API resources in **beta** status before we release them with general availability.\n\nResources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible.\n\nWe try to promote resources into general availability as quickly as possible. This happens after sufficient testing and when we're satisfied that we no longer need to make backwards-incompatible changes.\n\nWe mark beta resources with a \"Beta\" callout in our documentation, pictured below:\n\n> ### This feature is in beta\n>\n> To use this feature, pass in a header including the `LD-API-Version` key with value set to `beta`. Use this header with each call. To learn more, read [Beta resources](/#section/Overview/Beta-resources).\n>\n> Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible.\n\n### Using beta resources\n\nTo use a beta resource, you must include a header in the request. If you call a beta resource without this header, you receive a `403` response.\n\nUse this header:\n\n```\nLD-API-Version: beta\n```\n\n## Federal environments\n\nThe version of LaunchDarkly that is available on domains controlled by the United States government is different from the version of LaunchDarkly available to the general public. If you are an employee or contractor for a United States federal agency and use LaunchDarkly in your work, you likely use the federal instance of LaunchDarkly.\n\nIf you are working in the federal instance of LaunchDarkly, the base URI for each request is `https://app.launchdarkly.us`. In the \"Try it\" sandbox for each request, click the request path to view the complete resource path for the federal environment.\n\nTo learn more, read [LaunchDarkly in federal environments](https://docs.launchdarkly.com/home/advanced/federal).\n\n## Versioning\n\nWe try hard to keep our REST API backwards compatible, but we occasionally have to make backwards-incompatible changes in the process of shipping new features. These breaking changes can cause unexpected behavior if you don't prepare for them accordingly.\n\nUpdates to our REST API include support for the latest features in LaunchDarkly. We also release a new version of our REST API every time we make a breaking change. We provide simultaneous support for multiple API versions so you can migrate from your current API version to a new version at your own pace.\n\n### Setting the API version per request\n\nYou can set the API version on a specific request by sending an `LD-API-Version` header, as shown in the example below:\n\n```\nLD-API-Version: 20220603\n```\n\nThe header value is the version number of the API version you would like to request. The number for each version corresponds to the date the version was released in `yyyymmdd` format. In the example above the version `20220603` corresponds to June 03, 2022.\n\n### Setting the API version per access token\n\nWhen you create an access token, you must specify a specific version of the API to use. This ensures that integrations using this token cannot be broken by version changes.\n\nTokens created before versioning was released have their version set to `20160426`, which is the version of the API that existed before the current versioning scheme, so that they continue working the same way they did before versioning.\n\nIf you would like to upgrade your integration to use a new API version, you can explicitly set the header described above.\n\n> ### Best practice: Set the header for every client or integration\n>\n> We recommend that you set the API version header explicitly in any client or integration you build.\n>\n> Only rely on the access token API version during manual testing.\n\n### API version changelog\n\n|
Version
| Changes | End of life (EOL)\n|---|---|---|\n| `20220603` |
  • Changed the [list projects](/tag/Projects#operation/getProjects) return value:
    • Response is now paginated with a default limit of `20`.
    • Added support for filter and sort.
    • The project `environments` field is now expandable. This field is omitted by default.
  • Changed the [get project](/tag/Projects#operation/getProject) return value:
    • The `environments` field is now expandable. This field is omitted by default.
| Current |\n| `20210729` |
  • Changed the [create approval request](/tag/Approvals#operation/postApprovalRequest) return value. It now returns HTTP Status Code `201` instead of `200`.
  • Changed the [get users](/tag/Users#operation/getUser) return value. It now returns a user record, not a user.
  • Added additional optional fields to environment, segments, flags, members, and segments, including the ability to create big segments.
  • Added default values for flag variations when new environments are created.
  • Added filtering and pagination for getting flags and members, including `limit`, `number`, `filter`, and `sort` query parameters.
  • Added endpoints for expiring user targets for flags and segments, scheduled changes, access tokens, Relay Proxy configuration, integrations and subscriptions, and approvals.
| 2023-06-03 |\n| `20191212` |
  • [List feature flags](/tag/Feature-flags#operation/getFeatureFlags) now defaults to sending summaries of feature flag configurations, equivalent to setting the query parameter `summary=true`. Summaries omit flag targeting rules and individual user targets from the payload.
  • Added endpoints for flags, flag status, projects, environments, audit logs, members, users, custom roles, segments, usage, streams, events, and data export.
| 2022-07-29 |\n| `20160426` |
  • Initial versioning of API. Tokens created before versioning have their version set to this.
| 2020-12-12 |\n", - "contact": { - "name": "LaunchDarkly Technical Support Team", - "url": "https://support.launchdarkly.com", - "email": "support@launchdarkly.com" - }, - "license": { - "name": "Apache 2.0", - "url": "https://www.apache.org/licenses/LICENSE-2.0" - }, - "version": "2.0" - }, - "servers": [ - { - "url": "https://app.launchdarkly.com", - "description": " Default" - }, - { - "url": "https://app.launchdarkly.us", - "description": " Federal" - } - ], - "security": [ - { - "ApiKey": [ - "read", - "write" - ] - } - ], - "tags": [ - { - "name": "Teams", - "description": "> ### Teams is an Enterprise feature\n>\n> Teams is available to customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\nA team is a group of members in your LaunchDarkly account. A team can have maintainers who are able to add and remove team members. It also can have custom roles assigned to it that allows shared access to those roles for all team members. To learn more, read [Teams](https://docs.launchdarkly.com/home/teams).\n\nThe Teams API allows you to create, read, update, and delete a team.\n\nSeveral of the endpoints in the Teams API require one or more member IDs. The member ID is returned as part of the [List account members](/tag/Account-members#operation/getMembers) response. It is the `_id` field of each element in the `items` array.\n" - }, - { - "name": "Teams (beta)", - "description": "> ### This feature is in beta\n>\n> To use this feature, pass in a header including the `LD-API-Version` key with value set to `beta`. Use this header with each call. To learn more, read [Beta resources](/#section/Overview/Beta-resources).\n>\n> Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible.\n\n> ### Teams is an Enterprise feature\n>\n> Teams is available to customers on an Enterprise plan. To learn more, [read about our pricing](https://launchdarkly.com/pricing/). To upgrade your plan, [contact Sales](https://launchdarkly.com/contact-sales/).\n\nA team is a group of members in your LaunchDarkly account. A team can have maintainers who are able to add and remove team members. It also can have custom roles assigned to it that allows shared access to those roles for all team members. To learn more, read [Teams](https://docs.launchdarkly.com/home/teams).\n" - } - ], - "paths": { - "/api/v2/teams": { - "get": { - "responses": { - "200": { - "description": "Teams collection response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Teams" - } - } - } - }, - "401": { - "description": "Invalid access token", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedErrorRep" - } - } - } - }, - "405": { - "description": "Method not allowed", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MethodNotAllowedErrorRep" - } - } - } - }, - "429": { - "description": "Rate limited", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RateLimitedErrorRep" - } - } - } - } - }, - "tags": [ - "Teams" - ], - "summary": "List teams", - "description": "Return a list of teams.\n\nBy default, this returns the first 20 teams. Page through this list with the `limit` parameter and by following the `first`, `prev`, `next`, and `last` links in the `_links` field that returns. If those links do not appear, the pages they refer to don't exist. For example, the `first` and `prev` links will be missing from the response on the first page, because there is no previous page and you cannot return to the first page when you are already on the first page.\n\n### Filtering teams\n\nLaunchDarkly supports the following fields for filters:\n\n- `query` is a string that matches against the teams' names and keys. It is not case-sensitive.\n - A request with `query:abc` returns teams with the string `abc` in their name or key.\n- `nomembers` is a boolean that filters the list of teams who have 0 members\n - A request with `nomembers:true` returns teams that have 0 members\n - A request with `nomembers:false` returns teams that have 1 or more members\n\n### Expanding the teams response\nLaunchDarkly supports four fields for expanding the \"List teams\" response. By default, these fields are **not** included in the response.\n\nTo expand the response, append the `expand` query parameter and add a comma-separated list with any of the following fields:\n\n* `members` includes the total count of members that belong to the team.\n* `roles` includes a paginated list of the custom roles that you have assigned to the team.\n* `projects` includes a paginated list of the projects that the team has any write access to.\n* `maintainers` includes a paginated list of the maintainers that you have assigned to the team.\n\nFor example, `expand=members,roles` includes the `members` and `roles` fields in the response.\n", - "parameters": [ - { - "name": "limit", - "in": "query", - "description": "The number of teams to return in the response. Defaults to 20.", - "schema": { - "type": "integer", - "format": "int64", - "description": "The number of teams to return in the response. Defaults to 20." - } - }, - { - "name": "offset", - "in": "query", - "description": "Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and returns the next `limit` items.", - "schema": { - "type": "integer", - "format": "int64", - "description": "Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and returns the next `limit` items." - } - }, - { - "name": "filter", - "in": "query", - "description": "A comma-separated list of filters. Each filter is constructed as `field:value`.", - "schema": { - "type": "string", - "format": "string", - "description": "A comma-separated list of filters. Each filter is constructed as `field:value`." - } - }, - { - "name": "expand", - "in": "query", - "description": "A comma-separated list of properties that can reveal additional information in the response.", - "schema": { - "type": "string", - "format": "string", - "description": "A comma-separated list of properties that can reveal additional information in the response." - } - } - ], - "operationId": "getTeams" - }, - "post": { - "responses": { - "201": { - "description": "Teams response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Team" - } - } - } - }, - "400": { - "description": "Invalid request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestErrorRep" - } - } - } - }, - "401": { - "description": "Invalid access token", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedErrorRep" - } - } - } - }, - "405": { - "description": "Method not allowed", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MethodNotAllowedErrorRep" - } - } - } - }, - "429": { - "description": "Rate limited", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RateLimitedErrorRep" - } - } - } - } - }, - "tags": [ - "Teams" - ], - "summary": "Create team", - "description": "Create a team. To learn more, read [Creating a team](https://docs.launchdarkly.com/home/teams/creating).\n\n### Expanding the teams response\nLaunchDarkly supports four fields for expanding the \"Create team\" response. By default, these fields are **not** included in the response.\n\nTo expand the response, append the `expand` query parameter and add a comma-separated list with any of the following fields:\n\n* `members` includes the total count of members that belong to the team.\n* `roles` includes a paginated list of the custom roles that you have assigned to the team.\n* `projects` includes a paginated list of the projects that the team has any write access to.\n* `maintainers` includes a paginated list of the maintainers that you have assigned to the team.\n\nFor example, `expand=members,roles` includes the `members` and `roles` fields in the response.\n", - "parameters": [ - { - "name": "expand", - "in": "query", - "description": "A comma-separated list of properties that can reveal additional information in the response. Supported fields are explained above.", - "schema": { - "type": "string", - "format": "string", - "description": "A comma-separated list of properties that can reveal additional information in the response. Supported fields are explained above." - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/teamPostInput" - }, - "example": { - "customRoleKeys": [ - "example-role1", - "example-role2" - ], - "description": "An example team", - "key": "team-key-123abc", - "memberIDs": [ - "12ab3c45de678910fgh12345" - ], - "name": "Example team" - } - } - }, - "required": true - }, - "operationId": "postTeam" - }, - "patch": { - "responses": { - "200": { - "description": "Teams response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BulkEditTeamsRep" - } - } - } - }, - "400": { - "description": "Invalid request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestErrorRep" - } - } - } - }, - "401": { - "description": "Invalid access token", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedErrorRep" - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ForbiddenErrorRep" - } - } - } - }, - "409": { - "description": "Status conflict", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/StatusConflictErrorRep" - } - } - } - }, - "429": { - "description": "Rate limited", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RateLimitedErrorRep" - } - } - } - } - }, - "tags": [ - "Teams (beta)" - ], - "summary": "Update teams", - "description": "Perform a partial update to multiple teams. Updating teams uses the semantic patch format.\n\nTo make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch).\n\n### Instructions\n\nSemantic patch requests support the following `kind` instructions for updating teams.\n\n
\nClick to expand instructions for updating teams\n\n#### addMembersToTeams\n\nAdd the members to teams.\n\n##### Parameters\n\n- `memberIDs`: List of member IDs to add.\n- `teamKeys`: List of teams to update.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"addMembersToTeams\",\n \"memberIDs\": [\n \"1234a56b7c89d012345e678f\"\n ],\n \"teamKeys\": [\n \"example-team-1\",\n \"example-team-2\"\n ]\n }]\n}\n```\n\n#### addAllMembersToTeams\n\nAdd all members to the team. Members that match any of the filters are **excluded** from the update.\n\n##### Parameters\n\n- `teamKeys`: List of teams to update.\n- `filterLastSeen`: (Optional) A JSON object with one of the following formats:\n - `{\"never\": true}` - Members that have never been active, such as those who have not accepted their invitation to LaunchDarkly, or have not logged in after being provisioned via SCIM.\n - `{\"noData\": true}` - Members that have not been active since LaunchDarkly began recording last seen timestamps.\n - `{\"before\": 1608672063611}` - Members that have not been active since the provided value, which should be a timestamp in Unix epoch milliseconds.\n- `filterQuery`: (Optional) A string that matches against the members' emails and names. It is not case sensitive.\n- `filterRoles`: (Optional) A `|` separated list of roles and custom roles. For the purposes of this filtering, `Owner` counts as `Admin`.\n- `filterTeamKey`: (Optional) A string that matches against the key of the team the members belong to. It is not case sensitive.\n- `ignoredMemberIDs`: (Optional) A list of member IDs.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"addAllMembersToTeams\",\n \"teamKeys\": [\n \"example-team-1\",\n \"example-team-2\"\n ],\n \"filterLastSeen\": { \"never\": true }\n }]\n}\n```\n\n
\n", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/teamsPatchInput" - }, - "example": { - "comment": "Optional comment about the update", - "instructions": [ - { - "kind": "addMembersToTeams", - "memberIDs": [ - "1234a56b7c89d012345e678f" - ], - "teamKeys": [ - "example-team-1", - "example-team-2" - ] - } - ] - } - } - }, - "required": true - }, - "operationId": "patchTeams" - } - }, - "/api/v2/teams/{teamKey}": { - "get": { - "responses": { - "200": { - "description": "Teams response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Team" - } - } - } - }, - "400": { - "description": "Invalid request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestErrorRep" - } - } - } - }, - "401": { - "description": "Invalid access token", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedErrorRep" - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ForbiddenErrorRep" - } - } - } - }, - "404": { - "description": "Invalid resource identifier", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundErrorRep" - } - } - } - }, - "405": { - "description": "Method not allowed", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MethodNotAllowedErrorRep" - } - } - } - }, - "429": { - "description": "Rate limited", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RateLimitedErrorRep" - } - } - } - } - }, - "tags": [ - "Teams" - ], - "summary": "Get team", - "description": "Fetch a team by key.\n\n### Expanding the teams response\nLaunchDarkly supports four fields for expanding the \"Get team\" response. By default, these fields are **not** included in the response.\n\nTo expand the response, append the `expand` query parameter and add a comma-separated list with any of the following fields:\n\n* `members` includes the total count of members that belong to the team.\n* `roles` includes a paginated list of the custom roles that you have assigned to the team.\n* `projects` includes a paginated list of the projects that the team has any write access to.\n* `maintainers` includes a paginated list of the maintainers that you have assigned to the team.\n\nFor example, `expand=members,roles` includes the `members` and `roles` fields in the response.\n", - "parameters": [ - { - "name": "teamKey", - "in": "path", - "description": "The team key.", - "required": true, - "schema": { - "type": "string", - "format": "string", - "description": "The team key." - } - }, - { - "name": "expand", - "in": "query", - "description": "A comma-separated list of properties that can reveal additional information in the response.", - "schema": { - "type": "string", - "format": "string", - "description": "A comma-separated list of properties that can reveal additional information in the response." - } - } - ], - "operationId": "getTeam" - }, - "patch": { - "responses": { - "200": { - "description": "Teams response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Team" - } - } - } - }, - "400": { - "description": "Invalid request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestErrorRep" - } - } - } - }, - "401": { - "description": "Invalid access token", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedErrorRep" - } - } - } - }, - "404": { - "description": "Invalid resource identifier", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundErrorRep" - } - } - } - }, - "405": { - "description": "Method not allowed", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MethodNotAllowedErrorRep" - } - } - } - }, - "409": { - "description": "Status conflict", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/StatusConflictErrorRep" - } - } - } - }, - "429": { - "description": "Rate limited", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RateLimitedErrorRep" - } - } - } - } - }, - "tags": [ - "Teams" - ], - "summary": "Update team", - "description": "Perform a partial update to a team. Updating a team uses the semantic patch format.\n\nTo make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](/reference#updates-using-semantic-patch).\n\n### Instructions\n\nSemantic patch requests support the following `kind` instructions for updating teams.\n\n
\nClick to expand instructions for updating teams\n\n#### addCustomRoles\n\nAdds custom roles to the team. Team members will have these custom roles granted to them.\n\n##### Parameters\n\n- `values`: List of custom role keys.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"addCustomRoles\",\n \"values\": [ \"example-custom-role\" ]\n }]\n}\n```\n\n#### removeCustomRoles\n\nRemoves custom roles from the team. The app will no longer grant these custom roles to the team members.\n\n##### Parameters\n\n- `values`: List of custom role keys.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"removeCustomRoles\",\n \"values\": [ \"example-custom-role\" ]\n }]\n}\n```\n\n#### addMembers\n\nAdds members to the team.\n\n##### Parameters\n\n- `values`: List of member IDs to add.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"addMembers\",\n \"values\": [ \"1234a56b7c89d012345e678f\", \"507f1f77bcf86cd799439011\" ]\n }]\n}\n```\n\n#### removeMembers\n\nRemoves members from the team.\n\n##### Parameters\n\n- `values`: List of member IDs to remove.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"removeMembers\",\n \"values\": [ \"1234a56b7c89d012345e678f\", \"507f1f77bcf86cd799439011\" ]\n }]\n}\n```\n\n#### replaceMembers\n\nReplaces the existing members of the team with the new members.\n\n##### Parameters\n\n- `values`: List of member IDs of the new members.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"replaceMembers\",\n \"values\": [ \"1234a56b7c89d012345e678f\", \"507f1f77bcf86cd799439011\" ]\n }]\n}\n```\n\n#### addPermissionGrants\n\nAdds permission grants to members for the team. For example, a permission grant could allow a member to act as a team maintainer. A permission grant may have either an `actionSet` or a list of `actions` but not both at the same time. The members do not have to be team members to have a permission grant for the team.\n\n##### Parameters\n\n- `actionSet`: Name of the action set.\n- `actions`: List of actions.\n- `memberIDs`: List of member IDs.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"addPermissionGrants\",\n \"actions\": [ \"updateTeamName\", \"updateTeamDescription\" ],\n \"memberIDs\": [ \"1234a56b7c89d012345e678f\", \"507f1f77bcf86cd799439011\" ]\n }]\n}\n```\n\n#### removePermissionGrants\n\nRemoves permission grants from members for the team. A permission grant may have either an `actionSet` or a list of `actions` but not both at the same time. The `actionSet` and `actions` must match an existing permission grant.\n\n##### Parameters\n\n- `actionSet`: Name of the action set.\n- `actions`: List of actions.\n- `memberIDs`: List of member IDs.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"removePermissionGrants\",\n \"actions\": [ \"updateTeamName\", \"updateTeamDescription\" ],\n \"memberIDs\": [ \"1234a56b7c89d012345e678f\", \"507f1f77bcf86cd799439011\" ]\n }]\n}\n```\n\n#### updateDescription\n\nUpdates the description of the team.\n\n##### Parameters\n\n- `value`: The new description.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"updateDescription\",\n \"value\": \"Updated team description\"\n }]\n}\n```\n\n#### updateName\n\nUpdates the name of the team.\n\n##### Parameters\n\n- `value`: The new name.\n\nHere's an example:\n\n```json\n{\n \"instructions\": [{\n \"kind\": \"updateName\",\n \"value\": \"Updated team name\"\n }]\n}\n```\n\n
\n\n### Expanding the teams response\nLaunchDarkly supports four fields for expanding the \"Update team\" response. By default, these fields are **not** included in the response.\n\nTo expand the response, append the `expand` query parameter and add a comma-separated list with any of the following fields:\n\n* `members` includes the total count of members that belong to the team.\n* `roles` includes a paginated list of the custom roles that you have assigned to the team.\n* `projects` includes a paginated list of the projects that the team has any write access to.\n* `maintainers` includes a paginated list of the maintainers that you have assigned to the team.\n\nFor example, `expand=members,roles` includes the `members` and `roles` fields in the response.\n", - "parameters": [ - { - "name": "teamKey", - "in": "path", - "description": "The team key", - "required": true, - "schema": { - "type": "string", - "format": "string", - "description": "The team key" - } - }, - { - "name": "expand", - "in": "query", - "description": "A comma-separated list of properties that can reveal additional information in the response. Supported fields are explained above.", - "schema": { - "type": "string", - "format": "string", - "description": "A comma-separated list of properties that can reveal additional information in the response. Supported fields are explained above." - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/teamPatchInput" - }, - "example": { - "comment": "Optional comment about the update", - "instructions": [ - { - "kind": "updateDescription", - "value": "New description for the team" - } - ] - } - } - }, - "required": true - }, - "operationId": "patchTeam" - }, - "delete": { - "responses": { - "204": { - "description": "Action succeeded" - }, - "401": { - "description": "Invalid access token", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedErrorRep" - } - } - } - }, - "404": { - "description": "Invalid resource identifier", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundErrorRep" - } - } - } - }, - "429": { - "description": "Rate limited", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RateLimitedErrorRep" - } - } - } - } - }, - "tags": [ - "Teams" - ], - "summary": "Delete team", - "description": "Delete a team by key. To learn more, read [Deleting a team](https://docs.launchdarkly.com/home/teams/managing#deleting-a-team).", - "parameters": [ - { - "name": "teamKey", - "in": "path", - "description": "The team key", - "required": true, - "schema": { - "type": "string", - "format": "string", - "description": "The team key" - } - } - ], - "operationId": "deleteTeam" - } - }, - "/api/v2/teams/{teamKey}/maintainers": { - "get": { - "responses": { - "200": { - "description": "Team maintainers response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TeamMaintainers" - } - } - } - }, - "400": { - "description": "Invalid request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestErrorRep" - } - } - } - }, - "401": { - "description": "Invalid access token", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedErrorRep" - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ForbiddenErrorRep" - } - } - } - }, - "404": { - "description": "Invalid resource identifier", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundErrorRep" - } - } - } - }, - "405": { - "description": "Method not allowed", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MethodNotAllowedErrorRep" - } - } - } - }, - "429": { - "description": "Rate limited", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RateLimitedErrorRep" - } - } - } - } - }, - "tags": [ - "Teams" - ], - "summary": "Get team maintainers", - "description": "Fetch the maintainers that have been assigned to the team. To learn more, read [Managing team maintainers](https://docs.launchdarkly.com/home/teams/managing#managing-team-maintainers).", - "parameters": [ - { - "name": "teamKey", - "in": "path", - "description": "The team key", - "required": true, - "schema": { - "type": "string", - "format": "string", - "description": "The team key" - } - }, - { - "name": "limit", - "in": "query", - "description": "The number of maintainers to return in the response. Defaults to 20.", - "schema": { - "type": "integer", - "format": "int64", - "description": "The number of maintainers to return in the response. Defaults to 20." - } - }, - { - "name": "offset", - "in": "query", - "description": "Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.", - "schema": { - "type": "integer", - "format": "int64", - "description": "Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`." - } - } - ], - "operationId": "getTeamMaintainers" - } - }, - "/api/v2/teams/{teamKey}/members": { - "post": { - "responses": { - "201": { - "description": "Team member imports response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TeamImportsRep" - } - } - } - }, - "207": { - "description": "Partial Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TeamImportsRep" - } - } - } - }, - "400": { - "description": "Invalid request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestErrorRep" - } - } - } - }, - "401": { - "description": "Invalid access token", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedErrorRep" - } - } - } - }, - "405": { - "description": "Method not allowed", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MethodNotAllowedErrorRep" - } - } - } - }, - "429": { - "description": "Rate limited", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RateLimitedErrorRep" - } - } - } - } - }, - "tags": [ - "Teams" - ], - "summary": "Add multiple members to team", - "description": "Add multiple members to an existing team by uploading a CSV file of member email addresses. Your CSV file must include email addresses in the first column. You can include data in additional columns, but LaunchDarkly ignores all data outside the first column. Headers are optional. To learn more, read [Managing team members](https://docs.launchdarkly.com/home/teams/managing#managing-team-members).\n\n**Members are only added on a `201` response.** A `207` indicates the CSV file contains a combination of valid and invalid entries. A `207` results in no members being added to the team.\n\nOn a `207` response, if an entry contains bad input, the `message` field contains the row number as well as the reason for the error. The `message` field is omitted if the entry is valid.\n\nExample `207` response:\n```json\n{\n \"items\": [\n {\n \"status\": \"success\",\n \"value\": \"new-team-member@acme.com\"\n },\n {\n \"message\": \"Line 2: empty row\",\n \"status\": \"error\",\n \"value\": \"\"\n },\n {\n \"message\": \"Line 3: email already exists in the specified team\",\n \"status\": \"error\",\n \"value\": \"existing-team-member@acme.com\"\n },\n {\n \"message\": \"Line 4: invalid email formatting\",\n \"status\": \"error\",\n \"value\": \"invalid email format\"\n }\n ]\n}\n```\n\nMessage | Resolution\n--- | ---\nEmpty row | This line is blank. Add an email address and try again.\nDuplicate entry | This email address appears in the file twice. Remove the email from the file and try again.\nEmail already exists in the specified team | This member is already on your team. Remove the email from the file and try again.\nInvalid formatting | This email address is not formatted correctly. Fix the formatting and try again.\nEmail does not belong to a LaunchDarkly member | The email address doesn't belong to a LaunchDarkly account member. Invite them to LaunchDarkly, then re-add them to the team.\n\nOn a `400` response, the `message` field may contain errors specific to this endpoint.\n\nExample `400` response:\n```json\n{\n \"code\": \"invalid_request\",\n \"message\": \"Unable to process file\"\n}\n```\n\nMessage | Resolution\n--- | ---\nUnable to process file | LaunchDarkly could not process the file for an unspecified reason. Review your file for errors and try again.\nFile exceeds 25mb | Break up your file into multiple files of less than 25mbs each.\nAll emails have invalid formatting | None of the email addresses in the file are in the correct format. Fix the formatting and try again.\nAll emails belong to existing team members | All listed members are already on this team. Populate the file with member emails that do not belong to the team and try again.\nFile is empty | The CSV file does not contain any email addresses. Populate the file and try again.\nNo emails belong to members of your LaunchDarkly organization | None of the email addresses belong to members of your LaunchDarkly account. Invite these members to LaunchDarkly, then re-add them to the team.\n", - "parameters": [ - { - "name": "teamKey", - "in": "path", - "description": "The team key", - "required": true, - "schema": { - "type": "string", - "format": "string", - "description": "The team key" - } - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "type": "object", - "properties": { - "file": { - "type": "string", - "format": "binary", - "description": "CSV file containing email addresses" - } - } - } - } - }, - "required": true - }, - "operationId": "postTeamMembers" - } - }, - "/api/v2/teams/{teamKey}/roles": { - "get": { - "responses": { - "200": { - "description": "Team roles response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TeamCustomRoles" - } - } - } - }, - "400": { - "description": "Invalid request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestErrorRep" - } - } - } - }, - "401": { - "description": "Invalid access token", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedErrorRep" - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ForbiddenErrorRep" - } - } - } - }, - "404": { - "description": "Invalid resource identifier", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundErrorRep" - } - } - } - }, - "405": { - "description": "Method not allowed", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MethodNotAllowedErrorRep" - } - } - } - }, - "429": { - "description": "Rate limited", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RateLimitedErrorRep" - } - } - } - } - }, - "tags": [ - "Teams" - ], - "summary": "Get team custom roles", - "description": "Fetch the custom roles that have been assigned to the team. To learn more, read [Managing team permissions](https://docs.launchdarkly.com/home/teams/managing#managing-team-permissions).", - "parameters": [ - { - "name": "teamKey", - "in": "path", - "description": "The team key", - "required": true, - "schema": { - "type": "string", - "format": "string", - "description": "The team key" - } - }, - { - "name": "limit", - "in": "query", - "description": "The number of roles to return in the response. Defaults to 20.", - "schema": { - "type": "integer", - "format": "int64", - "description": "The number of roles to return in the response. Defaults to 20." - } - }, - { - "name": "offset", - "in": "query", - "description": "Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.", - "schema": { - "type": "integer", - "format": "int64", - "description": "Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`." - } - } - ], - "operationId": "getTeamRoles" - } - } - }, - "components": { - "schemas": { - "Access": { - "type": "object", - "required": [ - "denied", - "allowed" - ], - "properties": { - "denied": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AccessDenied" - } - }, - "allowed": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AccessAllowedRep" - } - } - } - }, - "ActionSpecifier": { - "type": "string" - }, - "AccessAllowedReason": { - "type": "object", - "required": [ - "effect" - ], - "properties": { - "resources": { - "type": "array", - "description": "Resource specifier strings", - "items": { - "type": "string" - }, - "example": [ - "proj/*:env/*;qa_*:/flag/*" - ] - }, - "notResources": { - "type": "array", - "description": "Targeted resources are the resources NOT in this list. The resources and notActions fields must be empty to use this field.", - "items": { - "type": "string" - } - }, - "actions": { - "type": "array", - "description": "Actions to perform on a resource", - "items": { - "$ref": "#/components/schemas/ActionSpecifier" - }, - "example": [ - "*" - ] - }, - "notActions": { - "type": "array", - "description": "Targeted actions are the actions NOT in this list. The actions and notResources fields must be empty to use this field.", - "items": { - "$ref": "#/components/schemas/ActionSpecifier" - } - }, - "effect": { - "type": "string", - "description": "Whether this statement should allow or deny actions on the resources.", - "example": "allow", - "enum": [ - "allow", - "deny" - ] - }, - "role_name": { - "type": "string" - } - } - }, - "AccessAllowedRep": { - "type": "object", - "required": [ - "action", - "reason" - ], - "properties": { - "action": { - "$ref": "#/components/schemas/ActionIdentifier" - }, - "reason": { - "$ref": "#/components/schemas/AccessAllowedReason" - } - } - }, - "AccessDenied": { - "type": "object", - "required": [ - "action", - "reason" - ], - "properties": { - "action": { - "$ref": "#/components/schemas/ActionIdentifier" - }, - "reason": { - "$ref": "#/components/schemas/AccessDeniedReason" - } - } - }, - "AccessDeniedReason": { - "type": "object", - "required": [ - "effect" - ], - "properties": { - "resources": { - "type": "array", - "description": "Resource specifier strings", - "items": { - "type": "string" - }, - "example": [ - "proj/*:env/*;qa_*:/flag/*" - ] - }, - "notResources": { - "type": "array", - "description": "Targeted resources are the resources NOT in this list. The resources and notActions fields must be empty to use this field.", - "items": { - "type": "string" - } - }, - "actions": { - "type": "array", - "description": "Actions to perform on a resource", - "items": { - "$ref": "#/components/schemas/ActionSpecifier" - }, - "example": [ - "*" - ] - }, - "notActions": { - "type": "array", - "description": "Targeted actions are the actions NOT in this list. The actions and notResources fields must be empty to use this field.", - "items": { - "$ref": "#/components/schemas/ActionSpecifier" - } - }, - "effect": { - "type": "string", - "description": "Whether this statement should allow or deny actions on the resources.", - "example": "allow", - "enum": [ - "allow", - "deny" - ] - }, - "role_name": { - "type": "string" - } - } - }, - "ActionIdentifier": { - "type": "string" - }, - "BulkEditTeamsRep": { - "type": "object", - "properties": { - "memberIDs": { - "type": "array", - "description": "A list of member IDs of the members who were added to the teams.", - "items": { - "type": "string" - }, - "example": [ - "1234a56b7c89d012345e678f" - ] - }, - "teamKeys": { - "type": "array", - "description": "A list of team keys of the teams that were successfully updated.", - "items": { - "type": "string" - }, - "example": [ - "example-team-1" - ] - }, - "errors": { - "type": "array", - "description": "A list of team keys and errors for the teams whose updates failed.", - "items": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "example": [ - { - "example-team-2": "example failure message" - } - ] - } - } - }, - "ForbiddenErrorRep": { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "string", - "description": "Specific error code encountered", - "example": "forbidden" - }, - "message": { - "type": "string", - "description": "Description of the error", - "example": "Forbidden. Access to the requested resource was denied." - } - } - }, - "Instruction": { - "type": "object", - "additionalProperties": {} - }, - "Instructions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Instruction" - } - }, - "InvalidRequestErrorRep": { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "string", - "description": "Specific error code encountered", - "example": "invalid_request" - }, - "message": { - "type": "string", - "description": "Description of the error", - "example": "Invalid request body" - } - } - }, - "Link": { - "type": "object", - "properties": { - "href": { - "type": "string" - }, - "type": { - "type": "string" - } - } - }, - "NotFoundErrorRep": { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "string", - "description": "Specific error code encountered", - "example": "not_found" - }, - "message": { - "type": "string", - "description": "Description of the error", - "example": "Invalid resource identifier" - } - } - }, - "MemberImportItem": { - "type": "object", - "required": [ - "status", - "value" - ], - "properties": { - "message": { - "type": "string", - "description": "An error message, including CSV line number, if the status is error" - }, - "status": { - "type": "string", - "description": "Whether this member can be successfully imported (success) or not (error). Even if the status is success, members are only added to a team on a 201 response.", - "example": "error" - }, - "value": { - "type": "string", - "description": "The email address for the member requested to be added to this team. May be blank or an error, such as 'invalid email format', if the email address cannot be found or parsed.", - "example": "new-team-member@acme.com" - } - } - }, - "MemberSummary": { - "type": "object", - "required": [ - "_links", - "_id", - "role", - "email" - ], - "properties": { - "_links": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/Link" - }, - "description": "The location and content type of related resources", - "example": { - "self": { - "href": "/api/v2/members/569f183514f4432160000007", - "type": "application/json" - } - } - }, - "_id": { - "type": "string", - "description": "The member's ID", - "example": "569f183514f4432160000007" - }, - "firstName": { - "type": "string", - "description": "The member's first name", - "example": "Ariel" - }, - "lastName": { - "type": "string", - "description": "The member's last name", - "example": "Flores" - }, - "role": { - "type": "string", - "description": "The member's built-in role. If the member has no custom roles, this role will be in effect.", - "example": "admin" - }, - "email": { - "type": "string", - "description": "The member's email address", - "example": "ariel@acme.com" - } - } - }, - "MethodNotAllowedErrorRep": { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "string", - "description": "Specific error code encountered", - "example": "method_not_allowed" - }, - "message": { - "type": "string", - "description": "Description of the error", - "example": "Method not allowed" - } - } - }, - "permissionGrantInput": { - "type": "object", - "properties": { - "actionSet": { - "type": "string", - "description": "A group of related actions to allow. Specify either actionSet or actions. Use maintainTeam to add team maintainers.", - "example": "maintainTeam", - "enum": [ - "maintainTeam" - ] - }, - "actions": { - "type": "array", - "description": "A list of actions to allow. Specify either actionSet or actions. To learn more, read [Role actions](https://docs.launchdarkly.com/home/members/role-actions).", - "items": { - "type": "string" - }, - "example": [ - "updateTeamMembers" - ] - }, - "memberIDs": { - "type": "array", - "description": "A list of member IDs who receive the permission grant.", - "items": { - "type": "string" - }, - "example": [ - "12ab3c45de678910fgh12345" - ] - } - } - }, - "ProjectSummary": { - "type": "object", - "required": [ - "_id", - "_links", - "key", - "name" - ], - "properties": { - "_id": { - "type": "string", - "description": "The ID of this project", - "example": "57be1db38b75bf0772d11383" - }, - "_links": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/Link" - }, - "description": "The location and content type of related resources", - "example": { - "environments": { - "href": "/api/v2/projects/example-project/environments", - "type": "application/json" - }, - "self": { - "href": "/api/v2/projects/example-project", - "type": "application/json" - } - } - }, - "key": { - "type": "string", - "description": "The project key", - "example": "project-key-123abc" - }, - "name": { - "type": "string", - "description": "The project name", - "example": "Example project" - } - } - }, - "RateLimitedErrorRep": { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "string", - "description": "Specific error code encountered", - "example": "rate_limited" - }, - "message": { - "type": "string", - "description": "Description of the error", - "example": "You've exceeded the API rate limit. Try again later." - } - } - }, - "StatusConflictErrorRep": { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "string", - "description": "Specific error code encountered", - "example": "optimistic_locking_error" - }, - "message": { - "type": "string", - "description": "Description of the error", - "example": "Conflict. Optimistic lock error. Try again later." - } - } - }, - "Team": { - "type": "object", - "properties": { - "description": { - "type": "string", - "description": "A description of the team", - "example": "Description for this team." - }, - "key": { - "type": "string", - "description": "The team key", - "example": "team-key-123abc" - }, - "name": { - "type": "string", - "description": "A human-friendly name for the team", - "example": "Example team" - }, - "_access": { - "description": "Details on the allowed and denied actions for this team", - "$ref": "#/components/schemas/Access" - }, - "_creationDate": { - "description": "Timestamp of when the team was created", - "example": "1648671956143", - "$ref": "#/components/schemas/UnixMillis" - }, - "_links": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/Link" - }, - "description": "The location and content type of related resources", - "example": { - "parent": { - "href": "/api/v2/teams", - "type": "application/json" - }, - "roles": { - "href": "/api/v2/teams/example-team/roles", - "type": "application/json" - }, - "self": { - "href": "/api/v2/teams/example-team", - "type": "application/json" - } - } - }, - "_lastModified": { - "description": "Timestamp of when the team was most recently updated", - "example": "1648672446072", - "$ref": "#/components/schemas/UnixMillis" - }, - "_version": { - "type": "integer", - "description": "The team version", - "example": 3 - }, - "_idpSynced": { - "type": "boolean", - "description": "Whether the team has been synced with an external identity provider (IdP). Team sync is available to customers on an Enterprise plan.", - "example": true - }, - "roles": { - "description": "Paginated list of the custom roles assigned to this team. Only included if specified in the expand query parameter.", - "$ref": "#/components/schemas/TeamCustomRoles" - }, - "members": { - "description": "Details on the total count of members that belong to the team. Only included if specified in the expand query parameter.", - "$ref": "#/components/schemas/TeamMembers" - }, - "projects": { - "description": "Paginated list of the projects that the team has any write access to. Only included if specified in the expand query parameter.", - "$ref": "#/components/schemas/TeamProjects" - }, - "maintainers": { - "description": "Paginated list of the maintainers assigned to this team. Only included if specified in the expand query parameter.", - "$ref": "#/components/schemas/TeamMaintainers" - } - } - }, - "TeamCustomRole": { - "type": "object", - "properties": { - "key": { - "type": "string", - "description": "The key of the custom role", - "example": "role-key-123abc" - }, - "name": { - "type": "string", - "description": "The name of the custom role", - "example": "Example role" - }, - "projects": { - "description": "Details on the projects where team members have write privileges on at least one resource type (e.g. flags)", - "$ref": "#/components/schemas/TeamProjects" - }, - "appliedOn": { - "description": "Timestamp of when the custom role was assigned to this team", - "example": "1648672018410", - "$ref": "#/components/schemas/UnixMillis" - } - } - }, - "TeamCustomRoles": { - "type": "object", - "properties": { - "totalCount": { - "type": "integer", - "description": "The number of custom roles assigned to this team", - "example": 1 - }, - "items": { - "type": "array", - "description": "An array of the custom roles that have been assigned to this team", - "items": { - "$ref": "#/components/schemas/TeamCustomRole" - } - }, - "_links": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/Link" - }, - "description": "The location and content type of related resources", - "example": { - "self": { - "href": "/api/v2/teams/example-team/roles?limit=25", - "type": "application/json" - } - } - } - } - }, - "TeamImportsRep": { - "type": "object", - "properties": { - "items": { - "type": "array", - "description": "An array of details about the members requested to be added to this team", - "items": { - "$ref": "#/components/schemas/MemberImportItem" - } - } - } - }, - "TeamMaintainers": { - "type": "object", - "properties": { - "totalCount": { - "type": "integer", - "description": "The number of maintainers of the team", - "example": 1 - }, - "items": { - "type": "array", - "description": "Details on the members that have been assigned as maintainers of the team", - "items": { - "$ref": "#/components/schemas/MemberSummary" - }, - "example": [ - { - "_id": "569f183514f4432160000007", - "_links": { - "self": { - "href": "/api/v2/members/569f183514f4432160000007", - "type": "application/json" - } - }, - "email": "ariel@acme.com", - "firstName": "Ariel", - "lastName": "Flores", - "role": "reader" - } - ] - }, - "_links": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/Link" - }, - "description": "The location and content type of related resources", - "example": { - "self": { - "href": "/api/v2/teams/example-team/maintainers?limit=5", - "type": "application/json" - } - } - } - } - }, - "TeamMembers": { - "type": "object", - "properties": { - "totalCount": { - "type": "integer", - "description": "The total count of members that belong to the team", - "example": 15 - } - } - }, - "TeamProjects": { - "type": "object", - "properties": { - "totalCount": { - "type": "integer", - "example": 1 - }, - "items": { - "type": "array", - "description": "Details on each project where team members have write privileges on at least one resource type (e.g. flags)", - "items": { - "$ref": "#/components/schemas/ProjectSummary" - }, - "example": [ - { - "_links": { - "environments": { - "href": "/api/v2/projects/example-project/environments", - "type": "application/json" - }, - "self": { - "href": "/api/v2/projects/example-project", - "type": "application/json" - } - }, - "key": "project-key-123abc", - "name": "Example project" - } - ] - } - } - }, - "Teams": { - "type": "object", - "properties": { - "items": { - "type": "array", - "description": "An array of teams", - "items": { - "$ref": "#/components/schemas/Team" - } - }, - "_links": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/Link" - }, - "description": "The location and content type of related resources", - "example": { - "self": { - "href": "/api/v2/teams?expand=maintainers%2Cmembers%2Croles%2Cprojects&limit=20", - "type": "application/json" - } - } - }, - "totalCount": { - "type": "integer", - "description": "The number of teams", - "example": 1 - } - } - }, - "teamPatchInput": { - "type": "object", - "required": [ - "instructions" - ], - "properties": { - "comment": { - "type": "string", - "description": "Optional comment describing the update", - "example": "Optional comment about the update" - }, - "instructions": { - "description": "The instructions to perform when updating. This should be an array with objects that look like {\"kind\": \"update_action\"}. Some instructions also require additional parameters as part of this object.", - "example": "[ { \"kind\": \"updateDescription\", \"value\": \"New description for the team\" } ]", - "$ref": "#/components/schemas/Instructions" - } - } - }, - "teamsPatchInput": { - "type": "object", - "required": [ - "instructions" - ], - "properties": { - "comment": { - "type": "string", - "description": "Optional comment describing the update", - "example": "Optional comment about the update" - }, - "instructions": { - "description": "The instructions to perform when updating. This should be an array with objects that look like {\"kind\": \"update_action\"}. Some instructions also require additional parameters as part of this object.", - "example": "[ { \"kind\": \"updateDescription\", \"value\": \"New description for the team\" } ]", - "$ref": "#/components/schemas/Instructions" - } - } - }, - "teamPostInput": { - "type": "object", - "required": [ - "key", - "name" - ], - "properties": { - "customRoleKeys": { - "type": "array", - "description": "List of custom role keys the team will access", - "items": { - "type": "string" - }, - "example": [ - "example-role1", - "example-role2" - ] - }, - "description": { - "type": "string", - "description": "A description of the team", - "example": "An example team" - }, - "key": { - "type": "string", - "description": "The team key", - "example": "team-key-123abc" - }, - "memberIDs": { - "type": "array", - "description": "A list of member IDs who belong to the team", - "items": { - "type": "string" - }, - "example": [ - "12ab3c45de678910fgh12345" - ] - }, - "name": { - "type": "string", - "description": "A human-friendly name for the team", - "example": "Example team" - }, - "permissionGrants": { - "type": "array", - "description": "A list of permission grants. Permission grants allow access to a specific action, without having to create or update a custom role.", - "items": { - "$ref": "#/components/schemas/permissionGrantInput" - } - } - } - }, - "UnauthorizedErrorRep": { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "string", - "description": "Specific error code encountered", - "example": "unauthorized" - }, - "message": { - "type": "string", - "description": "Description of the error", - "example": "Invalid access token" - } - } - }, - "UnixMillis": { - "type": "integer", - "format": "int64" - } - } - } -} \ No newline at end of file