@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api LaunchDarkly REST API
@base https://app.launchdarkly.com
@version 2.0
@auth ApiKey Authorization in header
@endpoints 363
@hint download_for_search
@toc api(363)

@endpoint GET /api/v2
@desc Root resource
@returns(200) {links: map} # Root response
@errors {429: Rate limited}

@endpoint GET /api/v2/account/relay-auto-configs
@desc List Relay Proxy configs
@returns(200) {items: [map]} # Relay auto configs collection response
@errors {401: Invalid access token, 403: Forbidden, 429: Rate limited}

@endpoint POST /api/v2/account/relay-auto-configs
@desc Create a new Relay Proxy config
@required {name: str # A human-friendly name for the Relay Proxy configuration, policy: [map{resources: [str], notResources: [str], actions: [str], notActions: [str], effect!: str}] # A description of what environments and projects the Relay Proxy should include or exclude. To learn more, read [Write an inline policy](https://launchdarkly.com/docs/sdk/relay-proxy/automatic-configuration#write-an-inline-policy).}
@returns(201) {_id: str, _creator: map{_links: map, _id: str, firstName: str, lastName: str, role: str, email: str}, _access: map{denied: [map], allowed: [map]}, name: str, policy: [map], fullKey: str, displayKey: str, creationDate: int(int64), lastModified: int(int64)} # Relay auto config response
@errors {400: Invalid request, 401: Invalid access token, 429: Rate limited}
@example_request {"name":"Sample Relay Proxy config for all proj and env","policy":[{"actions":["*"],"effect":"allow","resources":["proj/*:env/*"]}]}

@endpoint GET /api/v2/account/relay-auto-configs/{id}
@desc Get Relay Proxy config
@required {id: str(string) # The relay auto config id}
@returns(200) {_id: str, _creator: map{_links: map, _id: str, firstName: str, lastName: str, role: str, email: str}, _access: map{denied: [map], allowed: [map]}, name: str, policy: [map], fullKey: str, displayKey: str, creationDate: int(int64), lastModified: int(int64)} # Relay auto config response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint PATCH /api/v2/account/relay-auto-configs/{id}
@desc Update a Relay Proxy config
@required {id: str(string) # The relay auto config id, patch: [map{op!: str, path!: str, value: any}]}
@optional {comment: str # Optional comment}
@returns(200) {_id: str, _creator: map{_links: map, _id: str, firstName: str, lastName: str, role: str, email: str}, _access: map{denied: [map], allowed: [map]}, name: str, policy: [map], fullKey: str, displayKey: str, creationDate: int(int64), lastModified: int(int64)} # Relay auto config response
@errors {400: Invalid request, 401: Invalid access token, 404: Invalid resource identifier, 409: Status conflict, 422: Invalid patch content, 429: Rate limited}
@example_request {"patch":[{"op":"replace","path":"/policy/0","value":{"actions":["*"],"effect":"allow","resources":["proj/*:env/qa"]}}]}

@endpoint DELETE /api/v2/account/relay-auto-configs/{id}
@desc Delete Relay Proxy config by ID
@required {id: str(string) # The relay auto config id}
@returns(204) Action succeeded
@errors {401: Invalid access token, 404: Invalid resource identifier, 409: Status conflict, 429: Rate limited}

@endpoint POST /api/v2/account/relay-auto-configs/{id}/reset
@desc Reset Relay Proxy configuration key
@required {id: str(string) # The Relay Proxy configuration ID}
@optional {expiry: int(int64) # 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.}
@returns(200) {_id: str, _creator: map{_links: map, _id: str, firstName: str, lastName: str, role: str, email: str}, _access: map{denied: [map], allowed: [map]}, name: str, policy: [map], fullKey: str, displayKey: str, creationDate: int(int64), lastModified: int(int64)} # Relay auto config response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/applications
@desc Get applications
@optional {filter: str(string) # Accepts filter by `key`, `name`, `kind`, and `autoAdded`. To learn more about the filter syntax, read [Filtering applications and application versions](https://launchdarkly.com/docs/api/applications-beta#filtering-applications-and-application-versions)., limit: int(int64) # The number of applications to return. Defaults to 10., offset: int(int64) # 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`., sort: str(string) # 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., expand: str(string) # A comma-separated list of properties that can reveal additional information in the response. Options: `flags`.}
@returns(200) {_links: map, items: [map], totalCount: int} # Applications response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/applications/{applicationKey}
@desc Get application by key
@required {applicationKey: str(string) # The application key}
@optional {expand: str(string) # A comma-separated list of properties that can reveal additional information in the response. Options: `flags`.}
@returns(200) {flags: map{items: [map], totalCount: int, _links: map}, _access: map{denied: [map], allowed: [map]}, _links: map, _version: int, autoAdded: bool, creationDate: int(int64), description: str, key: str, kind: str, _maintainer: map{member: map{_links: map, _id: str, firstName: str, lastName: str, role: str, email: str}, team: map{customRoleKeys: [str], key: str, _links: map, name: str}}, name: str} # Application response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint PATCH /api/v2/applications/{applicationKey}
@desc Update application
@required {applicationKey: str(string) # The application key}
@returns(200) {flags: map{items: [map], totalCount: int, _links: map}, _access: map{denied: [map], allowed: [map]}, _links: map, _version: int, autoAdded: bool, creationDate: int(int64), description: str, key: str, kind: str, _maintainer: map{member: map{_links: map, _id: str, firstName: str, lastName: str, role: str, email: str}, team: map{customRoleKeys: [str], key: str, _links: map, name: str}}, name: str} # Application response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}
@example_request [{"op":"replace","path":"/description","value":"Updated description"}]

@endpoint DELETE /api/v2/applications/{applicationKey}
@desc Delete application
@required {applicationKey: str(string) # The application key}
@returns(204) Action succeeded
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/applications/{applicationKey}/versions
@desc Get application versions by application key
@required {applicationKey: str(string) # The application key}
@optional {filter: str(string) # Accepts filter by `key`, `name`, `supported`, and `autoAdded`. To learn more about the filter syntax, read [Filtering applications and application versions](https://launchdarkly.com/docs/api/applications-beta#filtering-applications-and-application-versions)., limit: int(int64) # The number of versions to return. Defaults to 50., offset: int(int64) # 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`., sort: str(string) # 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.}
@returns(200) {_links: map, items: [map], totalCount: int} # Application versions response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint PATCH /api/v2/applications/{applicationKey}/versions/{versionKey}
@desc Update application version
@required {applicationKey: str(string) # The application key, versionKey: str(string) # The application version key}
@returns(200) {_access: map{denied: [map], allowed: [map]}, _links: map, _version: int, autoAdded: bool, creationDate: int(int64), key: str, name: str, supported: bool} # Application version response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}
@example_request [{"op":"replace","path":"/supported","value":"false"}]

@endpoint DELETE /api/v2/applications/{applicationKey}/versions/{versionKey}
@desc Delete application version
@required {applicationKey: str(string) # The application key, versionKey: str(string) # The application version key}
@returns(204) Action succeeded
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/approval-requests
@desc List approval requests
@optional {filter: str(string) # A comma-separated list of filters. Each filter is of the form `field operator value`. Supported fields are explained above., expand: str(string) # A comma-separated list of fields to expand in the response. Supported fields are explained above., limit: int(int64) # The number of approvals to return. Defaults to 20. Maximum limit is 200., offset: int(int64) # 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`.}
@returns(200) {items: [map], totalCount: int, _links: map} # Approval request collection response
@errors {400: Unsupported filter field. Filter field must be one of: requestorId, projectKey, notifyMemberIds, reviewStatus, or status, 401: Invalid access token, 403: Forbidden, 429: Rate limited}

@endpoint POST /api/v2/approval-requests
@desc Create approval request
@required {resourceId: str # String representation of the resource specifier, description: str # A brief description of the changes you're requesting, instructions: [map]}
@optional {comment: str # Optional comment describing the approval request, notifyMemberIds: [str] # An array of member IDs. These members are notified to review the approval request., notifyTeamKeys: [str] # An array of team keys. The members of these teams are notified to review the approval request., integrationConfig: map}
@returns(201) {_id: str, _version: int, creationDate: int(int64), serviceKind: str, requestorId: str, description: str, reviewStatus: str, allReviews: [map], notifyMemberIds: [str], appliedDate: int(int64), appliedByMemberId: str, appliedByServiceTokenId: str, status: str, instructions: [map], conflicts: [map], _links: map, executionDate: int(int64), operatingOnId: str, integrationMetadata: map{externalId: str, externalStatus: map{display: str, value: str}, externalUrl: str, lastChecked: int(int64)}, source: map{key: str, version: int}, customWorkflowMetadata: map{name: str, stage: map{index: int, name: str}}, resourceId: str, approvalSettings: map{required: bool, bypassApprovalsForPendingChanges: bool, minNumApprovals: int, canReviewOwnRequest: bool, canApplyDeclinedChanges: bool, autoApplyApprovedChanges: bool, serviceKind: str, serviceConfig: map, requiredApprovalTags: [str], serviceKindConfigurationId: str}} # Approval request response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 429: Rate limited}

@endpoint GET /api/v2/approval-requests/{id}
@desc Get approval request
@required {id: str(string) # The approval request ID}
@optional {expand: str(string) # A comma-separated list of fields to expand in the response. Supported fields are explained above.}
@returns(200) {_id: str, _version: int, creationDate: int(int64), serviceKind: str, requestorId: str, description: str, reviewStatus: str, allReviews: [map], notifyMemberIds: [str], appliedDate: int(int64), appliedByMemberId: str, appliedByServiceTokenId: str, status: str, instructions: [map], conflicts: [map], _links: map, executionDate: int(int64), operatingOnId: str, integrationMetadata: map{externalId: str, externalStatus: map{display: str, value: str}, externalUrl: str, lastChecked: int(int64)}, source: map{key: str, version: int}, customWorkflowMetadata: map{name: str, stage: map{index: int, name: str}}, resourceId: str, approvalSettings: map{required: bool, bypassApprovalsForPendingChanges: bool, minNumApprovals: int, canReviewOwnRequest: bool, canApplyDeclinedChanges: bool, autoApplyApprovedChanges: bool, serviceKind: str, serviceConfig: map, requiredApprovalTags: [str], serviceKindConfigurationId: str}, project: map{_links: map, _id: str, key: str, includeInSnippetByDefault: bool, defaultClientSideAvailability: map{usingMobileKey: bool, usingEnvironmentId: bool}, name: str, _access: map{denied: [map], allowed: [map]}, tags: [str], defaultReleasePipelineKey: str, environments: map{_links: map, totalCount: int, items: [map]}}, environments: [map], flag: map{name: str, kind: str, description: str, key: str, _version: int, creationDate: int(int64), includeInSnippet: bool, clientSideAvailability: map{usingMobileKey: bool, usingEnvironmentId: bool}, variations: [map], temporary: bool, tags: [str], _links: map, maintainerId: str, _maintainer: map{_links: map, _id: str, firstName: str, lastName: str, role: str, email: str}, customProperties: map, archived: bool, archivedDate: int(int64), defaults: map{onVariation: int, offVariation: int}}, resource: map{kind: str, aiConfig: map{key: str, name: str}, experiment: map{key: str, name: str, _access: map{denied: [map], allowed: [map]}}, flag: map{name: str, kind: str, description: str, key: str, _version: int, creationDate: int(int64), includeInSnippet: bool, clientSideAvailability: map{usingMobileKey: bool, usingEnvironmentId: bool}, variations: [map], temporary: bool, tags: [str], _links: map, maintainerId: str, _maintainer: map{_links: map, _id: str, firstName: str, lastName: str, role: str, email: str}, customProperties: map, archived: bool, archivedDate: int(int64), defaults: map{onVariation: int, offVariation: int}}, segment: map{name: str, description: str, tags: [str], creationDate: int(int64), lastModifiedDate: int(int64), key: str, included: [str], excluded: [str], includedContexts: [map], excludedContexts: [map], _links: map, rules: [map], version: int, deleted: bool, _access: map{denied: [map], allowed: [map]}, _flags: [map], unbounded: bool, unboundedContextKind: str, generation: int, _unboundedMetadata: map{envId: str, segmentId: str, version: int, includedCount: int, excludedCount: int, lastModified: int(int64), deleted: bool}, _external: str, _externalLink: str, _importInProgress: bool}}} # Approval request response
@errors {400: Invalid Request, 401: Invalid access token, 403: Forbidden, 404: Unable to find approval request, 429: Rate limited}

@endpoint PATCH /api/v2/approval-requests/{id}
@desc Update approval request
@required {id: str(string) # The approval ID, instructions: [map]}
@optional {comment: str # Optional comment describing the update}
@returns(200) {_id: str, _version: int, creationDate: int(int64), serviceKind: str, requestorId: str, description: str, reviewStatus: str, allReviews: [map], notifyMemberIds: [str], appliedDate: int(int64), appliedByMemberId: str, appliedByServiceTokenId: str, status: str, instructions: [map], conflicts: [map], _links: map, executionDate: int(int64), operatingOnId: str, integrationMetadata: map{externalId: str, externalStatus: map{display: str, value: str}, externalUrl: str, lastChecked: int(int64)}, source: map{key: str, version: int}, customWorkflowMetadata: map{name: str, stage: map{index: int, name: str}}} # Approval request response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}
@example_request {"instructions":[{"kind":"updateDescription","value":"New description"}]}

@endpoint DELETE /api/v2/approval-requests/{id}
@desc Delete approval request
@required {id: str(string) # The approval request ID}
@returns(204) Action succeeded
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint POST /api/v2/approval-requests/{id}/apply
@desc Apply approval request
@required {id: str(string) # The approval request ID}
@optional {comment: str # Optional comment about the approval request}
@returns(200) {_id: str, _version: int, creationDate: int(int64), serviceKind: str, requestorId: str, description: str, reviewStatus: str, allReviews: [map], notifyMemberIds: [str], appliedDate: int(int64), appliedByMemberId: str, appliedByServiceTokenId: str, status: str, instructions: [map], conflicts: [map], _links: map, executionDate: int(int64), operatingOnId: str, integrationMetadata: map{externalId: str, externalStatus: map{display: str, value: str}, externalUrl: str, lastChecked: int(int64)}, source: map{key: str, version: int}, customWorkflowMetadata: map{name: str, stage: map{index: int, name: str}}, resourceId: str, approvalSettings: map{required: bool, bypassApprovalsForPendingChanges: bool, minNumApprovals: int, canReviewOwnRequest: bool, canApplyDeclinedChanges: bool, autoApplyApprovedChanges: bool, serviceKind: str, serviceConfig: map, requiredApprovalTags: [str], serviceKindConfigurationId: str}} # Approval request apply response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint POST /api/v2/approval-requests/{id}/reviews
@desc Review approval request
@required {id: str(string) # The approval request ID}
@optional {kind: str(approve/comment/decline) # The type of review for this approval request, comment: str # Optional comment about the approval request}
@returns(200) {_id: str, _version: int, creationDate: int(int64), serviceKind: str, requestorId: str, description: str, reviewStatus: str, allReviews: [map], notifyMemberIds: [str], appliedDate: int(int64), appliedByMemberId: str, appliedByServiceTokenId: str, status: str, instructions: [map], conflicts: [map], _links: map, executionDate: int(int64), operatingOnId: str, integrationMetadata: map{externalId: str, externalStatus: map{display: str, value: str}, externalUrl: str, lastChecked: int(int64)}, source: map{key: str, version: int}, customWorkflowMetadata: map{name: str, stage: map{index: int, name: str}}, resourceId: str, approvalSettings: map{required: bool, bypassApprovalsForPendingChanges: bool, minNumApprovals: int, canReviewOwnRequest: bool, canApplyDeclinedChanges: bool, autoApplyApprovedChanges: bool, serviceKind: str, serviceConfig: map, requiredApprovalTags: [str], serviceKindConfigurationId: str}} # Approval request review response
@errors {400: Invalid request, 401: Invalid access token, 404: Invalid resource identifier, 405: Method not allowed, 409: Status conflict, 429: Rate limited}

@endpoint GET /api/v2/auditlog
@desc List audit log entries
@optional {before: int(int64) # A timestamp filter, expressed as a Unix epoch time in milliseconds.  All entries this returns occurred before the timestamp., after: int(int64) # A timestamp filter, expressed as a Unix epoch time in milliseconds. All entries this returns occurred after the timestamp., q: str(string) # Text to search for. You can search for the full or partial name of the resource., limit: int(int64) # A limit on the number of audit log entries that return. Set between 1 and 20. The default is 10., spec: str(string) # A resource specifier that lets you filter audit log listings by resource}
@returns(200) {items: [map], _links: map} # Audit log entries response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 429: Rate limited}

@endpoint POST /api/v2/auditlog
@desc Search audit log entries
@optional {before: int(int64) # A timestamp filter, expressed as a Unix epoch time in milliseconds.  All entries returned occurred before the timestamp., after: int(int64) # A timestamp filter, expressed as a Unix epoch time in milliseconds. All entries returned occurred after the timestamp., q: str(string) # Text to search for. You can search for the full or partial name of the resource., limit: int(int64) # A limit on the number of audit log entries that return. Set between 1 and 20. The default is 10.}
@returns(200) {items: [map], _links: map} # Audit log entries response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 429: Rate limited}

@endpoint POST /api/v2/auditlog/counts
@desc Get audit log entry counts
@required {after: int(int64) # A timestamp filter, expressed as a Unix epoch time in milliseconds. Required.}
@optional {before: int(int64) # A timestamp filter, expressed as a Unix epoch time in milliseconds. Defaults to now., buckets: int(int64) # Number of time buckets to divide the range into. Default 50, max 500.}
@returns(200) {buckets: [map], totalCount: int(int64), bucketIntervalMs: int(int64)} # Audit log entry counts response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 429: Rate limited}

@endpoint GET /api/v2/auditlog/{id}
@desc Get audit log entry
@required {id: str(string) # The ID of the audit log entry}
@returns(200) {_links: map, _id: str, _accountId: str, date: int(int64), accesses: [map], kind: str, name: str, description: str, shortDescription: str, comment: str, subject: map{_links: map, name: str, avatarUrl: str}, member: map{_links: map, _id: str, email: str, firstName: str, lastName: str}, token: map{_links: map, _id: str, name: str, ending: str, serviceToken: bool}, app: map{_links: map, _id: str, isScim: bool, name: str, maintainerName: str}, titleVerb: str, title: str, target: map{_links: map, name: str, resources: [str]}, parent: map{_links: map, name: str, resource: str}, delta: any, triggerBody: any, merge: any, previousVersion: any, currentVersion: any, subentries: [map]} # Audit log entry response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/caller-identity
@desc Identify the caller
@returns(200) {accountId: str, environmentId: str, projectId: str, environmentName: str, projectName: str, authKind: str, tokenKind: str, clientId: str, tokenName: str, tokenId: str, memberId: str, serviceToken: bool, scopes: [str]} # Caller Identity
@errors {401: Invalid access token, 429: Rate limited}

@endpoint GET /api/v2/code-refs/extinctions
@desc List extinctions
@optional {repoName: str(string) # Filter results to a specific repository, branchName: str(string) # Filter results to a specific branch. By default, only the default branch will be queried for extinctions., projKey: str(string) # Filter results to a specific project, flagKey: str(string) # Filter results to a specific flag key, from: int(int64) # Filter results to a specific timeframe based on commit time, expressed as a Unix epoch time in milliseconds. Must be used with `to`., to: int(int64) # Filter results to a specific timeframe based on commit time, expressed as a Unix epoch time in milliseconds. Must be used with `from`.}
@returns(200) {_links: map, items: map} # Extinction collection response
@errors {401: Invalid access token, 403: Forbidden, 429: Rate limited}

@endpoint GET /api/v2/code-refs/repositories
@desc List repositories
@optional {withBranches: str(string) # If set to any value, the endpoint returns repositories with associated branch data, withReferencesForDefaultBranch: str(string) # If set to any value, the endpoint returns repositories with associated branch data, as well as code references for the default git branch, projKey: str(string) # A LaunchDarkly project key. If provided, this filters code reference results to the specified project., flagKey: str(string) # If set to any value, the endpoint returns repositories with associated branch data, as well as code references for the default git branch}
@returns(200) {_links: map, items: [map]} # Repository collection response
@errors {401: Invalid access token, 403: Forbidden, 429: Rate limited}

@endpoint POST /api/v2/code-refs/repositories
@desc Create repository
@required {name: str # The repository name}
@optional {sourceLink: str # A URL to access the repository, commitUrlTemplate: str # A template for constructing a valid URL to view the commit, hunkUrlTemplate: str # A template for constructing a valid URL to view the hunk, type: str(bitbucket/custom/github/gitlab) # The type of repository. If not specified, the default value is custom., defaultBranch: str # The repository's default branch. If not specified, the default value is main.}
@returns(200) {name: str, sourceLink: str, commitUrlTemplate: str, hunkUrlTemplate: str, type: str, defaultBranch: str, enabled: bool, version: int, branches: [map], _links: map, _access: map{denied: [map], allowed: [map]}} # Repository response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 409: Status conflict, 429: Rate limited}

@endpoint GET /api/v2/code-refs/repositories/{repo}
@desc Get repository
@required {repo: str(string) # The repository name}
@returns(200) {name: str, sourceLink: str, commitUrlTemplate: str, hunkUrlTemplate: str, type: str, defaultBranch: str, enabled: bool, version: int, branches: [map], _links: map, _access: map{denied: [map], allowed: [map]}} # Repository response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint PATCH /api/v2/code-refs/repositories/{repo}
@desc Update repository
@required {repo: str(string) # The repository name}
@returns(200) {name: str, sourceLink: str, commitUrlTemplate: str, hunkUrlTemplate: str, type: str, defaultBranch: str, enabled: bool, version: int, branches: [map], _links: map, _access: map{denied: [map], allowed: [map]}} # Repository response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}
@example_request [{"op":"replace","path":"/defaultBranch","value":"main"}]

@endpoint DELETE /api/v2/code-refs/repositories/{repo}
@desc Delete repository
@required {repo: str(string) # The repository name}
@returns(204) Action succeeded
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint POST /api/v2/code-refs/repositories/{repo}/branch-delete-tasks
@desc Delete branches
@required {repo: str(string) # The repository name to delete branches for.}
@returns(200) Action succeeded
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}
@example_request ["branch-to-be-deleted","another-branch-to-be-deleted"]

@endpoint GET /api/v2/code-refs/repositories/{repo}/branches
@desc List branches
@required {repo: str(string) # The repository name}
@returns(200) {_links: map, items: [map]} # Branch collection response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/code-refs/repositories/{repo}/branches/{branch}
@desc Get branch
@required {repo: str(string) # The repository name, branch: str(string) # The url-encoded branch name}
@optional {projKey: str(string) # Filter results to a specific project, flagKey: str(string) # Filter results to a specific flag key}
@returns(200) {name: str, head: str, updateSequenceId: int(int64), syncTime: int(int64), references: [map], _links: map} # Branch response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint PUT /api/v2/code-refs/repositories/{repo}/branches/{branch}
@desc Upsert branch
@required {repo: str(string) # The repository name, branch: str(string) # The URL-encoded branch name, name: str # The branch name, head: str # An ID representing the branch HEAD. For example, a commit SHA., syncTime: int(int64)}
@optional {updateSequenceId: int(int64) # 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., references: [map{path!: str, hint: str, hunks!: [map]}] # An array of flag references found on the branch, commitTime: int(int64)}
@returns(200) Action succeeded
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 409: Status conflict, 429: Rate limited}

@endpoint POST /api/v2/code-refs/repositories/{repo}/branches/{branch}/extinction-events
@desc Create extinction
@required {repo: str(string) # The repository name, branch: str(string) # The URL-encoded branch name}
@returns(200) Action succeeded
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/code-refs/statistics
@desc Get links to code reference repositories for each project
@returns(200) {projects: [map], self: map{href: str, type: str}} # Statistic root response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/code-refs/statistics/{projectKey}
@desc Get code references statistics for flags
@required {projectKey: str(string) # The project key}
@optional {flagKey: str(string) # Filter results to a specific flag key}
@returns(200) {flags: map, _links: map} # Statistic collection response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/destinations
@desc List destinations
@returns(200) {_links: map, items: [map]} # Destination collection response
@errors {401: Invalid access token, 403: Forbidden, 429: Rate limited}

@endpoint POST /api/v2/destinations/generate-warehouse-destination-key-pair
@desc Generate Snowflake destination key pair
@returns(201) {public_key: str, public_key_pkcs8: str} # Generate warehouse destination key pair response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 409: Status conflict, 429: Rate limited}

@endpoint POST /api/v2/destinations/projects/{projKey}/environments/{envKey}/generate-trust-policy
@desc Generate trust policy
@required {projKey: str(string) # The project key, envKey: str(string) # The environment key}
@returns(201) {awsTrustPolicy: map{Version: str, Statement: [map]}} # Generate trust policy response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 409: Status conflict, 429: Rate limited}

@endpoint POST /api/v2/destinations/projects/{projKey}/environments/{envKey}/generate-warehouse-destination-key-pair
@desc Generate Snowflake destination key pair
@required {projKey: str(string) # The project key, envKey: str(string) # The environment key}
@returns(201) {public_key: str, public_key_pkcs8: str} # Generate warehouse destination key pair response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 409: Status conflict, 429: Rate limited}

@endpoint POST /api/v2/destinations/{projectKey}/{environmentKey}
@desc Create Data Export destination
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key}
@optional {name: str # A human-readable name for your Data Export destination, kind: str(google-pubsub/kinesis/mparticle/segment/azure-event-hubs/snowflake-v2/databricks/bigquery/redshift) # The type of Data Export destination, config: any # An object with the configuration parameters required for the destination type, on: bool # Whether the export is on. Displayed as the integration status in the LaunchDarkly UI.}
@returns(201) {_id: str, _links: map, name: str, kind: str, version: num, config: any, on: bool, _access: map{denied: [map], allowed: [map]}} # Destination response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 409: Status conflict, 429: Rate limited}
@example_request {"config":{"project":"test-prod","topic":"ld-pubsub-test-192301"},"kind":"google-pubsub"}

@endpoint GET /api/v2/destinations/{projectKey}/{environmentKey}/{id}
@desc Get destination
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, id: str(string) # The Data Export destination ID}
@returns(200) {_id: str, _links: map, name: str, kind: str, version: num, config: any, on: bool, _access: map{denied: [map], allowed: [map]}} # Destination response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint PATCH /api/v2/destinations/{projectKey}/{environmentKey}/{id}
@desc Update Data Export destination
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, id: str(string) # The Data Export destination ID}
@returns(200) {_id: str, _links: map, name: str, kind: str, version: num, config: any, on: bool, _access: map{denied: [map], allowed: [map]}} # Destination response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 409: Status conflict, 429: Rate limited}
@example_request [{"op":"replace","path":"/config/topic","value":"ld-pubsub-test-192302"}]

@endpoint DELETE /api/v2/destinations/{projectKey}/{environmentKey}/{id}
@desc Delete Data Export destination
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, id: str(string) # The Data Export destination ID}
@returns(204) Destination response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/flag-links/projects/{projectKey}/flags/{featureFlagKey}
@desc List flag links
@required {projectKey: str(string) # The project key, featureFlagKey: str(string) # The feature flag key}
@returns(200) {items: [map], _links: map} # Flag link collection response
@errors {401: Invalid access token, 403: Forbidden, 429: Rate limited}

@endpoint POST /api/v2/flag-links/projects/{projectKey}/flags/{featureFlagKey}
@desc Create flag link
@required {projectKey: str(string) # The project key, featureFlagKey: str(string) # The feature flag key}
@optional {key: str # The flag link key, integrationKey: str # 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: int(int64), deepLink: str # The URL for the external resource you are linking the flag to, title: str # The title of the flag link, description: str # The description of the flag link, metadata: map # 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.}
@returns(201) {_links: map, _key: str, _integrationKey: str, _id: str, _deepLink: str, _timestamp: map{milliseconds: int(int64), seconds: int(int64), rfc3339: str, simple: str}, title: str, description: str, _metadata: map, _createdAt: int(int64), _member: map{_links: map, _id: str, firstName: str, lastName: str}} # Flag link response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}
@example_request {"deepLink":"https://example.com/archives/123123123","description":"Example link description","key":"flag-link-key-123abc","title":"Example link title"}

@endpoint PATCH /api/v2/flag-links/projects/{projectKey}/flags/{featureFlagKey}/{id}
@desc Update flag link
@required {projectKey: str(string) # The project key, featureFlagKey: str(string) # The feature flag key, id: str(string) # The flag link ID}
@returns(200) {_links: map, _key: str, _integrationKey: str, _id: str, _deepLink: str, _timestamp: map{milliseconds: int(int64), seconds: int(int64), rfc3339: str, simple: str}, title: str, description: str, _metadata: map, _createdAt: int(int64), _member: map{_links: map, _id: str, firstName: str, lastName: str}} # Flag link response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 409: Status conflict, 429: Rate limited}
@example_request [{"op":"replace","path":"/title","value":"Updated flag link title"}]

@endpoint DELETE /api/v2/flag-links/projects/{projectKey}/flags/{featureFlagKey}/{id}
@desc Delete flag link
@required {projectKey: str(string) # The project key, featureFlagKey: str(string) # The feature flag key, id: str(string) # The flag link ID or Key}
@returns(204) Action succeeded
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/flag-status/{projectKey}/{featureFlagKey}
@desc Get flag status across environments
@required {projectKey: str(string) # The project key, featureFlagKey: str(string) # The feature flag key}
@optional {env: str(string) # Optional environment filter}
@returns(200) {environments: map, key: str, _links: map} # Flag status across environments response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/flag-statuses/{projectKey}/{environmentKey}
@desc List feature flag statuses
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key}
@returns(200) {_links: map, items: [map]} # Flag Statuses collection response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/flag-statuses/{projectKey}/{environmentKey}/{featureFlagKey}
@desc Get feature flag status
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, featureFlagKey: str(string) # The feature flag key}
@returns(200) {name: str, lastRequested: str(date-time), default: any, _links: map} # Flag status response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/flags/{projectKey}
@desc List feature flags
@required {projectKey: str(string) # The project key}
@optional {env: str(string) # Filter configurations by environment, tag: str(string) # Filter feature flags by tag, limit: int(int64) # The number of feature flags to return. Defaults to 20., offset: int(int64) # 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`., archived: bool # 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, summary: bool # By default, flags do _not_ include their lists of prerequisites, targets, or rules for each environment. Set `summary=0` and include the `env` query parameter to include these fields for each flag returned., filter: str(string) # 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., sort: str(string) # 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., compare: bool # Deprecated, unavailable in API version `20240415`. A boolean to filter results by only flags that have differences between environments., expand: str(string) # A comma-separated list of fields to expand in the response. Supported fields are explained above.}
@returns(200) {items: [map], _links: map, totalCount: int, totalCountWithDifferences: int} # Global flags collection response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint POST /api/v2/flags/{projectKey}
@desc Create a feature flag
@required {projectKey: str(string) # The project key, name: str # A human-friendly name for the feature flag, key: str # A unique key used to reference the flag in your code}
@optional {clone: str(string) # 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., description: str # Description of the feature flag. Defaults to an empty string., includeInSnippet: bool # Deprecated, use clientSideAvailability. Whether this flag should be made available to the client-side JavaScript SDK. Defaults to false., clientSideAvailability: map{usingEnvironmentId!: bool, usingMobileKey!: bool}, variations: [map{_id: str, value!: any, description: str, name: str}] # 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., temporary: bool # Whether the flag is a temporary flag. Defaults to true., tags: [str] # Tags for the feature flag. Defaults to an empty array., customProperties: map, defaults: map{onVariation!: int, offVariation!: int}, purpose: str(migration/holdout) # Purpose of the flag, migrationSettings: map{contextKind: str, stageCount!: int}, maintainerId: str # The ID of the member who maintains this feature flag, maintainerTeamKey: str # The key of the team that maintains this feature flag, initialPrerequisites: [map{key!: str, variationId!: str}] # Initial set of prerequisite flags for all environments, isFlagOn: bool # Whether to automatically turn the flag on across all environments at creation. Defaults to false.}
@returns(201) {name: str, kind: str, description: str, key: str, _version: int, creationDate: int(int64), includeInSnippet: bool, clientSideAvailability: map{usingMobileKey: bool, usingEnvironmentId: bool}, variations: [map], temporary: bool, tags: [str], _links: map, maintainerId: str, _maintainer: map{_links: map, _id: str, firstName: str, lastName: str, role: str, email: str}, maintainerTeamKey: str, _maintainerTeam: map{key: str, name: str, _links: map}, goalIds: [str], experiments: map{baselineIdx: int, items: [map]}, customProperties: map, archived: bool, archivedDate: int(int64), deprecated: bool, deprecatedDate: int(int64), defaults: map{onVariation: int, offVariation: int}, _purpose: str, migrationSettings: map{contextKind: str, stageCount: int}, environments: map} # Global flag response
@errors {400: Invalid request, 401: Invalid access token, 409: Status conflict, 429: Rate limited}
@example_request {"clientSideAvailability":{"usingEnvironmentId":true,"usingMobileKey":true},"key":"flag-key-123abc","name":"My Flag"}

@endpoint GET /api/v2/flags/{projectKey}/{environmentKey}/{featureFlagKey}/dependent-flags
@desc List dependent feature flags by environment
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, featureFlagKey: str(string) # The feature flag key}
@returns(200) {items: [map], _links: map, _site: map{href: str, type: str}} # Dependent flags collection response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/flags/{projectKey}/{featureFlagKey}
@desc Get feature flag
@required {projectKey: str(string) # The project key, featureFlagKey: str(string) # The feature flag key}
@optional {env: str(string) # Filter configurations by environment, expand: str(string) # A comma-separated list of fields to expand in the response. Supported fields are explained above.}
@returns(200) {name: str, kind: str, description: str, key: str, _version: int, creationDate: int(int64), includeInSnippet: bool, clientSideAvailability: map{usingMobileKey: bool, usingEnvironmentId: bool}, variations: [map], temporary: bool, tags: [str], _links: map, maintainerId: str, _maintainer: map{_links: map, _id: str, firstName: str, lastName: str, role: str, email: str}, maintainerTeamKey: str, _maintainerTeam: map{key: str, name: str, _links: map}, goalIds: [str], experiments: map{baselineIdx: int, items: [map]}, customProperties: map, archived: bool, archivedDate: int(int64), deprecated: bool, deprecatedDate: int(int64), defaults: map{onVariation: int, offVariation: int}, _purpose: str, migrationSettings: map{contextKind: str, stageCount: int}, environments: map} # Global flag response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint PATCH /api/v2/flags/{projectKey}/{featureFlagKey}
@desc Update feature flag
@required {projectKey: str(string) # The project key, featureFlagKey: str(string) # The feature flag key. The key identifies the flag in your code., patch: [map{op!: str, path!: str, value: any}]}
@optional {ignoreConflicts: bool # If true, the patch will be applied even if it causes a pending scheduled change or approval request to fail., dryRun: bool # If true, the patch will be validated but not persisted. Returns a preview of the flag after the patch is applied., comment: str # Optional comment}
@returns(200) {name: str, kind: str, description: str, key: str, _version: int, creationDate: int(int64), includeInSnippet: bool, clientSideAvailability: map{usingMobileKey: bool, usingEnvironmentId: bool}, variations: [map], temporary: bool, tags: [str], _links: map, maintainerId: str, _maintainer: map{_links: map, _id: str, firstName: str, lastName: str, role: str, email: str}, maintainerTeamKey: str, _maintainerTeam: map{key: str, name: str, _links: map}, goalIds: [str], experiments: map{baselineIdx: int, items: [map]}, customProperties: map, archived: bool, archivedDate: int(int64), deprecated: bool, deprecatedDate: int(int64), defaults: map{onVariation: int, offVariation: int}, _purpose: str, migrationSettings: map{contextKind: str, stageCount: int}, environments: map} # Global flag response
@errors {400: Invalid request, 401: Invalid access token, 404: Invalid resource identifier, 405: Approval is required to make this request, 409: Status conflict, 429: Rate limited}
@example_request {"patch":[{"op":"replace","path":"/description","value":"New description for this flag"}]}

@endpoint DELETE /api/v2/flags/{projectKey}/{featureFlagKey}
@desc Delete feature flag
@required {projectKey: str(string) # The project key, featureFlagKey: str(string) # The feature flag key. The key identifies the flag in your code.}
@returns(204) Action succeeded
@errors {401: Invalid access token, 404: Invalid resource identifier, 409: Status conflict, 429: Rate limited}

@endpoint POST /api/v2/flags/{projectKey}/{featureFlagKey}/copy
@desc Copy feature flag
@required {projectKey: str(string) # The project key, featureFlagKey: str(string) # The feature flag key. The key identifies the flag in your code., source: map{key!: str, currentVersion: int}, target: map{key!: str, currentVersion: int}}
@optional {comment: str # Optional comment, includedActions: [str] # 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., excludedActions: [str] # 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.}
@returns(201) {name: str, kind: str, description: str, key: str, _version: int, creationDate: int(int64), includeInSnippet: bool, clientSideAvailability: map{usingMobileKey: bool, usingEnvironmentId: bool}, variations: [map], temporary: bool, tags: [str], _links: map, maintainerId: str, _maintainer: map{_links: map, _id: str, firstName: str, lastName: str, role: str, email: str}, maintainerTeamKey: str, _maintainerTeam: map{key: str, name: str, _links: map}, goalIds: [str], experiments: map{baselineIdx: int, items: [map]}, customProperties: map, archived: bool, archivedDate: int(int64), deprecated: bool, deprecatedDate: int(int64), defaults: map{onVariation: int, offVariation: int}, _purpose: str, migrationSettings: map{contextKind: str, stageCount: int}, environments: map} # Global flag response
@errors {400: Invalid request, 401: Invalid access token, 405: Method not allowed, 409: Status conflict, 429: Rate limited}
@example_request {"comment":"optional comment","source":{"currentVersion":1,"key":"source-env-key-123abc"},"target":{"currentVersion":1,"key":"target-env-key-123abc"}}

@endpoint GET /api/v2/flags/{projectKey}/{featureFlagKey}/dependent-flags
@desc List dependent feature flags
@required {projectKey: str(string) # The project key, featureFlagKey: str(string) # The feature flag key}
@returns(200) {items: [map], _links: map, _site: map{href: str, type: str}} # Multi environment dependent flags collection response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/flags/{projectKey}/{featureFlagKey}/expiring-targets/{environmentKey}
@desc Get expiring context targets for feature flag
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, featureFlagKey: str(string) # The feature flag key}
@returns(200) {items: [map], _links: map} # Expiring target response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint PATCH /api/v2/flags/{projectKey}/{featureFlagKey}/expiring-targets/{environmentKey}
@desc Update expiring context targets on feature flag
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, featureFlagKey: str(string) # The feature flag key, instructions: [map] # The instructions to perform when updating}
@optional {comment: str # Optional comment describing the change}
@returns(200) {items: [map], _links: map, totalInstructions: int, successfulInstructions: int, failedInstructions: int, errors: [map]} # Expiring target response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/flags/{projectKey}/{featureFlagKey}/expiring-user-targets/{environmentKey}
@desc Get expiring user targets for feature flag
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, featureFlagKey: str(string) # The feature flag key}
@returns(200) {items: [map], _links: map} # Expiring user target response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint PATCH /api/v2/flags/{projectKey}/{featureFlagKey}/expiring-user-targets/{environmentKey}
@desc Update expiring user targets on feature flag
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, featureFlagKey: str(string) # The feature flag key, instructions: [map] # The instructions to perform when updating}
@optional {comment: str # Optional comment describing the change}
@returns(200) {items: [map], _links: map, totalInstructions: int, successfulInstructions: int, failedInstructions: int, errors: [map]} # Expiring user target response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/flags/{projectKey}/{featureFlagKey}/triggers/{environmentKey}
@desc List flag triggers
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, featureFlagKey: str(string) # The feature flag key}
@returns(200) {items: [map], _links: map} # Flag trigger collection response
@errors {401: Invalid access token, 403: Forbidden, 429: Rate limited}

@endpoint POST /api/v2/flags/{projectKey}/{featureFlagKey}/triggers/{environmentKey}
@desc Create flag trigger
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, featureFlagKey: str(string) # The feature flag key, integrationKey: str # The unique identifier of the integration for your trigger. Use generic-trigger for integrations not explicitly supported.}
@optional {comment: str # Optional comment describing the trigger, instructions: [map] # 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.}
@returns(201) {_id: str, _version: int, _creationDate: int(int64), _maintainerId: str, _maintainer: map{_links: map, _id: str, firstName: str, lastName: str, role: str, email: str}, enabled: bool, _integrationKey: str, instructions: [map], _lastTriggeredAt: int(int64), _recentTriggerBodies: [map], _triggerCount: int, triggerURL: str, _links: map} # Flag trigger response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/flags/{projectKey}/{featureFlagKey}/triggers/{environmentKey}/{id}
@desc Get flag trigger by ID
@required {projectKey: str(string) # The project key, featureFlagKey: str(string) # The feature flag key, environmentKey: str(string) # The environment key, id: str(string) # The flag trigger ID}
@returns(200) {_id: str, _version: int, _creationDate: int(int64), _maintainerId: str, _maintainer: map{_links: map, _id: str, firstName: str, lastName: str, role: str, email: str}, enabled: bool, _integrationKey: str, instructions: [map], _lastTriggeredAt: int(int64), _recentTriggerBodies: [map], _triggerCount: int, triggerURL: str, _links: map} # Flag trigger response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint PATCH /api/v2/flags/{projectKey}/{featureFlagKey}/triggers/{environmentKey}/{id}
@desc Update flag trigger
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, featureFlagKey: str(string) # The feature flag key, id: str(string) # The flag trigger ID}
@optional {comment: str # Optional comment describing the update, instructions: [map] # The instructions to perform when updating. This should be an array with objects that look like {"kind": "trigger_action"}.}
@returns(200) {_id: str, _version: int, _creationDate: int(int64), _maintainerId: str, _maintainer: map{_links: map, _id: str, firstName: str, lastName: str, role: str, email: str}, enabled: bool, _integrationKey: str, instructions: [map], _lastTriggeredAt: int(int64), _recentTriggerBodies: [map], _triggerCount: int, triggerURL: str, _links: map} # Flag trigger response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 409: Status conflict, 429: Rate limited}

@endpoint DELETE /api/v2/flags/{projectKey}/{featureFlagKey}/triggers/{environmentKey}/{id}
@desc Delete flag trigger
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, featureFlagKey: str(string) # The feature flag key, id: str(string) # The flag trigger ID}
@returns(204) Action succeeded
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/flags/{projectKey}/{flagKey}/release
@desc Get release for flag
@required {projectKey: str(string) # The project key, flagKey: str(string) # The flag key}
@returns(200) {_links: map, name: str, releasePipelineKey: str, releasePipelineDescription: str, phases: [map], _version: int, _releaseVariationId: str, _canceledAt: int(int64)} # Release response
@errors {404: Invalid resource identifier}

@endpoint PATCH /api/v2/flags/{projectKey}/{flagKey}/release
@desc Patch release for flag
@required {projectKey: str(string) # The project key, flagKey: str(string) # The flag key}
@returns(200) {_links: map, name: str, releasePipelineKey: str, releasePipelineDescription: str, phases: [map], _version: int, _releaseVariationId: str, _canceledAt: int(int64)} # Release response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}
@example_request [{"op":"replace","path":"/phases/0/complete","value":true}]

@endpoint DELETE /api/v2/flags/{projectKey}/{flagKey}/release
@desc Delete a release for flag
@required {projectKey: str(string) # The project key, flagKey: str(string) # The flag key}
@returns(204) Action succeeded
@errors {403: Forbidden, 404: Invalid resource identifier}

@endpoint GET /api/v2/integration-capabilities/big-segment-store
@desc List all big segment store integrations
@returns(200) {_links: map{self: map{href: str, type: str}, parent: map{href: str, type: str}}, items: [map]} # Big segment store collection response
@errors {401: Invalid access token, 403: Forbidden, 404: Environment or project not found, 429: Rate limited}

@endpoint POST /api/v2/integration-capabilities/big-segment-store/{projectKey}/{environmentKey}/{integrationKey}
@desc Create big segment store integration
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, integrationKey: str(string) # The integration key, either `redis` or `dynamodb`, config: map}
@optional {on: bool # Whether the integration configuration is active. Default value is false., tags: [str] # Tags to associate with the integration, name: str # Name to identify the integration}
@returns(201) {_links: map{self: map{href: str, type: str}, parent: map{href: str, type: str}, project: map{href: str, type: str}, environment: map{href: str, type: str}}, _id: str, integrationKey: str, projectKey: str, environmentKey: str, config: map, on: bool, tags: [str], name: str, version: int, _access: map{denied: [map], allowed: [map]}, _status: map{available: bool, potentiallyStale: bool, lastSync: int(int64), lastError: int(int64), errors: [map]}} # Big segment store response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Environment or project not found, 409: Status conflict, 429: Rate limited}
@example_request {"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"]}

@endpoint GET /api/v2/integration-capabilities/big-segment-store/{projectKey}/{environmentKey}/{integrationKey}/{integrationId}
@desc Get big segment store integration by ID
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, integrationKey: str(string) # The integration key, either `redis` or `dynamodb`, integrationId: str(string) # The integration ID}
@returns(200) {_links: map{self: map{href: str, type: str}, parent: map{href: str, type: str}, project: map{href: str, type: str}, environment: map{href: str, type: str}}, _id: str, integrationKey: str, projectKey: str, environmentKey: str, config: map, on: bool, tags: [str], name: str, version: int, _access: map{denied: [map], allowed: [map]}, _status: map{available: bool, potentiallyStale: bool, lastSync: int(int64), lastError: int(int64), errors: [map]}} # Big segment store response
@errors {401: Invalid access token, 403: Forbidden, 404: Environment or project not found, 429: Rate limited}

@endpoint PATCH /api/v2/integration-capabilities/big-segment-store/{projectKey}/{environmentKey}/{integrationKey}/{integrationId}
@desc Update big segment store integration
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, integrationKey: str(string) # The integration key, either `redis` or `dynamodb`, integrationId: str(string) # The integration ID}
@returns(200) {_links: map{self: map{href: str, type: str}, parent: map{href: str, type: str}, project: map{href: str, type: str}, environment: map{href: str, type: str}}, _id: str, integrationKey: str, projectKey: str, environmentKey: str, config: map, on: bool, tags: [str], name: str, version: int, _access: map{denied: [map], allowed: [map]}, _status: map{available: bool, potentiallyStale: bool, lastSync: int(int64), lastError: int(int64), errors: [map]}} # Big segment store response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Environment or project not found, 409: Status conflict, 429: Rate limited}

@endpoint DELETE /api/v2/integration-capabilities/big-segment-store/{projectKey}/{environmentKey}/{integrationKey}/{integrationId}
@desc Delete big segment store integration
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, integrationKey: str(string) # The integration key, either `redis` or `dynamodb`, integrationId: str(string) # The integration ID}
@returns(204) Action completed successfully
@errors {401: Invalid access token, 403: Forbidden, 404: Environment or project not found, 409: Status conflict, 429: Rate limited}

@endpoint GET /api/v2/integration-capabilities/featureStore
@desc List all delivery configurations
@returns(200) {_links: map{self: map{href: str, type: str}, parent: map{href: str, type: str}}, items: [map]} # Integration delivery configuration collection response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/integration-capabilities/featureStore/{projectKey}/{environmentKey}
@desc Get delivery configurations by environment
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key}
@returns(200) {_links: map{self: map{href: str, type: str}, parent: map{href: str, type: str}}, items: [map]} # Integration delivery configuration collection response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint POST /api/v2/integration-capabilities/featureStore/{projectKey}/{environmentKey}/{integrationKey}
@desc Create delivery configuration
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, integrationKey: str(string) # The integration key, config: map}
@optional {on: bool # Whether the integration configuration is active. Default value is false., tags: [str] # Tags to associate with the integration, name: str # Name to identify the integration}
@returns(201) {_links: map{self: map{href: str, type: str}, parent: map{href: str, type: str}, project: map{href: str, type: str}, environment: map{href: str, type: str}}, _id: str, integrationKey: str, projectKey: str, environmentKey: str, config: map, on: bool, tags: [str], name: str, version: int, _access: map{denied: [map], allowed: [map]}} # Integration delivery configuration response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}
@example_request {"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"]}

@endpoint GET /api/v2/integration-capabilities/featureStore/{projectKey}/{environmentKey}/{integrationKey}/{id}
@desc Get delivery configuration by ID
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, integrationKey: str(string) # The integration key, id: str(string) # The configuration ID}
@returns(200) {_links: map{self: map{href: str, type: str}, parent: map{href: str, type: str}, project: map{href: str, type: str}, environment: map{href: str, type: str}}, _id: str, integrationKey: str, projectKey: str, environmentKey: str, config: map, on: bool, tags: [str], name: str, version: int, _access: map{denied: [map], allowed: [map]}} # Integration delivery configuration response
@errors {404: Invalid resource identifier, 429: Rate limited}

@endpoint PATCH /api/v2/integration-capabilities/featureStore/{projectKey}/{environmentKey}/{integrationKey}/{id}
@desc Update delivery configuration
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, integrationKey: str(string) # The integration key, id: str(string) # The configuration ID}
@returns(200) {_links: map{self: map{href: str, type: str}, parent: map{href: str, type: str}, project: map{href: str, type: str}, environment: map{href: str, type: str}}, _id: str, integrationKey: str, projectKey: str, environmentKey: str, config: map, on: bool, tags: [str], name: str, version: int, _access: map{denied: [map], allowed: [map]}} # Integration delivery configuration response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 422: Invalid patch content, 429: Rate limited}
@example_request [{"op":"replace","path":"/on","value":true}]

@endpoint DELETE /api/v2/integration-capabilities/featureStore/{projectKey}/{environmentKey}/{integrationKey}/{id}
@desc Delete delivery configuration
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, integrationKey: str(string) # The integration key, id: str(string) # The configuration ID}
@returns(204) Action succeeded
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint POST /api/v2/integration-capabilities/featureStore/{projectKey}/{environmentKey}/{integrationKey}/{id}/validate
@desc Validate delivery configuration
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, integrationKey: str(string) # The integration key, id: str(string) # The configuration ID}
@returns(200) {statusCode: int, error: str, timestamp: int(int64), responseBody: str} # Integration delivery configuration validation response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/integration-capabilities/flag-import
@desc List all flag import configurations
@returns(200) {_links: map{self: map{href: str, type: str}, parent: map{href: str, type: str}}, items: [map]} # Flag Import Configuration response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Project not found, 409: Status conflict, 429: Rate limited}

@endpoint POST /api/v2/integration-capabilities/flag-import/{projectKey}/{integrationKey}
@desc Create a flag import configuration
@required {projectKey: str(string) # The project key, integrationKey: str(string) # The integration key, config: map}
@optional {tags: [str] # Tags to associate with the configuration, name: str # Name to identify the configuration}
@returns(200) {_links: map{self: map{href: str, type: str}, parent: map{href: str, type: str}, project: map{href: str, type: str}}, _id: str, integrationKey: str, projectKey: str, config: map, tags: [str], name: str, version: int, _access: map{denied: [map], allowed: [map]}, _status: map{status: str, lastImport: int(int64), lastError: int(int64), errors: [map]}} # Flag Import Configuration response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Project not found, 409: Status conflict, 429: Rate limited}
@example_request {"config":{"environmentId":"The ID of the environment in the external system","ldApiKey":"An API key with create flag permissions in your LaunchDarkly account","ldMaintainer":"The ID of the member who will be the maintainer of the imported flags","ldTag":"A tag to apply to all flags imported to LaunchDarkly","splitTag":"If provided, imports only the flags from the external system with this tag. Leave blank to import all flags.","workspaceApiKey":"An API key with read permissions in the external feature management system","workspaceId":"The ID of the workspace in the external system"},"name":"Sample configuration","tags":["example-tag"]}

@endpoint GET /api/v2/integration-capabilities/flag-import/{projectKey}/{integrationKey}/{integrationId}
@desc Get a single flag import configuration
@required {projectKey: str(string) # The project key, integrationKey: str(string) # The integration key, for example, `split`, integrationId: str(string) # The integration ID}
@returns(200) {_links: map{self: map{href: str, type: str}, parent: map{href: str, type: str}, project: map{href: str, type: str}}, _id: str, integrationKey: str, projectKey: str, config: map, tags: [str], name: str, version: int, _access: map{denied: [map], allowed: [map]}, _status: map{status: str, lastImport: int(int64), lastError: int(int64), errors: [map]}} # Flag import response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Project or import configuration not found, 409: Status conflict, 429: Rate limited}

@endpoint PATCH /api/v2/integration-capabilities/flag-import/{projectKey}/{integrationKey}/{integrationId}
@desc Update a flag import configuration
@required {projectKey: str(string) # The project key, integrationKey: str(string) # The integration key, integrationId: str(string) # The integration ID}
@returns(200) {_links: map{self: map{href: str, type: str}, parent: map{href: str, type: str}, project: map{href: str, type: str}}, _id: str, integrationKey: str, projectKey: str, config: map, tags: [str], name: str, version: int, _access: map{denied: [map], allowed: [map]}, _status: map{status: str, lastImport: int(int64), lastError: int(int64), errors: [map]}} # Flag import response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Project or import configuration not found, 409: Status conflict, 429: Rate limited}

@endpoint DELETE /api/v2/integration-capabilities/flag-import/{projectKey}/{integrationKey}/{integrationId}
@desc Delete a flag import configuration
@required {projectKey: str(string) # The project key, integrationKey: str(string) # The integration key, integrationId: str(string) # The integration ID}
@returns(204) Action completed successfully
@errors {401: Invalid access token, 403: Forbidden, 404: Project or import configuration not found, 409: Status conflict, 429: Rate limited}

@endpoint POST /api/v2/integration-capabilities/flag-import/{projectKey}/{integrationKey}/{integrationId}/trigger
@desc Trigger a single flag import run
@required {projectKey: str(string) # The project key, integrationKey: str(string) # The integration key, integrationId: str(string) # The integration ID}
@returns(201) Import job queued successfully
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Project or import configuration not found, 409: Status conflict, 429: Rate limited}

@endpoint GET /api/v2/integration-configurations/keys/{integrationKey}
@desc Get all configurations for the integration
@required {integrationKey: str(string) # Integration key}
@returns(200) {items: [map], _links: map} # List of Integration Configurations
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Integration key not found, 429: Rate limited}

@endpoint POST /api/v2/integration-configurations/keys/{integrationKey}
@desc Create integration configuration
@required {integrationKey: str(string) # The integration key, name: str # The name of the integration configuration, configValues: map # The unique set of fields required to configure the integration. 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.}
@optional {enabled: bool # Whether the integration configuration is enabled. If omitted, defaults to true, tags: [str] # Tags for the integration, capabilityConfig: map{approvals: map, auditLogEventsHook: map}}
@returns(201) {_links: map, _id: str, name: str, _createdAt: int(int64), _integrationKey: str, tags: [str], enabled: bool, _access: map{denied: [map], allowed: [map]}, configValues: map, capabilityConfig: map{approvals: map{additionalFormVariables: [map]}, auditLogEventsHook: map{statements: [map]}}, snowflakeSetupScript: str} # Integration Configuration response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Integration key not found, 409: Status conflict, 429: Rate limited}

@endpoint GET /api/v2/integration-configurations/{integrationConfigurationId}
@desc Get an integration configuration
@required {integrationConfigurationId: str(string) # Integration configuration ID}
@returns(200) {_links: map, _id: str, name: str, _createdAt: int(int64), _integrationKey: str, tags: [str], enabled: bool, _access: map{denied: [map], allowed: [map]}, configValues: map, capabilityConfig: map{approvals: map{additionalFormVariables: [map]}, auditLogEventsHook: map{statements: [map]}}, snowflakeSetupScript: str} # Integration Configuration response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Integration ID not found, 429: Rate limited}

@endpoint PATCH /api/v2/integration-configurations/{integrationConfigurationId}
@desc Update integration configuration
@required {integrationConfigurationId: str(string) # The ID of the integration configuration}
@returns(200) {_links: map, _id: str, name: str, _createdAt: int(int64), _integrationKey: str, tags: [str], enabled: bool, _access: map{denied: [map], allowed: [map]}, configValues: map, capabilityConfig: map{approvals: map{additionalFormVariables: [map]}, auditLogEventsHook: map{statements: [map]}}, snowflakeSetupScript: str} # Integration configuration response
@errors {400: Invalid request, 403: Forbidden, 404: Invalid resource identifier, 409: Status conflict, 429: Rate limited}
@example_request [{"op":"replace","path":"/on","value":false}]

@endpoint DELETE /api/v2/integration-configurations/{integrationConfigurationId}
@desc Delete integration configuration
@required {integrationConfigurationId: str(string) # The ID of the integration configuration to be deleted}
@returns(204) Action succeeded
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/integrations/{integrationKey}
@desc Get audit log subscriptions by integration
@required {integrationKey: str(string) # The integration key}
@returns(200) {_links: map, items: [map], key: str} # Integrations collection response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint POST /api/v2/integrations/{integrationKey}
@desc Create audit log subscription
@required {integrationKey: str(string) # The integration key, name: str # A human-friendly name for your audit log subscription., config: map # 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.}
@optional {statements: [map{resources: [str], notResources: [str], actions: [str], notActions: [str], effect!: str}], on: bool # Whether or not you want your subscription to actively send events., tags: [str] # An array of tags for this subscription., url: str # Slack webhook receiver URL. Only necessary for legacy Slack webhook integrations., apiKey: str # Datadog API key. Only necessary for legacy Datadog webhook integrations.}
@returns(201) {_links: map, _id: str, kind: str, name: str, config: map, statements: [map], on: bool, tags: [str], _access: map{denied: [map], allowed: [map]}, _status: map{successCount: int, lastSuccess: int(int64), lastError: int(int64), errorCount: int, errors: [map]}, url: str, apiKey: str} # Integration response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}
@example_request {"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"]}

@endpoint GET /api/v2/integrations/{integrationKey}/{id}
@desc Get audit log subscription by ID
@required {integrationKey: str(string) # The integration key, id: str(string) # The subscription ID}
@returns(200) {_links: map, _id: str, kind: str, name: str, config: map, statements: [map], on: bool, tags: [str], _access: map{denied: [map], allowed: [map]}, _status: map{successCount: int, lastSuccess: int(int64), lastError: int(int64), errorCount: int, errors: [map]}, url: str, apiKey: str} # Integration response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint PATCH /api/v2/integrations/{integrationKey}/{id}
@desc Update audit log subscription
@required {integrationKey: str(string) # The integration key, id: str(string) # The ID of the audit log subscription}
@returns(200) {_links: map, _id: str, kind: str, name: str, config: map, statements: [map], on: bool, tags: [str], _access: map{denied: [map], allowed: [map]}, _status: map{successCount: int, lastSuccess: int(int64), lastError: int(int64), errorCount: int, errors: [map]}, url: str, apiKey: str} # Integration response
@errors {400: Invalid request, 403: Forbidden, 404: Invalid resource identifier, 409: Status conflict, 429: Rate limited}
@example_request [{"op":"replace","path":"/on","value":false}]

@endpoint DELETE /api/v2/integrations/{integrationKey}/{id}
@desc Delete audit log subscription
@required {integrationKey: str(string) # The integration key, id: str(string) # The subscription ID}
@returns(204) Action succeeded
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/members
@desc List account members
@optional {limit: int(int64) # The number of members to return in the response. Defaults to 20., offset: int(int64) # 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`., filter: str(string) # A comma-separated list of filters. Each filter is of the form `field:value`. Supported fields are explained above., expand: str(string) # A comma-separated list of properties that can reveal additional information in the response., sort: str(string) # A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order.}
@returns(200) {items: [map], _links: map, totalCount: int} # Members collection response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint POST /api/v2/members
@desc Invite new members
@returns(201) {items: [map], _links: map, totalCount: int} # Member collection response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 409: Status conflict, 429: Rate limited}

@endpoint PATCH /api/v2/members
@desc Modify account members
@required {instructions: [map]}
@optional {comment: str # Optional comment describing the update}
@returns(200) {members: [str], errors: [map]} # Members response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 409: Status conflict, 429: Rate limited}
@example_request {"comment":"Optional comment about the update","instructions":[{"kind":"replaceMembersRoles","memberIDs":["1234a56b7c89d012345e678f","507f1f77bcf86cd799439011"],"value":"reader"}]}

@endpoint GET /api/v2/members/{id}
@desc Get account member
@required {id: str(string) # The member ID}
@optional {expand: str(string) # A comma-separated list of properties that can reveal additional information in the response.}
@returns(200) {_links: map, _id: str, firstName: str, lastName: str, role: str, email: str, _pendingInvite: bool, _verified: bool, _pendingEmail: str, customRoles: [str], mfa: str, excludedDashboards: [str], _lastSeen: int(int64), _lastSeenMetadata: map{tokenId: str}, _integrationMetadata: map{externalId: str, externalStatus: map{display: str, value: str}, externalUrl: str, lastChecked: int(int64)}, teams: [map], permissionGrants: [map], creationDate: int(int64), oauthProviders: [str], version: int, roleAttributes: map} # Member response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint PATCH /api/v2/members/{id}
@desc Modify an account member
@required {id: str(string) # The member ID}
@returns(200) {_links: map, _id: str, firstName: str, lastName: str, role: str, email: str, _pendingInvite: bool, _verified: bool, _pendingEmail: str, customRoles: [str], mfa: str, excludedDashboards: [str], _lastSeen: int(int64), _lastSeenMetadata: map{tokenId: str}, _integrationMetadata: map{externalId: str, externalStatus: map{display: str, value: str}, externalUrl: str, lastChecked: int(int64)}, teams: [map], permissionGrants: [map], creationDate: int(int64), oauthProviders: [str], version: int, roleAttributes: map} # Member response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 409: Status conflict, 429: Rate limited}
@example_request [{"op":"add","path":"/role","value":"writer"}]

@endpoint DELETE /api/v2/members/{id}
@desc Delete account member
@required {id: str(string) # The member ID}
@returns(204) Action succeeded
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 409: Status conflict, 429: Rate limited}

@endpoint POST /api/v2/members/{id}/teams
@desc Add a member to teams
@required {id: str(string) # The member ID, teamKeys: [str] # List of team keys}
@returns(201) {_links: map, _id: str, firstName: str, lastName: str, role: str, email: str, _pendingInvite: bool, _verified: bool, _pendingEmail: str, customRoles: [str], mfa: str, excludedDashboards: [str], _lastSeen: int(int64), _lastSeenMetadata: map{tokenId: str}, _integrationMetadata: map{externalId: str, externalStatus: map{display: str, value: str}, externalUrl: str, lastChecked: int(int64)}, teams: [map], permissionGrants: [map], creationDate: int(int64), oauthProviders: [str], version: int, roleAttributes: map} # Member response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Member not found, 409: Status conflict, 429: Rate limited}

@endpoint GET /api/v2/metrics/{projectKey}
@desc List metrics
@required {projectKey: str(string) # The project key}
@optional {expand: str(string) # A comma-separated list of properties that can reveal additional information in the response., limit: int(int64) # The number of metrics to return in the response. Defaults to 20. Maximum limit is 50., offset: int(int64) # 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., sort: str(string) # A field to sort the items by. Prefix field by a dash ( - ) to sort in descending order. This endpoint supports sorting by `createdAt` or `name`., filter: str(string) # A comma-separated list of filters. This endpoint accepts filtering by `query`, `tags`, `eventKind`, `isNumeric`, `unitAggregationType`, `hasConnections`, `maintainerIds`, `maintainerTeamKey`, `view`, `dataSourceKeys`, `metricUsedIn`, `eventKeys`, and `versionIds`. To learn more about the filter syntax, read the 'Filtering metrics' section above.}
@returns(200) {items: [map], _links: map, totalCount: int} # Metrics collection response
@errors {401: Invalid access token, 404: Invalid resource identifier}

@endpoint POST /api/v2/metrics/{projectKey}
@desc Create metric
@required {projectKey: str(string) # The project key, key: str # A unique key to reference the metric, kind: str(pageview/click/custom) # The kind of event your metric will track}
@optional {name: str # A human-friendly name for the metric, description: str # Description of the metric, selector: str # One or more CSS selectors. Required for click metrics only., urls: [map{kind: str, url: str, substring: str, pattern: str}] # One or more target URLs. Required for click and pageview metrics only., isNumeric: bool # 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., unit: str # The unit of measure. Applicable for numeric custom metrics only., eventKey: str # The event key to use in your code. Required for custom conversion/binary and custom numeric metrics only., successCriteria: str(HigherThanBaseline/LowerThanBaseline) # Success criteria. Required for custom numeric metrics, optional for custom conversion metrics., tags: [str] # Tags for the metric, randomizationUnits: [str] # An array of randomization units allowed for this metric, maintainerId: str # The ID of the member who maintains this metric, unitAggregationType: str(average/sum) # The method by which multiple unit event values are aggregated, analysisType: str # The method for analyzing metric events, percentileValue: int # The percentile for the analysis method. An integer denoting the target percentile between 0 and 100. Required when analysisType is percentile., eventDefault: map{disabled: bool, value: num}, dataSource: map{key!: str, environmentKey: str, _name: str, _integrationKey: str}, filters: map{type!: str, attribute: str, op!: str, values!: [any], contextKind: str, negate!: bool}, windowStartOffset: int(int64) # Not yet implemented - The start of the measurement window, in milliseconds relative to the unit's first exposure to a flag variation, windowEndOffset: int(int64) # Not yet implemented - The end of the measurement window, in milliseconds relative to the unit's first exposure to a flag variation, traceQuery: str # The trace query to use for the metric. Required for trace metrics., traceValueLocation: str # The location in the trace to use for numeric values. Required for numeric trace metrics.}
@returns(201) {experimentCount: int, metricGroupCount: int, activeExperimentCount: int, activeGuardedRolloutCount: int, _id: str, _versionId: str, _version: int, key: str, name: str, kind: str, _attachedFlagCount: int, _links: map, _site: map{href: str, type: str}, _access: map{denied: [map], allowed: [map]}, tags: [str], _creationDate: int(int64), lastModified: map{date: str(date-time)}, maintainerId: str, _maintainer: map{_links: map, _id: str, firstName: str, lastName: str, role: str, email: str}, description: str, category: str, isNumeric: bool, successCriteria: str, unit: str, eventKey: str, randomizationUnits: [str], filters: map{type: str, attribute: str, op: str, values: [any], contextKind: str, negate: bool}, unitAggregationType: str, analysisType: str, percentileValue: int, eventDefault: map{disabled: bool, value: num}, dataSource: map{key: str, environmentKey: str, _name: str, _integrationKey: str}, lastSeen: int(int64), archived: bool, archivedAt: int(int64), selector: str, urls: [map], windowStartOffset: int(int64), windowEndOffset: int(int64), traceQuery: str, traceValueLocation: str, experiments: [map], metricGroups: [map], lastUsedInExperiment: map{key: str, name: str, environmentId: str, environmentKey: str, creationDate: int(int64), archivedDate: int(int64), _links: map}, lastUsedInGuardedRollout: map{_id: str, flagKey: str, flagName: str, flagPurpose: str, environmentKey: str, environmentName: str, status: str, creationDate: int(int64), _links: map}, isActive: bool, _attachedFeatures: [map]} # Metric response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 409: Status conflict, 429: Rate limited}
@example_request {"eventKey":"Order placed","isNumeric":false,"key":"metric-key-123abc","kind":"custom"}

@endpoint GET /api/v2/metrics/{projectKey}/{metricKey}
@desc Get metric
@required {projectKey: str(string) # The project key, metricKey: str(string) # The metric key}
@optional {expand: str(string) # A comma-separated list of properties that can reveal additional information in the response. Supported fields are `experiments`, `experimentCount`, `metricGroups`, `metricGroupCount`, `eventSources`, `guardedRollouts`, `guardedRolloutCount`, `lastUsedInExperiment`, and `lastUsedInGuardedRollout`., versionId: str(string) # The specific version ID of the metric}
@returns(200) {experimentCount: int, metricGroupCount: int, activeExperimentCount: int, activeGuardedRolloutCount: int, _id: str, _versionId: str, _version: int, key: str, name: str, kind: str, _attachedFlagCount: int, _links: map, _site: map{href: str, type: str}, _access: map{denied: [map], allowed: [map]}, tags: [str], _creationDate: int(int64), lastModified: map{date: str(date-time)}, maintainerId: str, _maintainer: map{_links: map, _id: str, firstName: str, lastName: str, role: str, email: str}, description: str, category: str, isNumeric: bool, successCriteria: str, unit: str, eventKey: str, randomizationUnits: [str], filters: map{type: str, attribute: str, op: str, values: [any], contextKind: str, negate: bool}, unitAggregationType: str, analysisType: str, percentileValue: int, eventDefault: map{disabled: bool, value: num}, dataSource: map{key: str, environmentKey: str, _name: str, _integrationKey: str}, lastSeen: int(int64), archived: bool, archivedAt: int(int64), selector: str, urls: [map], windowStartOffset: int(int64), windowEndOffset: int(int64), traceQuery: str, traceValueLocation: str, experiments: [map], metricGroups: [map], lastUsedInExperiment: map{key: str, name: str, environmentId: str, environmentKey: str, creationDate: int(int64), archivedDate: int(int64), _links: map}, lastUsedInGuardedRollout: map{_id: str, flagKey: str, flagName: str, flagPurpose: str, environmentKey: str, environmentName: str, status: str, creationDate: int(int64), _links: map}, isActive: bool, _attachedFeatures: [map]} # Metric response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint PATCH /api/v2/metrics/{projectKey}/{metricKey}
@desc Update metric
@required {projectKey: str(string) # The project key, metricKey: str(string) # The metric key}
@returns(200) {experimentCount: int, metricGroupCount: int, activeExperimentCount: int, activeGuardedRolloutCount: int, _id: str, _versionId: str, _version: int, key: str, name: str, kind: str, _attachedFlagCount: int, _links: map, _site: map{href: str, type: str}, _access: map{denied: [map], allowed: [map]}, tags: [str], _creationDate: int(int64), lastModified: map{date: str(date-time)}, maintainerId: str, _maintainer: map{_links: map, _id: str, firstName: str, lastName: str, role: str, email: str}, description: str, category: str, isNumeric: bool, successCriteria: str, unit: str, eventKey: str, randomizationUnits: [str], filters: map{type: str, attribute: str, op: str, values: [any], contextKind: str, negate: bool}, unitAggregationType: str, analysisType: str, percentileValue: int, eventDefault: map{disabled: bool, value: num}, dataSource: map{key: str, environmentKey: str, _name: str, _integrationKey: str}, lastSeen: int(int64), archived: bool, archivedAt: int(int64), selector: str, urls: [map], windowStartOffset: int(int64), windowEndOffset: int(int64), traceQuery: str, traceValueLocation: str, experiments: [map], metricGroups: [map], lastUsedInExperiment: map{key: str, name: str, environmentId: str, environmentKey: str, creationDate: int(int64), archivedDate: int(int64), _links: map}, lastUsedInGuardedRollout: map{_id: str, flagKey: str, flagName: str, flagPurpose: str, environmentKey: str, environmentName: str, status: str, creationDate: int(int64), _links: map}, isActive: bool, _attachedFeatures: [map]} # Metric response
@errors {400: Invalid request, 401: Invalid access token, 404: Invalid resource identifier, 409: Status conflict, 429: Rate limited}
@example_request [{"op":"replace","path":"/name","value":"my-updated-metric"}]

@endpoint DELETE /api/v2/metrics/{projectKey}/{metricKey}
@desc Delete metric
@required {projectKey: str(string) # The project key, metricKey: str(string) # The metric key}
@returns(204) Action succeeded
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/oauth/clients
@desc Get clients
@returns(200) {_links: map, items: [map]} # OAuth 2.0 client collection response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden}

@endpoint POST /api/v2/oauth/clients
@desc Create a LaunchDarkly OAuth 2.0 client
@optional {name: str # The name of your new LaunchDarkly OAuth 2.0 client., redirectUri: str # The redirect URI for your new OAuth 2.0 application. This should be an absolute URL conforming with the standard HTTPS protocol., description: str # Description of your OAuth 2.0 client.}
@returns(201) {_links: map, name: str, description: str, _accountId: str, _clientId: str, _clientSecret: str, redirectUri: str, _creationDate: int(int64)} # OAuth 2.0 client response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden}

@endpoint GET /api/v2/oauth/clients/{clientId}
@desc Get client by ID
@required {clientId: str(string) # The client ID}
@returns(200) {_links: map, name: str, description: str, _accountId: str, _clientId: str, _clientSecret: str, redirectUri: str, _creationDate: int(int64)} # OAuth 2.0 client response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier}

@endpoint PATCH /api/v2/oauth/clients/{clientId}
@desc Patch client by ID
@required {clientId: str(string) # The client ID}
@returns(200) {_links: map, name: str, description: str, _accountId: str, _clientId: str, _clientSecret: str, redirectUri: str, _creationDate: int(int64)} # OAuth 2.0 client response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier}
@example_request [{"op":"replace","path":"/name","value":"Example Client V2"}]

@endpoint DELETE /api/v2/oauth/clients/{clientId}
@desc Delete OAuth 2.0 client
@required {clientId: str(string) # The client ID}
@returns(204) Action succeeded
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier}

@endpoint GET /api/v2/openapi.json
@desc Gets the OpenAPI spec in json
@returns(200) OpenAPI Spec
@errors {429: Rate limited}

@endpoint GET /api/v2/projects
@desc List projects
@optional {limit: int(int64) # The number of projects to return in the response. Defaults to 20., offset: int(int64) # 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., filter: str(string) # A comma-separated list of filters. Each filter is constructed as `field:value`., sort: str(string) # A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order., expand: str(string) # A comma-separated list of properties that can reveal additional information in the response.}
@returns(200) {_links: map, items: [map], totalCount: int} # Project collection response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 429: Rate limited}

@endpoint POST /api/v2/projects
@desc Create project
@required {name: str # A human-friendly name for the project., key: str # A unique key used to reference the project in your code.}
@optional {includeInSnippetByDefault: bool # Whether or not flags created in this project are made available to the client-side JavaScript SDK by default., defaultClientSideAvailability: map{usingEnvironmentId!: bool, usingMobileKey!: bool}, tags: [str] # Tags for the project, environments: [map{name!: str, key!: str, color!: str, defaultTtl: int, secureMode: bool, defaultTrackEvents: bool, confirmChanges: bool, requireComments: bool, tags: [str], source: map, critical: bool}] # Creates the provided environments for this project. If omitted default environments will be created instead., namingConvention: map{case: str, prefix: str}}
@returns(201) {_links: map, _id: str, key: str, includeInSnippetByDefault: bool, defaultClientSideAvailability: map{usingMobileKey: bool, usingEnvironmentId: bool}, name: str, _access: map{denied: [map], allowed: [map]}, tags: [str], defaultReleasePipelineKey: str, environments: [map]} # Project response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 409: Status conflict, 429: Rate limited}
@example_request {"key":"project-key-123abc","name":"My Project"}

@endpoint GET /api/v2/projects/{projectKey}
@desc Get project
@required {projectKey: str(string) # The project key.}
@optional {expand: str(string) # A comma-separated list of properties that can reveal additional information in the response.}
@returns(200) {_links: map, _id: str, key: str, includeInSnippetByDefault: bool, defaultClientSideAvailability: map{usingMobileKey: bool, usingEnvironmentId: bool}, name: str, _access: map{denied: [map], allowed: [map]}, tags: [str], defaultReleasePipelineKey: str, environments: map{_links: map, totalCount: int, items: [map]}} # Project response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint PATCH /api/v2/projects/{projectKey}
@desc Update project
@required {projectKey: str(string) # The project key}
@returns(200) {_links: map, _id: str, key: str, includeInSnippetByDefault: bool, defaultClientSideAvailability: map{usingMobileKey: bool, usingEnvironmentId: bool}, name: str, _access: map{denied: [map], allowed: [map]}, tags: [str], defaultReleasePipelineKey: str, environments: [map]} # Project response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 409: Status conflict, 429: Rate limited}
@example_request [{"op":"add","path":"/tags/0","value":"another-tag"}]

@endpoint DELETE /api/v2/projects/{projectKey}
@desc Delete project
@required {projectKey: str(string) # The project key}
@returns(204) Action succeeded
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/projects/{projectKey}/context-kinds
@desc Get context kinds
@required {projectKey: str(string) # The project key}
@returns(200) {items: [map], _links: map} # Context kinds collection response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier}

@endpoint PUT /api/v2/projects/{projectKey}/context-kinds/{key}
@desc Create or update context kind
@required {projectKey: str(string) # The project key, key: str(string) # The context kind key, name: str # The context kind name}
@optional {description: str # The context kind description, hideInTargeting: bool # Alias for archived., archived: bool # Whether the context kind is archived. Archived context kinds are unavailable for targeting., version: int # The context kind version. If not specified when the context kind is created, defaults to 1.}
@returns(200) {status: str, _links: map} # Context kind upsert response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier}

@endpoint GET /api/v2/projects/{projectKey}/environments
@desc List environments
@required {projectKey: str(string) # The project key}
@optional {limit: int(int64) # The number of environments to return in the response. Defaults to 20., offset: int(int64) # 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`., filter: str(string) # A comma-separated list of filters. Each filter is of the form `field:value`., sort: str(string) # A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order.}
@returns(200) {_links: map, totalCount: int, items: [map]} # Environments collection response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 405: Method not allowed, 429: Rate limited}

@endpoint POST /api/v2/projects/{projectKey}/environments
@desc Create environment
@required {projectKey: str(string) # The project key, name: str # A human-friendly name for the new environment, key: str # A project-unique key for the new environment, color: str # A color to indicate this environment in the UI}
@optional {defaultTtl: int # The default time (in minutes) that the PHP SDK can cache feature flag rules locally, secureMode: bool # Ensures that one end user of the client-side SDK cannot inspect the variations for another end user, defaultTrackEvents: bool # Enables tracking detailed information for new flags by default, confirmChanges: bool # Requires confirmation for all flag and segment changes via the UI in this environment, requireComments: bool # Requires comments for all flag and segment changes via the UI in this environment, tags: [str] # Tags to apply to the new environment, source: map{key: str, version: int}, critical: bool # Whether the environment is critical}
@returns(201) {_links: map, _id: str, key: str, name: str, apiKey: str, mobileKey: str, color: str, defaultTtl: int, secureMode: bool, _access: map{denied: [map], allowed: [map]}, defaultTrackEvents: bool, requireComments: bool, confirmChanges: bool, tags: [str], approvalSettings: map{required: bool, bypassApprovalsForPendingChanges: bool, minNumApprovals: int, canReviewOwnRequest: bool, canApplyDeclinedChanges: bool, autoApplyApprovedChanges: bool, serviceKind: str, serviceConfig: map, requiredApprovalTags: [str], serviceKindConfigurationId: str}, resourceApprovalSettings: map, critical: bool} # Environment response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 409: Status conflict, 429: Rate limited}
@example_request {"color":"DADBEE","key":"environment-key-123abc","name":"My Environment"}

@endpoint GET /api/v2/projects/{projectKey}/environments/{environmentKey}
@desc Get environment
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key}
@returns(200) {_links: map, _id: str, key: str, name: str, apiKey: str, mobileKey: str, color: str, defaultTtl: int, secureMode: bool, _access: map{denied: [map], allowed: [map]}, defaultTrackEvents: bool, requireComments: bool, confirmChanges: bool, tags: [str], approvalSettings: map{required: bool, bypassApprovalsForPendingChanges: bool, minNumApprovals: int, canReviewOwnRequest: bool, canApplyDeclinedChanges: bool, autoApplyApprovedChanges: bool, serviceKind: str, serviceConfig: map, requiredApprovalTags: [str], serviceKindConfigurationId: str}, resourceApprovalSettings: map, critical: bool} # Environment response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint PATCH /api/v2/projects/{projectKey}/environments/{environmentKey}
@desc Update environment
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key}
@returns(200) {_links: map, _id: str, key: str, name: str, apiKey: str, mobileKey: str, color: str, defaultTtl: int, secureMode: bool, _access: map{denied: [map], allowed: [map]}, defaultTrackEvents: bool, requireComments: bool, confirmChanges: bool, tags: [str], approvalSettings: map{required: bool, bypassApprovalsForPendingChanges: bool, minNumApprovals: int, canReviewOwnRequest: bool, canApplyDeclinedChanges: bool, autoApplyApprovedChanges: bool, serviceKind: str, serviceConfig: map, requiredApprovalTags: [str], serviceKindConfigurationId: str}, resourceApprovalSettings: map, critical: bool} # Environment response
@errors {400: Invalid request, 401: Invalid access token, 404: Invalid resource identifier, 409: Status conflict, 429: Rate limited}
@example_request [{"op":"replace","path":"/requireComments","value":true}]

@endpoint DELETE /api/v2/projects/{projectKey}/environments/{environmentKey}
@desc Delete environment
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key}
@returns(204) Action succeeded
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint POST /api/v2/projects/{projectKey}/environments/{environmentKey}/apiKey
@desc Reset environment SDK key
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key}
@optional {expiry: int(int64) # 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.}
@returns(200) {_links: map, _id: str, key: str, name: str, apiKey: str, mobileKey: str, color: str, defaultTtl: int, secureMode: bool, _access: map{denied: [map], allowed: [map]}, defaultTrackEvents: bool, requireComments: bool, confirmChanges: bool, tags: [str], approvalSettings: map{required: bool, bypassApprovalsForPendingChanges: bool, minNumApprovals: int, canReviewOwnRequest: bool, canApplyDeclinedChanges: bool, autoApplyApprovedChanges: bool, serviceKind: str, serviceConfig: map, requiredApprovalTags: [str], serviceKindConfigurationId: str}, resourceApprovalSettings: map, critical: bool} # Environment response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 409: Status conflict, 429: Rate limited}

@endpoint GET /api/v2/projects/{projectKey}/environments/{environmentKey}/context-attributes
@desc Get context attribute names
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key}
@optional {filter: str(string) # 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](https://launchdarkly.com/docs/ld-docs/api/contexts#filtering-contexts-and-context-instances)., limit: int(int64) # Specifies the maximum number of items in the collection to return (max: 100, default: 100)}
@returns(200) {items: [map]} # Context attribute names collection response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 429: Rate limited}

@endpoint GET /api/v2/projects/{projectKey}/environments/{environmentKey}/context-attributes/{attributeName}
@desc Get context attribute values
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, attributeName: str(string) # The attribute name}
@optional {filter: str(string) # 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](https://launchdarkly.com/docs/ld-docs/api/contexts#filtering-contexts-and-context-instances)., limit: int(int64) # Specifies the maximum number of items in the collection to return (max: 100, default: 50)}
@returns(200) {items: [map]} # Context attribute values collection response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 429: Rate limited}

@endpoint POST /api/v2/projects/{projectKey}/environments/{environmentKey}/context-instances/search
@desc Search for context instances
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key}
@optional {limit: int(int64) # Specifies the maximum number of items in the collection to return (max: 50, default: 20), continuationToken: str(string) # 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., sort: str(string) # 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`., filter: str(string) # 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](https://launchdarkly.com/docs/ld-docs/api/contexts#filtering-contexts-and-context-instances)., includeTotalCount: bool # Specifies whether to include or omit the total count of matching context instances. Defaults to true., filter: str # A collection of context instance filters, sort: str # 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., limit: int # Specifies the maximum number of items in the collection to return (max: 50, default: 20), continuationToken: str # 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.}
@returns(200) {_links: map, totalCount: int, _environmentId: str, continuationToken: str, items: [map]} # Context instances collection response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 429: Rate limited}

@endpoint GET /api/v2/projects/{projectKey}/environments/{environmentKey}/context-instances/{id}
@desc Get context instances
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, id: str(string) # The context instance ID}
@optional {limit: int(int64) # Specifies the maximum number of context instances to return (max: 50, default: 20), continuationToken: str(string) # 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., sort: str(string) # 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`., filter: str(string) # 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](https://launchdarkly.com/docs/ld-docs/api/contexts#filtering-contexts-and-context-instances)., includeTotalCount: bool # Specifies whether to include or omit the total count of matching context instances. Defaults to true.}
@returns(200) {_links: map, totalCount: int, _environmentId: str, continuationToken: str, items: [map]} # Context instances collection response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 429: Rate limited}

@endpoint DELETE /api/v2/projects/{projectKey}/environments/{environmentKey}/context-instances/{id}
@desc Delete context instances
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, id: str(string) # The context instance ID}
@returns(204) Action succeeded
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint POST /api/v2/projects/{projectKey}/environments/{environmentKey}/contexts/search
@desc Search for contexts
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key}
@optional {limit: int(int64) # Specifies the maximum number of items in the collection to return (max: 50, default: 20), continuationToken: str(string) # 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., sort: str(string) # 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`., filter: str(string) # A comma-separated list of context filters. To learn more about the filter syntax, read [Filtering contexts and context instances](https://launchdarkly.com/docs/ld-docs/api/contexts#filtering-contexts-and-context-instances)., includeTotalCount: bool # Specifies whether to include or omit the total count of matching contexts. Defaults to true., filter: str # A collection of context filters, sort: str # 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., limit: int # Specifies the maximum number of items in the collection to return (max: 50, default: 20), continuationToken: str # 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.}
@returns(200) {_links: map, totalCount: int, _environmentId: str, continuationToken: str, items: [map]} # Contexts collection response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 429: Rate limited}

@endpoint PUT /api/v2/projects/{projectKey}/environments/{environmentKey}/contexts/{contextKind}/{contextKey}/flags/{featureFlagKey}
@desc Update flag settings for context
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, contextKind: str(string) # The context kind, contextKey: str(string) # The context key, featureFlagKey: str(string) # The feature flag key}
@optional {setting: any # The variation value to set for the context. Must match the flag's variation type., comment: str # Optional comment describing the change}
@returns(204) Action succeeded
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 409: Status conflict, 429: Rate limited}

@endpoint GET /api/v2/projects/{projectKey}/environments/{environmentKey}/contexts/{kind}/{key}
@desc Get contexts
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, kind: str(string) # The context kind, key: str(string) # The context key}
@optional {limit: int(int64) # Specifies the maximum number of items in the collection to return (max: 50, default: 20), continuationToken: str(string) # 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., sort: str(string) # 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`., filter: str(string) # 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](https://launchdarkly.com/docs/ld-docs/api/contexts#filtering-contexts-and-context-instances)., includeTotalCount: bool # Specifies whether to include or omit the total count of matching contexts. Defaults to true.}
@returns(200) {_links: map, totalCount: int, _environmentId: str, continuationToken: str, items: [map]} # Contexts collection response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 429: Rate limited}

@endpoint GET /api/v2/projects/{projectKey}/environments/{environmentKey}/experiments
@desc Get experiments
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key}
@optional {limit: int(int64) # The maximum number of experiments to return. Defaults to 20., offset: int(int64) # 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`., filter: str(string) # A comma-separated list of filters. Each filter is of the form `field:value`. Supported fields are explained above., expand: str(string) # A comma-separated list of properties that can reveal additional information in the response. Supported fields are explained above., lifecycleState: str(string) # A comma-separated list of experiment archived states. Supports `archived`, `active`, or both. Defaults to `active` experiments.}
@returns(200) {items: [map], total_count: int, _links: map} # Experiment collection response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 405: Method not allowed, 429: Rate limited}

@endpoint POST /api/v2/projects/{projectKey}/environments/{environmentKey}/experiments
@desc Create experiment
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, name: str # The experiment name, key: str # The experiment key, iteration: map{hypothesis!: str, canReshuffleTraffic: bool, metrics!: [map], primarySingleMetricKey: str, primaryFunnelKey: str, treatments!: [map], flags!: map, randomizationUnit: str, reallocationFrequencyMillis: int, covariateId: str, attributes: [str]}}
@optional {description: str # The experiment description, maintainerId: str # The ID of the member who maintains this experiment, holdoutId: str # The ID of the holdout, tags: [str] # Tags for the experiment, methodology: str(bayesian/frequentist/export_only) # The results analysis approach., analysisConfig: map{bayesianThreshold: str, significanceThreshold: str, testDirection: str, multipleComparisonCorrectionMethod: str, multipleComparisonCorrectionScope: str, sequentialTestingEnabled: bool}, dataSource: str(launchdarkly/snowflake) # The source of metric data in order to analyze results. Defaults to "launchdarkly" when not provided., type: str(experiment/mab/holdout) # The type of experiment.}
@returns(201) {_id: str, key: str, name: str, description: str, _maintainerId: str, _creationDate: int(int64), environmentKey: str, methodology: str, dataSource: str, archivedDate: int(int64), tags: [str], _links: map, holdoutId: str, currentIteration: map{_id: str, hypothesis: str, status: str, createdAt: int(int64), startedAt: int(int64), endedAt: int(int64), winningTreatmentId: str, winningReason: str, canReshuffleTraffic: bool, flags: map, reallocationFrequencyMillis: int, version: int, primaryMetric: map{key: str, _versionId: str, name: str, kind: str, isNumeric: bool, eventKey: str, _links: map, isGroup: bool, metrics: [map]}, primarySingleMetric: map{key: str, _versionId: str, name: str, kind: str, isNumeric: bool, unitAggregationType: str, eventKey: str, _links: map}, primaryFunnel: map{key: str, name: str, kind: str, _links: map, metrics: [map]}, randomizationUnit: str, attributes: [str], treatments: [map], secondaryMetrics: [map], metrics: [map], layerSnapshot: map{key: str, name: str, reservationPercent: int, otherReservationPercent: int}, covariateInfo: map{id: str, fileName: str, createdAt: int(int64)}}, type: str, draftIteration: map{_id: str, hypothesis: str, status: str, createdAt: int(int64), startedAt: int(int64), endedAt: int(int64), winningTreatmentId: str, winningReason: str, canReshuffleTraffic: bool, flags: map, reallocationFrequencyMillis: int, version: int, primaryMetric: map{key: str, _versionId: str, name: str, kind: str, isNumeric: bool, eventKey: str, _links: map, isGroup: bool, metrics: [map]}, primarySingleMetric: map{key: str, _versionId: str, name: str, kind: str, isNumeric: bool, unitAggregationType: str, eventKey: str, _links: map}, primaryFunnel: map{key: str, name: str, kind: str, _links: map, metrics: [map]}, randomizationUnit: str, attributes: [str], treatments: [map], secondaryMetrics: [map], metrics: [map], layerSnapshot: map{key: str, name: str, reservationPercent: int, otherReservationPercent: int}, covariateInfo: map{id: str, fileName: str, createdAt: int(int64)}}, previousIterations: [map], analysisConfig: map{bayesianThreshold: str, significanceThreshold: str, testDirection: str, multipleComparisonCorrectionMethod: str, multipleComparisonCorrectionScope: str, sequentialTestingEnabled: bool}} # Experiment response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/projects/{projectKey}/environments/{environmentKey}/experiments/{experimentKey}
@desc Get experiment
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, experimentKey: str(string) # The experiment key}
@optional {expand: str(string) # A comma-separated list of properties that can reveal additional information in the response. Supported fields are explained above.}
@returns(200) {_id: str, key: str, name: str, description: str, _maintainerId: str, _creationDate: int(int64), environmentKey: str, methodology: str, dataSource: str, archivedDate: int(int64), tags: [str], _links: map, holdoutId: str, currentIteration: map{_id: str, hypothesis: str, status: str, createdAt: int(int64), startedAt: int(int64), endedAt: int(int64), winningTreatmentId: str, winningReason: str, canReshuffleTraffic: bool, flags: map, reallocationFrequencyMillis: int, version: int, primaryMetric: map{key: str, _versionId: str, name: str, kind: str, isNumeric: bool, eventKey: str, _links: map, isGroup: bool, metrics: [map]}, primarySingleMetric: map{key: str, _versionId: str, name: str, kind: str, isNumeric: bool, unitAggregationType: str, eventKey: str, _links: map}, primaryFunnel: map{key: str, name: str, kind: str, _links: map, metrics: [map]}, randomizationUnit: str, attributes: [str], treatments: [map], secondaryMetrics: [map], metrics: [map], layerSnapshot: map{key: str, name: str, reservationPercent: int, otherReservationPercent: int}, covariateInfo: map{id: str, fileName: str, createdAt: int(int64)}}, type: str, draftIteration: map{_id: str, hypothesis: str, status: str, createdAt: int(int64), startedAt: int(int64), endedAt: int(int64), winningTreatmentId: str, winningReason: str, canReshuffleTraffic: bool, flags: map, reallocationFrequencyMillis: int, version: int, primaryMetric: map{key: str, _versionId: str, name: str, kind: str, isNumeric: bool, eventKey: str, _links: map, isGroup: bool, metrics: [map]}, primarySingleMetric: map{key: str, _versionId: str, name: str, kind: str, isNumeric: bool, unitAggregationType: str, eventKey: str, _links: map}, primaryFunnel: map{key: str, name: str, kind: str, _links: map, metrics: [map]}, randomizationUnit: str, attributes: [str], treatments: [map], secondaryMetrics: [map], metrics: [map], layerSnapshot: map{key: str, name: str, reservationPercent: int, otherReservationPercent: int}, covariateInfo: map{id: str, fileName: str, createdAt: int(int64)}}, previousIterations: [map], analysisConfig: map{bayesianThreshold: str, significanceThreshold: str, testDirection: str, multipleComparisonCorrectionMethod: str, multipleComparisonCorrectionScope: str, sequentialTestingEnabled: bool}} # Experiment response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 405: Method not allowed, 429: Rate limited}

@endpoint PATCH /api/v2/projects/{projectKey}/environments/{environmentKey}/experiments/{experimentKey}
@desc Patch experiment
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, experimentKey: str(string) # The experiment key, instructions: [map]}
@optional {comment: str # Optional comment describing the update}
@returns(200) {_id: str, key: str, name: str, description: str, _maintainerId: str, _creationDate: int(int64), environmentKey: str, methodology: str, dataSource: str, archivedDate: int(int64), tags: [str], _links: map, holdoutId: str, currentIteration: map{_id: str, hypothesis: str, status: str, createdAt: int(int64), startedAt: int(int64), endedAt: int(int64), winningTreatmentId: str, winningReason: str, canReshuffleTraffic: bool, flags: map, reallocationFrequencyMillis: int, version: int, primaryMetric: map{key: str, _versionId: str, name: str, kind: str, isNumeric: bool, eventKey: str, _links: map, isGroup: bool, metrics: [map]}, primarySingleMetric: map{key: str, _versionId: str, name: str, kind: str, isNumeric: bool, unitAggregationType: str, eventKey: str, _links: map}, primaryFunnel: map{key: str, name: str, kind: str, _links: map, metrics: [map]}, randomizationUnit: str, attributes: [str], treatments: [map], secondaryMetrics: [map], metrics: [map], layerSnapshot: map{key: str, name: str, reservationPercent: int, otherReservationPercent: int}, covariateInfo: map{id: str, fileName: str, createdAt: int(int64)}}, type: str, draftIteration: map{_id: str, hypothesis: str, status: str, createdAt: int(int64), startedAt: int(int64), endedAt: int(int64), winningTreatmentId: str, winningReason: str, canReshuffleTraffic: bool, flags: map, reallocationFrequencyMillis: int, version: int, primaryMetric: map{key: str, _versionId: str, name: str, kind: str, isNumeric: bool, eventKey: str, _links: map, isGroup: bool, metrics: [map]}, primarySingleMetric: map{key: str, _versionId: str, name: str, kind: str, isNumeric: bool, unitAggregationType: str, eventKey: str, _links: map}, primaryFunnel: map{key: str, name: str, kind: str, _links: map, metrics: [map]}, randomizationUnit: str, attributes: [str], treatments: [map], secondaryMetrics: [map], metrics: [map], layerSnapshot: map{key: str, name: str, reservationPercent: int, otherReservationPercent: int}, covariateInfo: map{id: str, fileName: str, createdAt: int(int64)}}, previousIterations: [map], analysisConfig: map{bayesianThreshold: str, significanceThreshold: str, testDirection: str, multipleComparisonCorrectionMethod: str, multipleComparisonCorrectionScope: str, sequentialTestingEnabled: bool}} # Experiment response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 409: Conflict, 429: Rate limited}
@example_request {"comment":"Example comment describing the update","instructions":[{"kind":"updateName","value":"Updated experiment name"}]}

@endpoint POST /api/v2/projects/{projectKey}/environments/{environmentKey}/experiments/{experimentKey}/iterations
@desc Create iteration
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, experimentKey: str(string) # The experiment key, hypothesis: str # The expected outcome of this experiment, metrics: [map{key!: str, isGroup: bool, primary: bool}], treatments: [map{name!: str, baseline!: bool, allocationPercent!: str, parameters!: [map]}], flags: map}
@optional {canReshuffleTraffic: bool # 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., primarySingleMetricKey: str # The key of the primary metric for this experiment. Either primarySingleMetricKey or primaryFunnelKey must be present., primaryFunnelKey: str # The key of the primary funnel group for this experiment. Either primarySingleMetricKey or primaryFunnelKey must be present., randomizationUnit: str # The unit of randomization for this iteration. Defaults to user., reallocationFrequencyMillis: int # The cadence (in milliseconds) to update the allocation., covariateId: str # The ID of the covariate CSV, attributes: [str] # The attributes that this iteration's results can be sliced by}
@returns(200) {_id: str, hypothesis: str, status: str, createdAt: int(int64), startedAt: int(int64), endedAt: int(int64), winningTreatmentId: str, winningReason: str, canReshuffleTraffic: bool, flags: map, reallocationFrequencyMillis: int, version: int, primaryMetric: map{key: str, _versionId: str, name: str, kind: str, isNumeric: bool, eventKey: str, _links: map, isGroup: bool, metrics: [map]}, primarySingleMetric: map{key: str, _versionId: str, name: str, kind: str, isNumeric: bool, unitAggregationType: str, eventKey: str, _links: map}, primaryFunnel: map{key: str, name: str, kind: str, _links: map, metrics: [map]}, randomizationUnit: str, attributes: [str], treatments: [map], secondaryMetrics: [map], metrics: [map], layerSnapshot: map{key: str, name: str, reservationPercent: int, otherReservationPercent: int}, covariateInfo: map{id: str, fileName: str, createdAt: int(int64)}} # Iteration response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint POST /api/v2/projects/{projectKey}/environments/{environmentKey}/flags/evaluate
@desc Evaluate flags for context instance
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key}
@optional {limit: int(int64) # The number of feature flags to return. Defaults to -1, which returns all flags, offset: int(int64) # 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`., sort: str(string) # A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order, filter: str(string) # A comma-separated list of filters. Each filter is of the form `field operator value`. Supported fields are explained above.}
@returns(200) {items: [map], totalCount: int, _links: map} # Flag evaluation collection response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}
@example_request {"key":"user-key-123abc","kind":"user","otherAttribute":"other attribute value"}

@endpoint GET /api/v2/projects/{projectKey}/environments/{environmentKey}/followers
@desc Get followers of all flags in a given project and environment
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key}
@returns(200) {_links: map, items: [map]} # Flags and flag followers response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier}

@endpoint GET /api/v2/projects/{projectKey}/environments/{environmentKey}/holdouts
@desc Get all holdouts
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key}
@optional {limit: int(int64) # The number of holdouts to return in the response. Defaults to 20, offset: int(int64) # 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`.}
@returns(200) {items: [map], _links: map, total_count: int} # All Holdouts response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 429: Rate limited}

@endpoint POST /api/v2/projects/{projectKey}/environments/{environmentKey}/holdouts
@desc Create holdout
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key}
@optional {name: str # A human-friendly name for the holdout, key: str # A key that identifies the holdout, description: str # Description of the holdout, randomizationunit: str # The chosen randomization unit for the holdout base experiment, attributes: [str] # The attributes that the holdout iteration's results can be sliced by, holdoutamount: str # Audience allocation for the holdout, primarymetrickey: str # The key of the primary metric for this holdout, metrics: [map{key!: str, isGroup: bool, primary: bool}] # Details on the metrics for this experiment, prerequisiteflagkey: str # The key of the flag that the holdout is dependent on, maintainerId: str # Maintainer id}
@returns(201) {_id: str, status: str, description: str, holdoutAmount: str, createdAt: int(int64), updatedAt: int(int64), baseExperiment: map{_id: str, key: str, name: str, description: str, _maintainerId: str, _creationDate: int(int64), environmentKey: str, methodology: str, dataSource: str, archivedDate: int(int64), tags: [str], _links: map, holdoutId: str, currentIteration: map{_id: str, hypothesis: str, status: str, createdAt: int(int64), startedAt: int(int64), endedAt: int(int64), winningTreatmentId: str, winningReason: str, canReshuffleTraffic: bool, flags: map, reallocationFrequencyMillis: int, version: int, primaryMetric: map{key: str, _versionId: str, name: str, kind: str, isNumeric: bool, eventKey: str, _links: map, isGroup: bool, metrics: [map]}, primarySingleMetric: map{key: str, _versionId: str, name: str, kind: str, isNumeric: bool, unitAggregationType: str, eventKey: str, _links: map}, primaryFunnel: map{key: str, name: str, kind: str, _links: map, metrics: [map]}, randomizationUnit: str, attributes: [str], treatments: [map], secondaryMetrics: [map], metrics: [map], layerSnapshot: map{key: str, name: str, reservationPercent: int, otherReservationPercent: int}, covariateInfo: map{id: str, fileName: str, createdAt: int(int64)}}, type: str, draftIteration: map{_id: str, hypothesis: str, status: str, createdAt: int(int64), startedAt: int(int64), endedAt: int(int64), winningTreatmentId: str, winningReason: str, canReshuffleTraffic: bool, flags: map, reallocationFrequencyMillis: int, version: int, primaryMetric: map{key: str, _versionId: str, name: str, kind: str, isNumeric: bool, eventKey: str, _links: map, isGroup: bool, metrics: [map]}, primarySingleMetric: map{key: str, _versionId: str, name: str, kind: str, isNumeric: bool, unitAggregationType: str, eventKey: str, _links: map}, primaryFunnel: map{key: str, name: str, kind: str, _links: map, metrics: [map]}, randomizationUnit: str, attributes: [str], treatments: [map], secondaryMetrics: [map], metrics: [map], layerSnapshot: map{key: str, name: str, reservationPercent: int, otherReservationPercent: int}, covariateInfo: map{id: str, fileName: str, createdAt: int(int64)}}, previousIterations: [map], analysisConfig: map{bayesianThreshold: str, significanceThreshold: str, testDirection: str, multipleComparisonCorrectionMethod: str, multipleComparisonCorrectionScope: str, sequentialTestingEnabled: bool}}, experiments: [map]} # Holdout response
@errors {400: Invalid request}

@endpoint GET /api/v2/projects/{projectKey}/environments/{environmentKey}/holdouts/id/{holdoutId}
@desc Get Holdout by Id
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, holdoutId: str(string) # The holdout experiment ID}
@returns(200) {_id: str, status: str, description: str, holdoutAmount: str, createdAt: int(int64), updatedAt: int(int64), baseExperiment: map{_id: str, key: str, name: str, description: str, _maintainerId: str, _creationDate: int(int64), environmentKey: str, methodology: str, dataSource: str, archivedDate: int(int64), tags: [str], _links: map, holdoutId: str, currentIteration: map{_id: str, hypothesis: str, status: str, createdAt: int(int64), startedAt: int(int64), endedAt: int(int64), winningTreatmentId: str, winningReason: str, canReshuffleTraffic: bool, flags: map, reallocationFrequencyMillis: int, version: int, primaryMetric: map{key: str, _versionId: str, name: str, kind: str, isNumeric: bool, eventKey: str, _links: map, isGroup: bool, metrics: [map]}, primarySingleMetric: map{key: str, _versionId: str, name: str, kind: str, isNumeric: bool, unitAggregationType: str, eventKey: str, _links: map}, primaryFunnel: map{key: str, name: str, kind: str, _links: map, metrics: [map]}, randomizationUnit: str, attributes: [str], treatments: [map], secondaryMetrics: [map], metrics: [map], layerSnapshot: map{key: str, name: str, reservationPercent: int, otherReservationPercent: int}, covariateInfo: map{id: str, fileName: str, createdAt: int(int64)}}, type: str, draftIteration: map{_id: str, hypothesis: str, status: str, createdAt: int(int64), startedAt: int(int64), endedAt: int(int64), winningTreatmentId: str, winningReason: str, canReshuffleTraffic: bool, flags: map, reallocationFrequencyMillis: int, version: int, primaryMetric: map{key: str, _versionId: str, name: str, kind: str, isNumeric: bool, eventKey: str, _links: map, isGroup: bool, metrics: [map]}, primarySingleMetric: map{key: str, _versionId: str, name: str, kind: str, isNumeric: bool, unitAggregationType: str, eventKey: str, _links: map}, primaryFunnel: map{key: str, name: str, kind: str, _links: map, metrics: [map]}, randomizationUnit: str, attributes: [str], treatments: [map], secondaryMetrics: [map], metrics: [map], layerSnapshot: map{key: str, name: str, reservationPercent: int, otherReservationPercent: int}, covariateInfo: map{id: str, fileName: str, createdAt: int(int64)}}, previousIterations: [map], analysisConfig: map{bayesianThreshold: str, significanceThreshold: str, testDirection: str, multipleComparisonCorrectionMethod: str, multipleComparisonCorrectionScope: str, sequentialTestingEnabled: bool}}, experiments: [map]} # Holdout response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/projects/{projectKey}/environments/{environmentKey}/holdouts/{holdoutKey}
@desc Get holdout
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, holdoutKey: str(string) # The holdout experiment key}
@optional {expand: str(string) # A comma-separated list of properties that can reveal additional information in the response. Supported fields are explained above. Holdout experiment expansion fields have no prefix. Related experiment expansion fields have `rel-` as a prefix.}
@returns(200) {_id: str, status: str, description: str, holdoutAmount: str, isDirty: bool, createdAt: int(int64), updatedAt: int(int64), baseExperiment: map{_id: str, key: str, name: str, description: str, _maintainerId: str, _creationDate: int(int64), environmentKey: str, methodology: str, dataSource: str, archivedDate: int(int64), tags: [str], _links: map, holdoutId: str, currentIteration: map{_id: str, hypothesis: str, status: str, createdAt: int(int64), startedAt: int(int64), endedAt: int(int64), winningTreatmentId: str, winningReason: str, canReshuffleTraffic: bool, flags: map, reallocationFrequencyMillis: int, version: int, primaryMetric: map{key: str, _versionId: str, name: str, kind: str, isNumeric: bool, eventKey: str, _links: map, isGroup: bool, metrics: [map]}, primarySingleMetric: map{key: str, _versionId: str, name: str, kind: str, isNumeric: bool, unitAggregationType: str, eventKey: str, _links: map}, primaryFunnel: map{key: str, name: str, kind: str, _links: map, metrics: [map]}, randomizationUnit: str, attributes: [str], treatments: [map], secondaryMetrics: [map], metrics: [map], layerSnapshot: map{key: str, name: str, reservationPercent: int, otherReservationPercent: int}, covariateInfo: map{id: str, fileName: str, createdAt: int(int64)}}, type: str, draftIteration: map{_id: str, hypothesis: str, status: str, createdAt: int(int64), startedAt: int(int64), endedAt: int(int64), winningTreatmentId: str, winningReason: str, canReshuffleTraffic: bool, flags: map, reallocationFrequencyMillis: int, version: int, primaryMetric: map{key: str, _versionId: str, name: str, kind: str, isNumeric: bool, eventKey: str, _links: map, isGroup: bool, metrics: [map]}, primarySingleMetric: map{key: str, _versionId: str, name: str, kind: str, isNumeric: bool, unitAggregationType: str, eventKey: str, _links: map}, primaryFunnel: map{key: str, name: str, kind: str, _links: map, metrics: [map]}, randomizationUnit: str, attributes: [str], treatments: [map], secondaryMetrics: [map], metrics: [map], layerSnapshot: map{key: str, name: str, reservationPercent: int, otherReservationPercent: int}, covariateInfo: map{id: str, fileName: str, createdAt: int(int64)}}, previousIterations: [map], analysisConfig: map{bayesianThreshold: str, significanceThreshold: str, testDirection: str, multipleComparisonCorrectionMethod: str, multipleComparisonCorrectionScope: str, sequentialTestingEnabled: bool}}, relatedExperiments: [map]} # HoldoutDetail response with full experiments
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint PATCH /api/v2/projects/{projectKey}/environments/{environmentKey}/holdouts/{holdoutKey}
@desc Patch holdout
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, holdoutKey: str(string) # The holdout key, instructions: [map]}
@optional {comment: str # Optional comment describing the update}
@returns(200) {_id: str, status: str, description: str, holdoutAmount: str, createdAt: int(int64), updatedAt: int(int64), baseExperiment: map{_id: str, key: str, name: str, description: str, _maintainerId: str, _creationDate: int(int64), environmentKey: str, methodology: str, dataSource: str, archivedDate: int(int64), tags: [str], _links: map, holdoutId: str, currentIteration: map{_id: str, hypothesis: str, status: str, createdAt: int(int64), startedAt: int(int64), endedAt: int(int64), winningTreatmentId: str, winningReason: str, canReshuffleTraffic: bool, flags: map, reallocationFrequencyMillis: int, version: int, primaryMetric: map{key: str, _versionId: str, name: str, kind: str, isNumeric: bool, eventKey: str, _links: map, isGroup: bool, metrics: [map]}, primarySingleMetric: map{key: str, _versionId: str, name: str, kind: str, isNumeric: bool, unitAggregationType: str, eventKey: str, _links: map}, primaryFunnel: map{key: str, name: str, kind: str, _links: map, metrics: [map]}, randomizationUnit: str, attributes: [str], treatments: [map], secondaryMetrics: [map], metrics: [map], layerSnapshot: map{key: str, name: str, reservationPercent: int, otherReservationPercent: int}, covariateInfo: map{id: str, fileName: str, createdAt: int(int64)}}, type: str, draftIteration: map{_id: str, hypothesis: str, status: str, createdAt: int(int64), startedAt: int(int64), endedAt: int(int64), winningTreatmentId: str, winningReason: str, canReshuffleTraffic: bool, flags: map, reallocationFrequencyMillis: int, version: int, primaryMetric: map{key: str, _versionId: str, name: str, kind: str, isNumeric: bool, eventKey: str, _links: map, isGroup: bool, metrics: [map]}, primarySingleMetric: map{key: str, _versionId: str, name: str, kind: str, isNumeric: bool, unitAggregationType: str, eventKey: str, _links: map}, primaryFunnel: map{key: str, name: str, kind: str, _links: map, metrics: [map]}, randomizationUnit: str, attributes: [str], treatments: [map], secondaryMetrics: [map], metrics: [map], layerSnapshot: map{key: str, name: str, reservationPercent: int, otherReservationPercent: int}, covariateInfo: map{id: str, fileName: str, createdAt: int(int64)}}, previousIterations: [map], analysisConfig: map{bayesianThreshold: str, significanceThreshold: str, testDirection: str, multipleComparisonCorrectionMethod: str, multipleComparisonCorrectionScope: str, sequentialTestingEnabled: bool}}, experiments: [map]} # Holdout response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}
@example_request {"comment":"Optional comment describing the update","instructions":[{"kind":"updateName","value":"Updated holdout name"}]}

@endpoint POST /api/v2/projects/{projectKey}/environments/{environmentKey}/mobileKey
@desc Reset environment mobile SDK key
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key}
@returns(200) {_links: map, _id: str, key: str, name: str, apiKey: str, mobileKey: str, color: str, defaultTtl: int, secureMode: bool, _access: map{denied: [map], allowed: [map]}, defaultTrackEvents: bool, requireComments: bool, confirmChanges: bool, tags: [str], approvalSettings: map{required: bool, bypassApprovalsForPendingChanges: bool, minNumApprovals: int, canReviewOwnRequest: bool, canApplyDeclinedChanges: bool, autoApplyApprovedChanges: bool, serviceKind: str, serviceConfig: map, requiredApprovalTags: [str], serviceKindConfigurationId: str}, resourceApprovalSettings: map, critical: bool} # Environment response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 409: Status conflict, 429: Rate limited}

@endpoint POST /api/v2/projects/{projectKey}/environments/{environmentKey}/segments/evaluate
@desc List segment memberships for context instance
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key}
@returns(200) {items: [map], _links: map} # Context instance segment membership collection response
@errors {400: Invalid request, 401: Invalid access token, 404: Invalid resource identifier}
@example_request {"address":{"city":"Springfield","street":"123 Main Street"},"jobFunction":"doctor","key":"context-key-123abc","kind":"user","name":"Sandy"}

@endpoint GET /api/v2/projects/{projectKey}/experimentation-settings
@desc Get experimentation settings
@required {projectKey: str(string) # The project key}
@returns(200) {_projectId: str, _projectKey: str, randomizationUnits: [map], _creationDate: int(int64), _links: map} # Experimentation settings response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 405: Method not allowed, 429: Rate limited}

@endpoint PUT /api/v2/projects/{projectKey}/experimentation-settings
@desc Update experimentation settings
@required {projectKey: str(string) # The project key, randomizationUnits: [map{randomizationUnit!: str, default: bool, standardRandomizationUnit: str}] # An array of randomization units allowed for this project.}
@returns(200) {_projectId: str, _projectKey: str, randomizationUnits: [map], _creationDate: int(int64), _links: map} # Experimentation settings response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 405: Method not allowed, 429: Rate limited}

@endpoint GET /api/v2/projects/{projectKey}/experiments
@desc Get experiments any environment
@required {projectKey: str(string) # The project key}
@optional {limit: int(int64) # The maximum number of experiments to return. Defaults to 20., offset: int(int64) # 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`., filter: str(string) # A comma-separated list of filters. Each filter is of the form `field:value`. Supported fields are explained above., expand: str(string) # A comma-separated list of properties that can reveal additional information in the response. Supported fields are explained above., lifecycleState: str(string) # A comma-separated list of experiment archived states. Supports `archived`, `active`, or both. Defaults to `active` experiments.}
@returns(200) {items: [map], total_count: int, _links: map} # Experiment collection response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 405: Method not allowed, 429: Rate limited}

@endpoint GET /api/v2/projects/{projectKey}/flag-defaults
@desc Get flag defaults for project
@required {projectKey: str(string) # The project key}
@returns(200) {_links: map, key: str, tags: [str], temporary: bool, defaultClientSideAvailability: map{usingMobileKey: bool, usingEnvironmentId: bool}, booleanDefaults: map{trueDisplayName: str, falseDisplayName: str, trueDescription: str, falseDescription: str, onVariation: int, offVariation: int}} # Flag defaults response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier}

@endpoint PATCH /api/v2/projects/{projectKey}/flag-defaults
@desc Update flag default for project
@required {projectKey: str(string) # The project key}
@returns(200) {_links: map, tags: [str], temporary: bool, booleanDefaults: map{trueDisplayName: str, falseDisplayName: str, trueDescription: str, falseDescription: str, onVariation: int, offVariation: int}, defaultClientSideAvailability: map{usingMobileKey: bool, usingEnvironmentId: bool}} # Flag default response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 409: Status conflict, 429: Rate limited}

@endpoint PUT /api/v2/projects/{projectKey}/flag-defaults
@desc Create or update flag defaults for project
@required {projectKey: str(string) # The project key, tags: [str] # A list of default tags for each flag, temporary: bool # Whether the flag should be temporary by default, booleanDefaults: map{trueDisplayName!: str, falseDisplayName!: str, trueDescription!: str, falseDescription!: str, onVariation!: int, offVariation!: int}, defaultClientSideAvailability: map{usingMobileKey!: bool, usingEnvironmentId!: bool}}
@returns(200) {_links: map, tags: [str], temporary: bool, booleanDefaults: map{trueDisplayName: str, falseDisplayName: str, trueDescription: str, falseDescription: str, onVariation: int, offVariation: int}, defaultClientSideAvailability: map{usingMobileKey: bool, usingEnvironmentId: bool}} # Flag default response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 409: Status conflict, 429: Rate limited}

@endpoint GET /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests
@desc List approval requests for a flag
@required {projectKey: str(string) # The project key, featureFlagKey: str(string) # The feature flag key, environmentKey: str(string) # The environment key}
@returns(200) {items: [map], _links: map} # Approval request collection response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint POST /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests
@desc Create approval request for a flag
@required {projectKey: str(string) # The project key, featureFlagKey: str(string) # The feature flag key, environmentKey: str(string) # The environment key, description: str # A brief description of the changes you're requesting, instructions: [map]}
@optional {comment: str # Optional comment describing the approval request, notifyMemberIds: [str] # An array of member IDs. These members are notified to review the approval request., notifyTeamKeys: [str] # An array of team keys. The members of these teams are notified to review the approval request., executionDate: int(int64), operatingOnId: str # The ID of a scheduled change. Include this if your instructions include editing or deleting a scheduled change., integrationConfig: map}
@returns(201) {_id: str, _version: int, creationDate: int(int64), serviceKind: str, requestorId: str, description: str, reviewStatus: str, allReviews: [map], notifyMemberIds: [str], appliedDate: int(int64), appliedByMemberId: str, appliedByServiceTokenId: str, status: str, instructions: [map], conflicts: [map], _links: map, executionDate: int(int64), operatingOnId: str, integrationMetadata: map{externalId: str, externalStatus: map{display: str, value: str}, externalUrl: str, lastChecked: int(int64)}, source: map{key: str, version: int}, customWorkflowMetadata: map{name: str, stage: map{index: int, name: str}}} # Approval request response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 429: Rate limited}

@endpoint POST /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests-flag-copy
@desc Create approval request to copy flag configurations across environments
@required {projectKey: str(string) # The project key, featureFlagKey: str(string) # The feature flag key, environmentKey: str(string) # The environment key for the target environment, description: str # A brief description of your changes, source: map{key!: str, version: int}}
@optional {comment: str # Optional comment describing the approval request, notifyMemberIds: [str] # An array of member IDs. These members are notified to review the approval request., notifyTeamKeys: [str] # An array of team keys. The members of these teams are notified to review the approval request., includedActions: [str] # 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., excludedActions: [str] # 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.}
@returns(201) {_id: str, _version: int, creationDate: int(int64), serviceKind: str, requestorId: str, description: str, reviewStatus: str, allReviews: [map], notifyMemberIds: [str], appliedDate: int(int64), appliedByMemberId: str, appliedByServiceTokenId: str, status: str, instructions: [map], conflicts: [map], _links: map, executionDate: int(int64), operatingOnId: str, integrationMetadata: map{externalId: str, externalStatus: map{display: str, value: str}, externalUrl: str, lastChecked: int(int64)}, source: map{key: str, version: int}, customWorkflowMetadata: map{name: str, stage: map{index: int, name: str}}} # Approval request response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 409: Status conflict, 429: Rate limited}

@endpoint GET /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{id}
@desc Get approval request for a flag
@required {projectKey: str(string) # The project key, featureFlagKey: str(string) # The feature flag key, environmentKey: str(string) # The environment key, id: str(string) # The feature flag approval request ID}
@returns(200) {_id: str, _version: int, creationDate: int(int64), serviceKind: str, requestorId: str, description: str, reviewStatus: str, allReviews: [map], notifyMemberIds: [str], appliedDate: int(int64), appliedByMemberId: str, appliedByServiceTokenId: str, status: str, instructions: [map], conflicts: [map], _links: map, executionDate: int(int64), operatingOnId: str, integrationMetadata: map{externalId: str, externalStatus: map{display: str, value: str}, externalUrl: str, lastChecked: int(int64)}, source: map{key: str, version: int}, customWorkflowMetadata: map{name: str, stage: map{index: int, name: str}}} # Approval request response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint PATCH /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{id}
@desc Update flag approval request
@required {projectKey: str(string) # The project key, featureFlagKey: str(string) # The feature flag key, environmentKey: str(string) # The environment key, id: str(string) # The approval ID}
@returns(200) {_id: str, _version: int, creationDate: int(int64), serviceKind: str, requestorId: str, description: str, reviewStatus: str, allReviews: [map], notifyMemberIds: [str], appliedDate: int(int64), appliedByMemberId: str, appliedByServiceTokenId: str, status: str, instructions: [map], conflicts: [map], _links: map, executionDate: int(int64), operatingOnId: str, integrationMetadata: map{externalId: str, externalStatus: map{display: str, value: str}, externalUrl: str, lastChecked: int(int64)}, source: map{key: str, version: int}, customWorkflowMetadata: map{name: str, stage: map{index: int, name: str}}} # Approval request response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint DELETE /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{id}
@desc Delete approval request for a flag
@required {projectKey: str(string) # The project key, featureFlagKey: str(string) # The feature flag key, environmentKey: str(string) # The environment key, id: str(string) # The feature flag approval request ID}
@returns(204) Action succeeded
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint POST /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{id}/apply
@desc Apply approval request for a flag
@required {projectKey: str(string) # The project key, featureFlagKey: str(string) # The feature flag key, environmentKey: str(string) # The environment key, id: str(string) # The feature flag approval request ID}
@optional {comment: str # Optional comment about the approval request}
@returns(200) {_id: str, _version: int, creationDate: int(int64), serviceKind: str, requestorId: str, description: str, reviewStatus: str, allReviews: [map], notifyMemberIds: [str], appliedDate: int(int64), appliedByMemberId: str, appliedByServiceTokenId: str, status: str, instructions: [map], conflicts: [map], _links: map, executionDate: int(int64), operatingOnId: str, integrationMetadata: map{externalId: str, externalStatus: map{display: str, value: str}, externalUrl: str, lastChecked: int(int64)}, source: map{key: str, version: int}, customWorkflowMetadata: map{name: str, stage: map{index: int, name: str}}} # Approval request apply response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint POST /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{id}/reviews
@desc Review approval request for a flag
@required {projectKey: str(string) # The project key, featureFlagKey: str(string) # The feature flag key, environmentKey: str(string) # The environment key, id: str(string) # The feature flag approval request ID}
@optional {kind: str(approve/comment/decline) # The type of review for this approval request, comment: str # Optional comment about the approval request}
@returns(200) {_id: str, _version: int, creationDate: int(int64), serviceKind: str, requestorId: str, description: str, reviewStatus: str, allReviews: [map], notifyMemberIds: [str], appliedDate: int(int64), appliedByMemberId: str, appliedByServiceTokenId: str, status: str, instructions: [map], conflicts: [map], _links: map, executionDate: int(int64), operatingOnId: str, integrationMetadata: map{externalId: str, externalStatus: map{display: str, value: str}, externalUrl: str, lastChecked: int(int64)}, source: map{key: str, version: int}, customWorkflowMetadata: map{name: str, stage: map{index: int, name: str}}} # Approval request review response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/followers
@desc Get followers of a flag in a project and environment
@required {projectKey: str(string) # The project key, featureFlagKey: str(string) # The feature flag key, environmentKey: str(string) # The environment key}
@returns(200) {_links: map, items: [map]} # Flag followers response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier}

@endpoint PUT /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/followers/{memberId}
@desc Add a member as a follower of a flag in a project and environment
@required {projectKey: str(string) # The project key, featureFlagKey: str(string) # The feature flag key, environmentKey: str(string) # The environment key, memberId: str(string) # The memberId of the member to add as a follower of the flag. Reader roles can only add themselves.}
@returns(204) Action succeeded
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier}

@endpoint DELETE /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/followers/{memberId}
@desc Remove a member as a follower of a flag in a project and environment
@required {projectKey: str(string) # The project key, featureFlagKey: str(string) # The feature flag key, environmentKey: str(string) # The environment key, memberId: str(string) # The memberId of the member to remove as a follower of the flag. Reader roles can only remove themselves.}
@returns(204) Action succeeded
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier}

@endpoint GET /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/scheduled-changes
@desc List scheduled changes
@required {projectKey: str(string) # The project key, featureFlagKey: str(string) # The feature flag key, environmentKey: str(string) # The environment key}
@returns(200) {items: [map], _links: map} # Scheduled changes collection response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier}

@endpoint POST /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/scheduled-changes
@desc Create scheduled changes workflow
@required {projectKey: str(string) # The project key, featureFlagKey: str(string) # The feature flag key, environmentKey: str(string) # The environment key, executionDate: int(int64), instructions: [map]}
@optional {ignoreConflicts: bool # Whether to succeed (`true`) or fail (`false`) when these instructions conflict with existing scheduled changes, comment: str # Optional comment describing the scheduled changes}
@returns(201) {_id: str, _creationDate: int(int64), _maintainerId: str, _version: int, executionDate: int(int64), instructions: [map], conflicts: any, _links: map} # Scheduled changes response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 405: Method not allowed, 409: Status conflict, 429: Rate limited}
@example_request {"comment":"Optional comment describing the scheduled changes","executionDate":1718467200000,"instructions":[{"kind":"turnFlagOn"}]}

@endpoint GET /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/scheduled-changes/{id}
@desc Get a scheduled change
@required {projectKey: str(string) # The project key, featureFlagKey: str(string) # The feature flag key, environmentKey: str(string) # The environment key, id: str(string) # The scheduled change id}
@returns(200) {_id: str, _creationDate: int(int64), _maintainerId: str, _version: int, executionDate: int(int64), instructions: [map], conflicts: any, _links: map} # Scheduled changes response
@errors {401: Invalid access token, 404: Invalid resource identifier, 429: Rate limited}

@endpoint PATCH /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/scheduled-changes/{id}
@desc Update scheduled changes workflow
@required {projectKey: str(string) # The project key, featureFlagKey: str(string) # The feature flag key, environmentKey: str(string) # The environment key, id: str(string) # The scheduled change ID, instructions: [map]}
@optional {ignoreConflicts: bool # Whether to succeed (`true`) or fail (`false`) when these new instructions conflict with existing scheduled changes, comment: str # Optional comment describing the update to the scheduled changes}
@returns(200) {_id: str, _creationDate: int(int64), _maintainerId: str, _version: int, executionDate: int(int64), instructions: [map], conflicts: any, _links: map} # Scheduled changes response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 405: Method not allowed, 409: Status conflict, 429: Rate limited}
@example_request {"comment":"Optional comment describing the update to the scheduled changes","instructions":[{"kind":"replaceScheduledChangesInstructions","value":[{"kind":"turnFlagOff"}]}]}

@endpoint DELETE /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/scheduled-changes/{id}
@desc Delete scheduled changes workflow
@required {projectKey: str(string) # The project key, featureFlagKey: str(string) # The feature flag key, environmentKey: str(string) # The environment key, id: str(string) # The scheduled change id}
@returns(204) Action succeeded
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 405: Method not allowed, 409: Status conflict, 429: Rate limited}

@endpoint GET /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/workflows
@desc Get workflows
@required {projectKey: str(string) # The project key, featureFlagKey: str(string) # The feature flag key, environmentKey: str(string) # The environment key}
@optional {status: str(string) # Filter results by workflow status. Valid status filters are `active`, `completed`, and `failed`., sort: str(string) # 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`., limit: int(int64) # The maximum number of workflows to return. Defaults to 20., offset: int(int64) # 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`.}
@returns(200) {items: [map], totalCount: int, _links: map} # Workflows collection response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint POST /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/workflows
@desc Create workflow
@required {projectKey: str(string) # The project key, featureFlagKey: str(string) # The feature flag key, environmentKey: str(string) # The environment key, name: str # The workflow name}
@optional {templateKey: str(string) # The template key to apply as a starting point for the new workflow, dryRun: bool # Whether to call the endpoint in dry-run mode, maintainerId: str, description: str # The workflow description, stages: [map{name: str, executeConditionsInSequence: bool, conditions: [map], action: map}] # A list of the workflow stages, templateKey: str # The template key}
@returns(201) {_id: str, _version: int, _conflicts: [map], _creationDate: int(int64), _maintainerId: str, _links: map, name: str, description: str, kind: str, stages: [map], _execution: map{status: str, stopDate: int(int64)}, meta: map{parameters: [map]}, templateKey: str} # Workflow response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}
@example_request {"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"}]}

@endpoint GET /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/workflows/{workflowId}
@desc Get custom workflow
@required {projectKey: str(string) # The project key, featureFlagKey: str(string) # The feature flag key, environmentKey: str(string) # The environment key, workflowId: str(string) # The workflow ID}
@returns(200) {_id: str, _version: int, _conflicts: [map], _creationDate: int(int64), _maintainerId: str, _links: map, name: str, description: str, kind: str, stages: [map], _execution: map{status: str, stopDate: int(int64)}, meta: map{parameters: [map]}, templateKey: str} # Workflow response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint DELETE /api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/workflows/{workflowId}
@desc Delete workflow
@required {projectKey: str(string) # The project key, featureFlagKey: str(string) # The feature flag key, environmentKey: str(string) # The environment key, workflowId: str(string) # The workflow id}
@returns(204) Action completed successfully
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint POST /api/v2/projects/{projectKey}/flags/{flagKey}/environments/{environmentKey}/migration-safety-issues
@desc Get migration safety issues
@required {projectKey: str(string) # The project key, flagKey: str(string) # The migration flag key, environmentKey: str(string) # The environment key, instructions: [map]}
@optional {comment: str}
@returns(200) Migration safety issues found
@returns(204) No safety issues found
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited, 503: Service unavailable}

@endpoint PUT /api/v2/projects/{projectKey}/flags/{flagKey}/release
@desc Create a new release for flag
@required {projectKey: str(string) # The project key, flagKey: str(string) # The flag key, releasePipelineKey: str # The key of the release pipeline to attach the flag to}
@optional {releaseVariationId: str # The variation id to release to across all phases}
@returns(200) {_links: map, name: str, releasePipelineKey: str, releasePipelineDescription: str, phases: [map], _version: int, _releaseVariationId: str, _canceledAt: int(int64)} # Release response
@errors {400: Invalid request, 401: Invalid access token, 404: Invalid resource identifier, 429: Rate limit exceeded}

@endpoint PUT /api/v2/projects/{projectKey}/flags/{flagKey}/release/phases/{phaseId}
@desc Update phase status for release
@required {projectKey: str(string) # The project key, flagKey: str(string) # The flag key, phaseId: str(string) # The phase ID}
@optional {status: str, audiences: [map{audienceId: str, releaseGuardianConfiguration: map, notifyMemberIds: [str], notifyTeamKeys: [str]}] # Extra configuration for audiences required upon phase initialization.}
@returns(200) {_links: map, name: str, releasePipelineKey: str, releasePipelineDescription: str, phases: [map], _version: int, _releaseVariationId: str, _canceledAt: int(int64)} # Action succeeded
@errors {400: Invalid request, 401: Invalid access token, 404: release or phase not found, 429: Rate limit exceeded}

@endpoint GET /api/v2/projects/{projectKey}/layers
@desc Get layers
@required {projectKey: str(string) # The project key}
@optional {filter: str(string) # A comma-separated list of filters. This endpoint only accepts filtering by `experimentKey`. The filter returns layers which include that experiment for the selected environment(s). For example: `filter=reservations.experimentKey contains expKey`.}
@returns(200) {items: [map], totalCount: int, _links: map} # Layer Collection response
@errors {400: Invalid request, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint POST /api/v2/projects/{projectKey}/layers
@desc Create layer
@required {projectKey: str(string) # The project key, key: str # Unique identifier for the layer, name: str # Layer name, description: str # The checkout flow for the application}
@returns(201) {key: str, name: str, description: str, createdAt: int(int64), randomizationUnit: str, environments: map} # Layer response
@errors {400: Invalid request, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint PATCH /api/v2/projects/{projectKey}/layers/{layerKey}
@desc Update layer
@required {projectKey: str(string) # The project key, layerKey: str(string) # The layer key, instructions: [map]}
@optional {comment: str # Optional comment describing the update, environmentKey: str # The environment key used for making environment specific updates. For example, updating the reservation of an experiment}
@returns(200) {key: str, name: str, description: str, createdAt: int(int64), randomizationUnit: str, environments: map} # Layer response
@errors {400: Invalid request, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}
@example_request {"comment":"Example comment describing the update","environmentKey":"production","instructions":[{"experimentKey":"checkout-button-color","kind":"updateExperimentReservation","reservationPercent":25}]}

@endpoint GET /api/v2/projects/{projectKey}/metric-groups
@desc List metric groups
@required {projectKey: str(string) # The project key}
@optional {filter: str(string) # Accepts filter by `experimentStatus`, `query`, `kind`, `hasConnections`, `maintainerIds`, and `maintainerTeamKey`. Example: `filter=experimentStatus equals 'running' and query equals 'test'`., sort: str(string) # 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., expand: str(string) # This parameter is reserved for future use and is not currently supported on this endpoint., limit: int(int64) # The number of metric groups to return in the response. Defaults to 20. Maximum limit is 50., offset: int(int64) # 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.}
@returns(200) {items: [map], _links: map, totalCount: int} # Metric group collection response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 405: Method not allowed, 429: Rate limited}

@endpoint POST /api/v2/projects/{projectKey}/metric-groups
@desc Create metric group
@required {projectKey: str(string) # The project key, name: str # A human-friendly name for the metric group, kind: str(funnel/standard) # The type of the metric group, maintainerId: str # The ID of the member who maintains this metric group, tags: [str] # Tags for the metric group, metrics: [map{key!: str, nameInGroup!: str}] # An ordered list of the metrics in this metric group}
@optional {key: str # A unique key to reference the metric group, description: str # Description of the metric group}
@returns(201) {_id: str, key: str, name: str, kind: str, description: str, _links: map, _access: map{denied: [map], allowed: [map]}, tags: [str], _creationDate: int(int64), _lastModified: int(int64), maintainer: map{member: map{_links: map, _id: str, firstName: str, lastName: str, role: str, email: str}, team: map{customRoleKeys: [str], key: str, _links: map, name: str}}, metrics: [map], _version: int, experiments: [map], experimentCount: int, activeExperimentCount: int, activeGuardedRolloutCount: int} # Metric group response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 405: Method not allowed, 429: Rate limited}

@endpoint GET /api/v2/projects/{projectKey}/metric-groups/{metricGroupKey}
@desc Get metric group
@required {projectKey: str(string) # The project key, metricGroupKey: str(string) # The metric group key}
@optional {expand: str(string) # A comma-separated list of properties that can reveal additional information in the response.}
@returns(200) {_id: str, key: str, name: str, kind: str, description: str, _links: map, _access: map{denied: [map], allowed: [map]}, tags: [str], _creationDate: int(int64), _lastModified: int(int64), maintainer: map{member: map{_links: map, _id: str, firstName: str, lastName: str, role: str, email: str}, team: map{customRoleKeys: [str], key: str, _links: map, name: str}}, metrics: [map], _version: int, experiments: [map], experimentCount: int, activeExperimentCount: int, activeGuardedRolloutCount: int} # Metric group response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 405: Method not allowed, 429: Rate limited}

@endpoint PATCH /api/v2/projects/{projectKey}/metric-groups/{metricGroupKey}
@desc Patch metric group
@required {projectKey: str(string) # The project key, metricGroupKey: str(string) # The metric group key}
@returns(200) {_id: str, key: str, name: str, kind: str, description: str, _links: map, _access: map{denied: [map], allowed: [map]}, tags: [str], _creationDate: int(int64), _lastModified: int(int64), maintainer: map{member: map{_links: map, _id: str, firstName: str, lastName: str, role: str, email: str}, team: map{customRoleKeys: [str], key: str, _links: map, name: str}}, metrics: [map], _version: int, experiments: [map], experimentCount: int, activeExperimentCount: int, activeGuardedRolloutCount: int} # Metric group response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 405: Method not allowed, 429: Rate limited}
@example_request [{"op":"replace","path":"/name","value":"my-updated-metric-group"}]

@endpoint DELETE /api/v2/projects/{projectKey}/metric-groups/{metricGroupKey}
@desc Delete metric group
@required {projectKey: str(string) # The project key, metricGroupKey: str(string) # The metric group key}
@returns(204) Action succeeded
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 405: Method not allowed, 429: Rate limited}

@endpoint GET /api/v2/projects/{projectKey}/release-pipelines
@desc Get all release pipelines
@required {projectKey: str(string) # The project key}
@optional {filter: str(string) # 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., limit: int(int64) # The maximum number of items to return. Defaults to 20., offset: int(int64) # 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`.}
@returns(200) {items: [map], totalCount: int} # Release pipeline collection
@errors {404: Invalid resource identifier}

@endpoint POST /api/v2/projects/{projectKey}/release-pipelines
@desc Create a release pipeline
@required {projectKey: str(string) # The project key, key: str # The unique identifier of this release pipeline, name: str # The name of the release pipeline, phases: [map{audiences!: [map], name!: str, configuration: map}] # A logical grouping of one or more environments that share attributes for rolling out changes}
@optional {description: str # The release pipeline description, tags: [str] # A list of tags for this release pipeline, isProjectDefault: bool # Whether or not the newly created pipeline should be set as the default pipeline for this project, isLegacy: bool # Whether or not the pipeline is enabled for Release Automation.}
@returns(201) {createdAt: str(date-time), description: str, key: str, name: str, phases: [map], tags: [str], _version: int, _access: map{denied: [map], allowed: [map]}, isProjectDefault: bool, _isLegacy: bool} # Release pipeline response
@errors {400: Invalid request, 403: Forbidden, 404: Invalid resource identifier, 409: Status conflict}

@endpoint GET /api/v2/projects/{projectKey}/release-pipelines/{pipelineKey}
@desc Get release pipeline by key
@required {projectKey: str(string) # The project key, pipelineKey: str(string) # The release pipeline key}
@returns(200) {createdAt: str(date-time), description: str, key: str, name: str, phases: [map], tags: [str], _version: int, _access: map{denied: [map], allowed: [map]}, isProjectDefault: bool, _isLegacy: bool} # Release pipeline response
@errors {404: Invalid resource identifier}

@endpoint PUT /api/v2/projects/{projectKey}/release-pipelines/{pipelineKey}
@desc Update a release pipeline
@required {projectKey: str(string) # The project key, pipelineKey: str(string) # The release pipeline key, name: str # The name of the release pipeline, phases: [map{audiences!: [map], name!: str, configuration: map}] # A logical grouping of one or more environments that share attributes for rolling out changes}
@optional {description: str # The release pipeline description, tags: [str] # A list of tags for this release pipeline}
@returns(200) {createdAt: str(date-time), description: str, key: str, name: str, phases: [map], tags: [str], _version: int, _access: map{denied: [map], allowed: [map]}, isProjectDefault: bool, _isLegacy: bool} # Release pipeline response
@errors {400: Invalid request, 403: Forbidden, 404: Invalid resource identifier}

@endpoint DELETE /api/v2/projects/{projectKey}/release-pipelines/{pipelineKey}
@desc Delete release pipeline
@required {projectKey: str(string) # The project key, pipelineKey: str(string) # The release pipeline key}
@returns(204) Action succeeded
@errors {403: Forbidden, 404: Invalid resource identifier}

@endpoint GET /api/v2/projects/{projectKey}/release-pipelines/{pipelineKey}/releases
@desc Get release progressions for release pipeline
@required {projectKey: str(string) # The project key, pipelineKey: str(string) # The pipeline key}
@optional {filter: str(string) # Accepts filter by `status` and `activePhaseId`. `status` can take a value of `completed` or `active`. `activePhaseId` takes a UUID and will filter results down to releases active on the specified phase. Providing `status equals completed` along with an `activePhaseId` filter will return an error as they are disjoint sets of data. The combination of `status equals active` and `activePhaseId` will return the same results as `activePhaseId` alone., limit: int(int64) # The maximum number of items to return. Defaults to 20., offset: int(int64) # 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`.}
@returns(200) {activeCount: int, completedCount: int, items: [map], phases: [map], totalCount: int, _links: map} # Release progression collection
@errors {404: Invalid resource identifier}

@endpoint GET /api/v2/public-ip-list
@desc Gets the public IP list
@returns(200) {addresses: [str], outboundAddresses: [str]} # Public IP response
@errors {429: Rate limited}

@endpoint GET /api/v2/roles
@desc List custom roles
@optional {limit: int(int64) # The maximum number of custom roles to return. Defaults to 20., offset: int(int64) # 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`.}
@returns(200) {_links: map, items: [map], totalCount: int} # Custom roles collection response
@errors {401: Invalid access token, 403: Forbidden, 429: Rate limited}

@endpoint POST /api/v2/roles
@desc Create custom role
@required {name: str # A human-friendly name for the custom role, key: str # The custom role key, policy: [map{resources: [str], notResources: [str], actions: [str], notActions: [str], effect!: str}]}
@optional {description: str # Description of custom role, basePermissions: str, resourceCategory: str}
@returns(201) {_id: str, _links: map, _access: map{denied: [map], allowed: [map]}, description: str, key: str, name: str, policy: [map], basePermissions: str, resourceCategory: str, assignedTo: map{membersCount: int, teamsCount: int}, _presetBundleVersion: int, _presetStatements: [map]} # Custom role response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 409: Status conflict, 429: Rate limited}
@example_request {"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/*"]}]}

@endpoint GET /api/v2/roles/{customRoleKey}
@desc Get custom role
@required {customRoleKey: str(string) # The custom role key or ID}
@returns(200) {_id: str, _links: map, _access: map{denied: [map], allowed: [map]}, description: str, key: str, name: str, policy: [map], basePermissions: str, resourceCategory: str, assignedTo: map{membersCount: int, teamsCount: int}, _presetBundleVersion: int, _presetStatements: [map]} # Custom role response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint PATCH /api/v2/roles/{customRoleKey}
@desc Update custom role
@required {customRoleKey: str(string) # The custom role key, patch: [map{op!: str, path!: str, value: any}]}
@optional {comment: str # Optional comment}
@returns(200) {_id: str, _links: map, _access: map{denied: [map], allowed: [map]}, description: str, key: str, name: str, policy: [map], basePermissions: str, resourceCategory: str, assignedTo: map{membersCount: int, teamsCount: int}, _presetBundleVersion: int, _presetStatements: [map]} # Custom role response
@errors {400: Invalid request, 401: Invalid access token, 404: Invalid resource identifier, 409: Status conflict, 429: Rate limited}
@example_request {"patch":[{"op":"add","path":"/policy/0","value":{"actions":["updateOn"],"effect":"allow","resources":["proj/*:env/qa:flag/*"]}}]}

@endpoint DELETE /api/v2/roles/{customRoleKey}
@desc Delete custom role
@required {customRoleKey: str(string) # The custom role key}
@returns(204) Action succeeded
@errors {401: Invalid access token, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/segments/{projectKey}/{environmentKey}
@desc List segments
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key}
@optional {limit: int(int64) # The number of segments to return. Defaults to 20., offset: int(int64) # 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`., sort: str(string) # 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., filter: str(string) # Accepts filter by `excludedKeys`, `external`, `includedKeys`, `query`, `tags`, `unbounded`, `view`. To learn more about the filter syntax, read the  'Filtering segments' section above.}
@returns(200) {items: [map], _links: map, totalCount: int} # Segment collection response
@errors {401: Invalid access token, 404: Invalid resource identifier}

@endpoint POST /api/v2/segments/{projectKey}/{environmentKey}
@desc Create segment
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, name: str # A human-friendly name for the segment, key: str # A unique key used to reference the segment}
@optional {description: str # A description of the segment's purpose, tags: [str] # Tags for the segment, unbounded: bool # 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., unboundedContextKind: str # For big segments, the targeted context kind.}
@returns(201) {name: str, description: str, tags: [str], creationDate: int(int64), lastModifiedDate: int(int64), key: str, included: [str], excluded: [str], includedContexts: [map], excludedContexts: [map], _links: map, rules: [map], version: int, deleted: bool, _access: map{denied: [map], allowed: [map]}, _flags: [map], unbounded: bool, unboundedContextKind: str, generation: int, _unboundedMetadata: map{envId: str, segmentId: str, version: int, includedCount: int, excludedCount: int, lastModified: int(int64), deleted: bool}, _external: str, _externalLink: str, _importInProgress: bool} # Segment response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}
@desc Get segment
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, segmentKey: str(string) # The segment key}
@returns(200) {name: str, description: str, tags: [str], creationDate: int(int64), lastModifiedDate: int(int64), key: str, included: [str], excluded: [str], includedContexts: [map], excludedContexts: [map], _links: map, rules: [map], version: int, deleted: bool, _access: map{denied: [map], allowed: [map]}, _flags: [map], unbounded: bool, unboundedContextKind: str, generation: int, _unboundedMetadata: map{envId: str, segmentId: str, version: int, includedCount: int, excludedCount: int, lastModified: int(int64), deleted: bool}, _external: str, _externalLink: str, _importInProgress: bool} # Segment response
@errors {401: Invalid access token, 404: Invalid resource identifier, 429: Rate limited}

@endpoint PATCH /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}
@desc Patch segment
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, segmentKey: str(string) # The segment key, patch: [map{op!: str, path!: str, value: any}]}
@optional {dryRun: bool # If true, the patch will be validated but not persisted. Returns a preview of the segment after the patch is applied., comment: str # Optional comment}
@returns(200) {name: str, description: str, tags: [str], creationDate: int(int64), lastModifiedDate: int(int64), key: str, included: [str], excluded: [str], includedContexts: [map], excludedContexts: [map], _links: map, rules: [map], version: int, deleted: bool, _access: map{denied: [map], allowed: [map]}, _flags: [map], unbounded: bool, unboundedContextKind: str, generation: int, _unboundedMetadata: map{envId: str, segmentId: str, version: int, includedCount: int, excludedCount: int, lastModified: int(int64), deleted: bool}, _external: str, _externalLink: str, _importInProgress: bool} # Segment response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 409: Status conflict, 429: Rate limited}
@example_request {"patch":[{"op":"replace","path":"/description","value":"New description for this segment"},{"op":"add","path":"/tags/0","value":"example"}]}

@endpoint DELETE /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}
@desc Delete segment
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, segmentKey: str(string) # The segment key}
@returns(204) Action succeeded
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 409: Status conflict, 429: Rate limited}

@endpoint POST /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/contexts
@desc Update context targets on a big segment
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, segmentKey: str(string) # The segment key}
@optional {included: map{add: [str], remove: [str]}, excluded: map{add: [str], remove: [str]}}
@returns(204) Action succeeded
@errors {400: Invalid request, 401: Invalid access token, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/contexts/{contextKey}
@desc Get big segment membership for context
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, segmentKey: str(string) # The segment key, contextKey: str(string) # The context key}
@returns(200) {userKey: str, included: bool, excluded: bool} # Segment membership for context response
@errors {400: Invalid request, 401: Invalid access token, 404: Invalid resource identifier, 429: Rate limited}

@endpoint POST /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/exports
@desc Create big segment export
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, segmentKey: str(string) # The segment key}
@returns(200) Action succeeded
@errors {400: Invalid request, 401: Invalid access token, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/exports/{exportID}
@desc Get big segment export
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, segmentKey: str(string) # The segment key, exportID: str(string) # The export ID}
@returns(200) {id: str, segmentKey: str, creationTime: int(int64), status: str, sizeBytes: int(int64), size: str, initiator: map{name: str, email: str}, _links: map} # Segment export response
@errors {400: Invalid request, 404: Invalid resource identifier, 429: Rate limited}

@endpoint POST /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/imports
@desc Create big segment import
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, segmentKey: str(string) # The segment key}
@returns(204) Import request submitted successfully
@errors {400: Invalid request, 401: Invalid access token, 404: Invalid resource identifier, 409: Conflicting process, 429: Rate limited}

@endpoint GET /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/imports/{importID}
@desc Get big segment import
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, segmentKey: str(string) # The segment key, importID: str(string) # The import ID}
@returns(200) {id: str, segmentKey: str, creationTime: int(int64), mode: str, status: str, files: [map], _links: map} # Segment import response
@errors {400: Invalid request, 404: Invalid resource identifier, 429: Rate limited}

@endpoint POST /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/users
@desc Update user context targets on a big segment
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, segmentKey: str(string) # The segment key}
@optional {included: map{add: [str], remove: [str]}, excluded: map{add: [str], remove: [str]}}
@returns(204) Action succeeded
@errors {400: Invalid request, 401: Invalid access token, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/users/{userKey}
@desc Get big segment membership for user
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, segmentKey: str(string) # The segment key, userKey: str(string) # The user key}
@returns(200) {userKey: str, included: bool, excluded: bool} # Segment membership for user response
@errors {400: Invalid request, 401: Invalid access token, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/segments/{projectKey}/{segmentKey}/expiring-targets/{environmentKey}
@desc Get expiring targets for segment
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, segmentKey: str(string) # The segment key}
@returns(200) {items: [map], _links: map} # Expiring context target response
@errors {401: Invalid access token, 404: Invalid resource identifier, 429: Rate limited}

@endpoint PATCH /api/v2/segments/{projectKey}/{segmentKey}/expiring-targets/{environmentKey}
@desc Update expiring targets for segment
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, segmentKey: str(string) # The segment key, instructions: [map{kind!: str, contextKey!: str, contextKind!: str, targetType!: str, value: int(int64), version: int}] # Semantic patch instructions for the desired changes to the resource}
@optional {comment: str # Optional description of changes}
@returns(200) {items: [map], _links: map, totalInstructions: int, successfulInstructions: int, failedInstructions: int, errors: [map]} # Expiring  target response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 409: Status conflict, 429: Rate limited}

@endpoint GET /api/v2/segments/{projectKey}/{segmentKey}/expiring-user-targets/{environmentKey}
@desc Get expiring user targets for segment
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, segmentKey: str(string) # The segment key}
@returns(200) {items: [map], _links: map} # Expiring user target response
@errors {401: Invalid access token, 404: Invalid resource identifier, 429: Rate limited}

@endpoint PATCH /api/v2/segments/{projectKey}/{segmentKey}/expiring-user-targets/{environmentKey}
@desc Update expiring user targets for segment
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, segmentKey: str(string) # The segment key, instructions: [map{kind!: str, userKey!: str, targetType!: str, value: int, version: int}] # Semantic patch instructions for the desired changes to the resource}
@optional {comment: str # Optional description of changes}
@returns(200) {items: [map], _links: map, totalInstructions: int, successfulInstructions: int, failedInstructions: int, errors: [map]} # Expiring user target response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 409: Status conflict, 429: Rate limited}

@endpoint GET /api/v2/teams
@desc List teams
@optional {limit: int(int64) # The number of teams to return in the response. Defaults to 20., offset: int(int64) # 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., filter: str(string) # A comma-separated list of filters. Each filter is constructed as `field:value`., expand: str(string) # A comma-separated list of properties that can reveal additional information in the response.}
@returns(200) {items: [map], _links: map, totalCount: int} # Teams collection response
@errors {401: Invalid access token, 405: Method not allowed, 429: Rate limited}

@endpoint POST /api/v2/teams
@desc Create team
@required {key: str # The team key, name: str # A human-friendly name for the team}
@optional {expand: str(string) # A comma-separated list of properties that can reveal additional information in the response. Supported fields are explained above., customRoleKeys: [str] # List of custom role keys the team will access, description: str # A description of the team, memberIDs: [str] # A list of member IDs who belong to the team, permissionGrants: [map{actionSet: str, actions: [str], memberIDs: [str]}] # A list of permission grants. Permission grants allow access to a specific action, without having to create or update a custom role., roleAttributes: map}
@returns(201) {description: str, key: str, name: str, _access: map{denied: [map], allowed: [map]}, _creationDate: int(int64), _links: map, _lastModified: int(int64), _version: int, _idpSynced: bool, roleAttributes: map, roles: map{totalCount: int, items: [map], _links: map}, members: map{totalCount: int}, projects: map{totalCount: int, items: [map]}, maintainers: map{totalCount: int, items: [map], _links: map}} # Teams response
@errors {400: Invalid request, 401: Invalid access token, 405: Method not allowed, 429: Rate limited}
@example_request {"customRoleKeys":["example-role1","example-role2"],"description":"An example team","key":"team-key-123abc","memberIDs":["12ab3c45de678910fgh12345"],"name":"Example team"}

@endpoint PATCH /api/v2/teams
@desc Update teams
@required {instructions: [map]}
@optional {comment: str # Optional comment describing the update}
@returns(200) {memberIDs: [str], teamKeys: [str], errors: [map]} # Teams response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 409: Status conflict, 429: Rate limited}
@example_request {"comment":"Optional comment about the update","instructions":[{"kind":"addMembersToTeams","memberIDs":["1234a56b7c89d012345e678f"],"teamKeys":["example-team-1","example-team-2"]}]}

@endpoint GET /api/v2/teams/{teamKey}
@desc Get team
@required {teamKey: str(string) # The team key.}
@optional {expand: str(string) # A comma-separated list of properties that can reveal additional information in the response.}
@returns(200) {description: str, key: str, name: str, _access: map{denied: [map], allowed: [map]}, _creationDate: int(int64), _links: map, _lastModified: int(int64), _version: int, _idpSynced: bool, roleAttributes: map, roles: map{totalCount: int, items: [map], _links: map}, members: map{totalCount: int}, projects: map{totalCount: int, items: [map]}, maintainers: map{totalCount: int, items: [map], _links: map}} # Teams response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 405: Method not allowed, 429: Rate limited}

@endpoint PATCH /api/v2/teams/{teamKey}
@desc Update team
@required {teamKey: str(string) # The team key, instructions: [map]}
@optional {expand: str(string) # A comma-separated list of properties that can reveal additional information in the response. Supported fields are explained above., comment: str # Optional comment describing the update}
@returns(200) {description: str, key: str, name: str, _access: map{denied: [map], allowed: [map]}, _creationDate: int(int64), _links: map, _lastModified: int(int64), _version: int, _idpSynced: bool, roleAttributes: map, roles: map{totalCount: int, items: [map], _links: map}, members: map{totalCount: int}, projects: map{totalCount: int, items: [map]}, maintainers: map{totalCount: int, items: [map], _links: map}} # Teams response
@errors {400: Invalid request, 401: Invalid access token, 404: Invalid resource identifier, 405: Method not allowed, 409: Status conflict, 429: Rate limited}
@example_request {"comment":"Optional comment about the update","instructions":[{"kind":"updateDescription","value":"New description for the team"}]}

@endpoint DELETE /api/v2/teams/{teamKey}
@desc Delete team
@required {teamKey: str(string) # The team key}
@returns(204) Action succeeded
@errors {401: Invalid access token, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/teams/{teamKey}/maintainers
@desc Get team maintainers
@required {teamKey: str(string) # The team key}
@optional {limit: int(int64) # The number of maintainers to return in the response. Defaults to 20., offset: int(int64) # 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`.}
@returns(200) {totalCount: int, items: [map], _links: map} # Team maintainers response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 405: Method not allowed, 429: Rate limited}

@endpoint POST /api/v2/teams/{teamKey}/members
@desc Add multiple members to team
@required {teamKey: str(string) # The team key}
@returns(201) {items: [map]} # Team member imports response
@returns(207) {items: [map]} # Partial Success
@errors {400: Invalid request, 401: Invalid access token, 405: Method not allowed, 429: Rate limited}

@endpoint GET /api/v2/teams/{teamKey}/roles
@desc Get team custom roles
@required {teamKey: str(string) # The team key}
@optional {limit: int(int64) # The number of roles to return in the response. Defaults to 20., offset: int(int64) # 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`.}
@returns(200) {totalCount: int, items: [map], _links: map} # Team roles response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 405: Method not allowed, 429: Rate limited}

@endpoint GET /api/v2/templates
@desc Get workflow templates
@optional {summary: bool # Whether the entire template object or just a summary should be returned, search: str(string) # The substring in either the name or description of a template}
@returns(200) {items: [map]} # Workflow templates list response JSON
@errors {401: Invalid access token, 404: Invalid resource identifier, 429: Rate limited}

@endpoint POST /api/v2/templates
@desc Create workflow template
@required {key: str}
@optional {name: str, description: str, workflowId: str, stages: [map{name: str, executeConditionsInSequence: bool, conditions: [map], action: map}], projectKey: str, environmentKey: str, flagKey: str}
@returns(201) {_id: str, _key: str, name: str, _creationDate: int(int64), _ownerId: str, _maintainerId: str, _links: map, description: str, stages: [map]} # Workflow template response JSON
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 429: Rate limited}

@endpoint DELETE /api/v2/templates/{templateKey}
@desc Delete workflow template
@required {templateKey: str(string) # The template key}
@returns(204) Action completed successfully
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/tokens
@desc List access tokens
@optional {showAll: bool # If set to true, and the authentication access token has the 'Admin' role, personal access tokens for all members will be retrieved., limit: int(int64) # The number of access tokens to return in the response. Defaults to 25., offset: int(int64) # 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`.}
@returns(200) {items: [map], _links: map, totalCount: int} # Access tokens collection response
@errors {401: Invalid access token, 403: Forbidden, 429: Rate limited}

@endpoint POST /api/v2/tokens
@desc Create access token
@optional {name: str # A human-friendly name for the access token, description: str # A description for the access token, role: str(reader/writer/admin) # Base role for the token, customRoleIds: [str] # A list of custom role IDs to use as access limits for the access token, inlineRole: [map{resources: [str], notResources: [str], actions: [str], notActions: [str], effect!: str}] # A JSON array of statements represented as JSON objects with three attributes: effect, resources, actions. May be used in place of a role., serviceToken: bool # Whether the token is a service token, defaultApiVersion: int # The default API version for this token}
@returns(201) {_id: str, ownerId: str, memberId: str, _member: map{_links: map, _id: str, firstName: str, lastName: str, role: str, email: str}, name: str, description: str, creationDate: int(int64), lastModified: int(int64), customRoleIds: [str], inlineRole: [map], role: str, token: str, serviceToken: bool, _links: map, defaultApiVersion: int, lastUsed: int(int64)} # Access token response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 429: Rate limited}
@example_request {"role":"reader"}

@endpoint GET /api/v2/tokens/{id}
@desc Get access token
@required {id: str(string) # The ID of the access token}
@returns(200) {_id: str, ownerId: str, memberId: str, _member: map{_links: map, _id: str, firstName: str, lastName: str, role: str, email: str}, name: str, description: str, creationDate: int(int64), lastModified: int(int64), customRoleIds: [str], inlineRole: [map], role: str, token: str, serviceToken: bool, _links: map, defaultApiVersion: int, lastUsed: int(int64)} # Access token response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint PATCH /api/v2/tokens/{id}
@desc Patch access token
@required {id: str(string) # The ID of the access token to update}
@returns(200) {_id: str, ownerId: str, memberId: str, _member: map{_links: map, _id: str, firstName: str, lastName: str, role: str, email: str}, name: str, description: str, creationDate: int(int64), lastModified: int(int64), customRoleIds: [str], inlineRole: [map], role: str, token: str, serviceToken: bool, _links: map, defaultApiVersion: int, lastUsed: int(int64)} # Access token response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 409: Status conflict, 422: Invalid patch content, 429: Rate limited}
@example_request [{"op":"replace","path":"/role","value":"writer"}]

@endpoint DELETE /api/v2/tokens/{id}
@desc Delete access token
@required {id: str(string) # The ID of the access token to update}
@returns(204) Action succeeded
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint POST /api/v2/tokens/{id}/reset
@desc Reset access token
@required {id: str(string) # The ID of the access token to update}
@optional {expiry: int(int64) # An expiration time for the old token key, expressed as a Unix epoch time in milliseconds. By default, the token will expire immediately.}
@returns(200) {_id: str, ownerId: str, memberId: str, _member: map{_links: map, _id: str, firstName: str, lastName: str, role: str, email: str}, name: str, description: str, creationDate: int(int64), lastModified: int(int64), customRoleIds: [str], inlineRole: [map], role: str, token: str, serviceToken: bool, _links: map, defaultApiVersion: int, lastUsed: int(int64)} # Access token response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/usage/clientside-contexts
@desc Get contexts clientside usage
@optional {from: str(string) # The series of data returned starts from this timestamp (Unix milliseconds). Defaults to the beginning of the current month., to: str(string) # The series of data returned ends at this timestamp (Unix milliseconds). Defaults to the current time., projectKey: str(string) # A project key to filter results by. Can be specified multiple times, one query parameter per project key., environmentKey: str(string) # An environment key to filter results by. If specified, exactly one `projectKey` must be provided. Can be specified multiple times, one query parameter per environment key., contextKind: str(string) # A context kind to filter results by. Can be specified multiple times, one query parameter per context kind., sdkName: str(string) # An SDK name to filter results by. Can be specified multiple times, one query parameter per SDK name., anonymous: str(string) # An anonymous value to filter results by. Can be specified multiple times, one query parameter per anonymous value.Valid values: `true`, `false`., groupBy: str(string) # If specified, returns data for each distinct value of the given field. `contextKind` is always included as a grouping dimension. Can be specified multiple times to group data by multiple dimensions, one query parameter per dimension.Valid values: `projectId`, `environmentId`, `sdkName`, `sdkAppId`, `anonymousV2`., aggregationType: str(string) # Specifies the aggregation method. Defaults to `month_to_date`.Valid values: `month_to_date`, `incremental`, `rolling_30d`., granularity: str(string) # Specifies the data granularity. Defaults to `daily`. Valid values depend on `aggregationType`: **month_to_date** supports `daily` and `monthly`; **incremental** and **rolling_30d** support `daily` only.}
@returns(200) {_links: map, metadata: [map], series: [map]} # Usage response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 429: Rate limited, 503: Service unavailable}

@endpoint GET /api/v2/usage/clientside-mau
@desc Get MAU clientside usage
@optional {from: str(string) # The series of data returned starts from this timestamp (Unix milliseconds). Defaults to the beginning of the current month., to: str(string) # The series of data returned ends at this timestamp (Unix milliseconds). Defaults to the current time., projectKey: str(string) # A project key to filter results by. Can be specified multiple times, one query parameter per project key., environmentKey: str(string) # An environment key to filter results by. If specified, exactly one `projectKey` must be provided. Can be specified multiple times, one query parameter per environment key., sdkName: str(string) # An SDK name to filter results by. Can be specified multiple times, one query parameter per SDK name., anonymous: str(string) # An anonymous value to filter results by. Can be specified multiple times, one query parameter per anonymous value.Valid values: `true`, `false`., groupBy: str(string) # If specified, returns data for each distinct value of the given field. Can be specified multiple times to group data by multiple dimensions, one query parameter per dimension.Valid values: `projectId`, `environmentId`, `sdkName`, `sdkAppId`, `anonymousV2`., aggregationType: str(string) # Specifies the aggregation method. Defaults to `month_to_date`.Valid values: `month_to_date`, `incremental`, `rolling_30d`., granularity: str(string) # Specifies the data granularity. Defaults to `daily`. Valid values depend on `aggregationType`: **month_to_date** supports `daily` and `monthly`; **incremental** and **rolling_30d** support `daily` only.}
@returns(200) {_links: map, metadata: [map], series: [map]} # Usage response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 429: Rate limited, 503: Service unavailable}

@endpoint GET /api/v2/usage/data-export-events
@desc Get data export events usage
@optional {from: str(string) # The series of data returned starts from this timestamp (Unix milliseconds). Defaults to the beginning of the current month., to: str(string) # The series of data returned ends at this timestamp (Unix milliseconds). Defaults to the current time., projectKey: str(string) # A project key to filter results by. Can be specified multiple times, one query parameter per project key., environmentKey: str(string) # An environment key to filter results by. If specified, exactly one `projectKey` must be provided. Can be specified multiple times, one query parameter per environment key., eventKind: str(string) # An event kind to filter results by. Can be specified multiple times, one query parameter per event kind., groupBy: str(string) # If specified, returns data for each distinct value of the given field. Can be specified multiple times to group data by multiple dimensions, one query parameter per dimension.Valid values: `environmentId`, `eventKind`., aggregationType: str(string) # Specifies the aggregation method. Defaults to `month_to_date`.Valid values: `month_to_date`, `incremental`., granularity: str(string) # Specifies the data granularity. Defaults to `daily`. `monthly` granularity is only supported with the **month_to_date** aggregation type.Valid values: `daily`, `hourly`, `monthly`.}
@returns(200) {_links: map, metadata: [map], series: [map]} # Usage response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 429: Rate limited, 503: Service unavailable}

@endpoint GET /api/v2/usage/evaluations/{projectKey}/{environmentKey}/{featureFlagKey}
@desc Get evaluations usage
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, featureFlagKey: str(string) # The feature flag key}
@optional {from: str(string) # The series of data returned starts from this timestamp. Defaults to 30 days ago., to: str(string) # The series of data returned ends at this timestamp. Defaults to the current time., tz: str(string) # The timezone to use for breaks between days when returning daily data.}
@returns(200) {_links: map, metadata: [map], series: [map]} # Usage response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/usage/events/{type}
@desc Get events usage
@required {type: str(string) # The type of event to retrieve. Must be either `received` or `published`.}
@optional {from: str(string) # The series of data returned starts from this timestamp. Defaults to 24 hours ago., to: str(string) # The series of data returned ends at this timestamp. Defaults to the current time.}
@returns(200) {_links: map, metadata: [map], series: [map]} # Usage response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/usage/experimentation-events
@desc Get experimentation events usage
@optional {from: str(string) # The series of data returned starts from this timestamp (Unix milliseconds). Defaults to the beginning of the current month., to: str(string) # The series of data returned ends at this timestamp (Unix milliseconds). Defaults to the current time., projectKey: str(string) # A project key to filter results by. Can be specified multiple times, one query parameter per project key., environmentKey: str(string) # An environment key to filter results by. If specified, exactly one `projectKey` must be provided. Can be specified multiple times, one query parameter per environment key., eventKey: str(string) # An event key to filter results by. Can be specified multiple times, one query parameter per event key., eventKind: str(string) # An event kind to filter results by. Can be specified multiple times, one query parameter per event kind., groupBy: str(string) # If specified, returns data for each distinct value of the given field. Can be specified multiple times to group data by multiple dimensions, one query parameter per dimension.Valid values: `environmentId`, `eventKey`, `eventKind`., aggregationType: str(string) # Specifies the aggregation method. Defaults to `month_to_date`.Valid values: `month_to_date`, `incremental`., granularity: str(string) # Specifies the data granularity. Defaults to `daily`. `monthly` granularity is only supported with the **month_to_date** aggregation type.Valid values: `daily`, `hourly`, `monthly`.}
@returns(200) {_links: map, metadata: [map], series: [map]} # Usage response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 429: Rate limited, 503: Service unavailable}

@endpoint GET /api/v2/usage/experimentation-keys
@desc Get experimentation keys usage
@optional {from: str(string) # The series of data returned starts from this timestamp (Unix milliseconds). Defaults to the beginning of the current month., to: str(string) # The series of data returned ends at this timestamp (Unix milliseconds). Defaults to the current time., projectKey: str(string) # A project key to filter results by. Can be specified multiple times, one query parameter per project key., environmentKey: str(string) # An environment key to filter results by. If specified, exactly one `projectKey` must be provided. Can be specified multiple times, one query parameter per environment key., experimentId: str(string) # An experiment ID to filter results by. Can be specified multiple times, one query parameter per experiment ID., groupBy: str(string) # If specified, returns data for each distinct value of the given field. Can be specified multiple times to group data by multiple dimensions, one query parameter per dimension.Valid values: `projectId`, `environmentId`, `experimentId`., aggregationType: str(string) # Specifies the aggregation method. Defaults to `month_to_date`.Valid values: `month_to_date`, `incremental`., granularity: str(string) # Specifies the data granularity. Defaults to `daily`. `monthly` granularity is only supported with the **month_to_date** aggregation type.Valid values: `daily`, `hourly`, `monthly`.}
@returns(200) {_links: map, metadata: [map], series: [map]} # Usage response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 429: Rate limited, 503: Service unavailable}

@endpoint GET /api/v2/usage/mau
@desc Get MAU usage
@optional {from: str(string) # The series of data returned starts from this timestamp. Defaults to 30 days ago., to: str(string) # The series of data returned ends at this timestamp. Defaults to the current time., project: str(string) # A project key to filter results to. Can be specified multiple times, one query parameter per project key, to view data for multiple projects., environment: str(string) # 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., sdktype: str(string) # An SDK type to filter results to. Can be specified multiple times, one query parameter per SDK type. Valid values: client, server, sdk: str(string) # An SDK name to filter results to. Can be specified multiple times, one query parameter per SDK., anonymous: str(string) # If specified, filters results to either anonymous or nonanonymous users., groupby: str(string) # 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, contextKind, sdkAppId, aggregationType: str(string) # If specified, queries for rolling 30-day, month-to-date, or daily incremental counts. Default is rolling 30-day. Valid values: rolling_30d, month_to_date, daily_incremental, contextKind: str(string) # Filters results to the specified context kinds. Can be specified multiple times, one query parameter per context kind. If not set, queries for the user context kind.}
@returns(200) {_links: map, metadata: [map], series: [map]} # Usage response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 429: Rate limited}

@endpoint GET /api/v2/usage/mau/bycategory
@desc Get MAU usage by category
@optional {from: str(string) # The series of data returned starts from this timestamp. Defaults to 30 days ago., to: str(string) # The series of data returned ends at this timestamp. Defaults to the current time.}
@returns(200) {_links: map, metadata: [map], series: [map]} # Usage response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/usage/mau/sdks
@desc Get MAU SDKs by type
@optional {from: str(string) # The data returned starts from this timestamp. Defaults to seven days ago. The timestamp is in Unix milliseconds, for example, 1656694800000., to: str(string) # The data returned ends at this timestamp. Defaults to the current time. The timestamp is in Unix milliseconds, for example, 1657904400000., sdktype: str(string) # The type of SDK with monthly active users (MAU) to list. Must be either `client` or `server`.}
@returns(200) {_links: map, sdks: [str]} # MAU SDKs response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 429: Rate limited}

@endpoint GET /api/v2/usage/observability/errors
@desc Get observability errors usage
@optional {from: str(string) # The series of data returned starts from this timestamp (Unix seconds). Defaults to the beginning of the current month., to: str(string) # The series of data returned ends at this timestamp (Unix seconds). Defaults to the current time., projectKey: str(string) # A project key to filter results by. Can be specified multiple times, one query parameter per project key., granularity: str(string) # Specifies the data granularity. Defaults to `daily`. Valid values depend on `aggregationType`: **month_to_date** supports `daily` and `monthly`; **incremental** and **rolling_30d** support `daily` only., aggregationType: str(string) # Specifies the aggregation method. Defaults to `month_to_date`.Valid values: `month_to_date`, `incremental`, `rolling_30d`.}
@returns(200) {_links: map, metadata: [map], series: [map]} # Usage response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/usage/observability/logs
@desc Get observability logs usage
@optional {from: str(string) # The series of data returned starts from this timestamp (Unix seconds). Defaults to the beginning of the current month., to: str(string) # The series of data returned ends at this timestamp (Unix seconds). Defaults to the current time., projectKey: str(string) # A project key to filter results by. Can be specified multiple times, one query parameter per project key., granularity: str(string) # Specifies the data granularity. Defaults to `daily`. Valid values depend on `aggregationType`: **month_to_date** supports `daily` and `monthly`; **incremental** and **rolling_30d** support `daily` only., aggregationType: str(string) # Specifies the aggregation method. Defaults to `month_to_date`.Valid values: `month_to_date`, `incremental`, `rolling_30d`.}
@returns(200) {_links: map, metadata: [map], series: [map]} # Usage response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/usage/observability/metrics
@desc Get observability metrics usage
@optional {from: str(string) # The series of data returned starts from this timestamp (Unix seconds). Defaults to the beginning of the current month., to: str(string) # The series of data returned ends at this timestamp (Unix seconds). Defaults to the current time., projectKey: str(string) # A project key to filter results by. Can be specified multiple times, one query parameter per project key., granularity: str(string) # Specifies the data granularity. Defaults to `daily`. Valid values depend on `aggregationType`: **month_to_date** supports `hourly`, `daily`, and `monthly`; **average** supports `hourly`, `daily`, and `monthly`., aggregationType: str(string) # Specifies the aggregation method. Defaults to `month_to_date`.Valid values: `month_to_date`, `average`.}
@returns(200) {_links: map, metadata: [map], series: [map]} # Usage response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/usage/observability/sessions
@desc Get observability sessions usage
@optional {from: str(string) # The series of data returned starts from this timestamp (Unix seconds). Defaults to the beginning of the current month., to: str(string) # The series of data returned ends at this timestamp (Unix seconds). Defaults to the current time., projectKey: str(string) # A project key to filter results by. Can be specified multiple times, one query parameter per project key., granularity: str(string) # Specifies the data granularity. Defaults to `daily`. Valid values depend on `aggregationType`: **month_to_date** supports `daily` and `monthly`; **incremental** and **rolling_30d** support `daily` only., aggregationType: str(string) # Specifies the aggregation method. Defaults to `month_to_date`.Valid values: `month_to_date`, `incremental`, `rolling_30d`.}
@returns(200) {_links: map, metadata: [map], series: [map]} # Usage response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/usage/observability/traces
@desc Get observability traces usage
@optional {from: str(string) # The series of data returned starts from this timestamp (Unix seconds). Defaults to the beginning of the current month., to: str(string) # The series of data returned ends at this timestamp (Unix seconds). Defaults to the current time., projectKey: str(string) # A project key to filter results by. Can be specified multiple times, one query parameter per project key., granularity: str(string) # Specifies the data granularity. Defaults to `daily`. Valid values depend on `aggregationType`: **month_to_date** supports `daily` and `monthly`; **incremental** and **rolling_30d** support `daily` only., aggregationType: str(string) # Specifies the aggregation method. Defaults to `month_to_date`.Valid values: `month_to_date`, `incremental`, `rolling_30d`.}
@returns(200) {_links: map, metadata: [map], series: [map]} # Usage response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/usage/sdk-versions/details
@desc Get SDK versions usage details
@returns(200) SDK versions usage response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 429: Rate limited, 503: Service unavailable}

@endpoint GET /api/v2/usage/serverside-contexts
@desc Get contexts serverside usage
@optional {from: str(string) # The series of data returned starts from this timestamp (Unix seconds). Defaults to the beginning of the current month., to: str(string) # The series of data returned ends at this timestamp (Unix seconds). Defaults to the current time., projectKey: str(string) # A project key to filter results by. Can be specified multiple times, one query parameter per project key., environmentKey: str(string) # An environment key to filter results by. If specified, exactly one `projectKey` must be provided. Can be specified multiple times, one query parameter per environment key., contextKind: str(string) # A context kind to filter results by. Can be specified multiple times, one query parameter per context kind., sdkName: str(string) # An SDK name to filter results by. Can be specified multiple times, one query parameter per SDK name., anonymous: str(string) # An anonymous value to filter results by. Can be specified multiple times, one query parameter per anonymous value.Valid values: `true`, `false`., groupBy: str(string) # If specified, returns data for each distinct value of the given field. `contextKind` is always included as a grouping dimension. Can be specified multiple times to group data by multiple dimensions, one query parameter per dimension.Valid values: `projectId`, `environmentId`, `sdkName`, `sdkAppId`, `anonymousV2`., aggregationType: str(string) # Specifies the aggregation method. Defaults to `month_to_date`.Valid values: `month_to_date`, `incremental`, `rolling_30d`., granularity: str(string) # Specifies the data granularity. Defaults to `daily`. Valid values depend on `aggregationType`: **month_to_date** supports `daily` and `monthly`; **incremental** and **rolling_30d** support `daily` only.}
@returns(200) {_links: map, metadata: [map], series: [map]} # Usage response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 429: Rate limited, 503: Service unavailable}

@endpoint GET /api/v2/usage/service-connections
@desc Get service connections usage
@optional {from: str(string) # The series of data returned starts from this timestamp (Unix milliseconds). Defaults to the beginning of the current month., to: str(string) # The series of data returned ends at this timestamp (Unix milliseconds). Defaults to the current time., projectKey: str(string) # A project key to filter results by. Can be specified multiple times, one query parameter per project key., environmentKey: str(string) # An environment key to filter results by. If specified, exactly one `projectKey` must be provided. Can be specified multiple times, one query parameter per environment key., connectionType: str(string) # A connection type to filter results by. Can be specified multiple times, one query parameter per connection type., relayVersion: str(string) # A relay version to filter results by. Can be specified multiple times, one query parameter per relay version., sdkName: str(string) # An SDK name to filter results by. Can be specified multiple times, one query parameter per SDK name., sdkVersion: str(string) # An SDK version to filter results by. Can be specified multiple times, one query parameter per SDK version., sdkType: str(string) # An SDK type to filter results by. Can be specified multiple times, one query parameter per SDK type., sdkAppId: str(string) # An SDK app ID to filter results by. Can be specified multiple times, one query parameter per SDK app ID., groupBy: str(string) # If specified, returns data for each distinct value of the given field. Can be specified multiple times to group data by multiple dimensions, one query parameter per dimension.Valid values: `projectId`, `environmentId`, `connectionType`, `relayVersion`, `sdkName`, `sdkVersion`, `sdkType`, `sdkAppId`., aggregationType: str(string) # Specifies the aggregation method. Defaults to `month_to_date`.Valid values: `month_to_date`, `incremental`., granularity: str(string) # Specifies the data granularity. Defaults to `daily`. `monthly` granularity is only supported with the **month_to_date** aggregation type.Valid values: `daily`, `hourly`, `monthly`.}
@returns(200) {_links: map, metadata: [map], series: [map]} # Usage response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 429: Rate limited, 503: Service unavailable}

@endpoint GET /api/v2/usage/streams/{source}
@desc Get stream usage
@required {source: str(string) # The source of streaming connections to describe. Must be either `client` or `server`.}
@optional {from: str(string) # The series of data returned starts from this timestamp. Defaults to 30 days ago., to: str(string) # The series of data returned ends at this timestamp. Defaults to the current time., tz: str(string) # The timezone to use for breaks between days when returning daily data.}
@returns(200) {_links: map, metadata: [map], series: [map]} # Usage response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/usage/streams/{source}/bysdkversion
@desc Get stream usage by SDK version
@required {source: str(string) # The source of streaming connections to describe. Must be either `client` or `server`.}
@optional {from: str(string) # The series of data returned starts from this timestamp. Defaults to 24 hours ago., to: str(string) # The series of data returned ends at this timestamp. Defaults to the current time., tz: str(string) # The timezone to use for breaks between days when returning daily data., sdk: str(string) # If included, this filters the returned series to only those that match this SDK name., version: str(string) # If included, this filters the returned series to only those that match this SDK version.}
@returns(200) {_links: map, metadata: [map], series: [map]} # Usage response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/usage/streams/{source}/sdkversions
@desc Get stream usage SDK versions
@required {source: str(string) # The source of streaming connections to describe. Must be either `client` or `server`.}
@returns(200) {_links: map, sdkVersions: [map]} # SDK Versions response
@errors {401: Invalid access token, 403: Forbidden, 429: Rate limited}

@endpoint GET /api/v2/usage/total-contexts
@desc Get contexts total usage
@optional {from: str(string) # The series of data returned starts from this timestamp (Unix milliseconds). Defaults to the beginning of the current month., to: str(string) # The series of data returned ends at this timestamp (Unix milliseconds). Defaults to the current time., projectKey: str(string) # A project key to filter results by. Can be specified multiple times, one query parameter per project key., environmentKey: str(string) # An environment key to filter results by. If specified, exactly one `projectKey` must be provided. Can be specified multiple times, one query parameter per environment key., contextKind: str(string) # A context kind to filter results by. Can be specified multiple times, one query parameter per context kind., sdkName: str(string) # An SDK name to filter results by. Can be specified multiple times, one query parameter per SDK name., sdkType: str(string) # An SDK type to filter results by. Can be specified multiple times, one query parameter per SDK type., anonymous: str(string) # An anonymous value to filter results by. Can be specified multiple times, one query parameter per anonymous value.Valid values: `true`, `false`., groupBy: str(string) # If specified, returns data for each distinct value of the given field. `contextKind` is always included as a grouping dimension. Can be specified multiple times to group data by multiple dimensions, one query parameter per dimension.Valid values: `projectId`, `environmentId`, `sdkName`, `sdkType`, `sdkAppId`, `anonymousV2`., aggregationType: str(string) # Specifies the aggregation method. Defaults to `month_to_date`.Valid values: `month_to_date`, `incremental`, `rolling_30d`., granularity: str(string) # Specifies the data granularity. Defaults to `daily`. Valid values depend on `aggregationType`: **month_to_date** supports `daily` and `monthly`; **incremental** and **rolling_30d** support `daily` only.}
@returns(200) {_links: map, metadata: [map], series: [map]} # Usage response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 429: Rate limited, 503: Service unavailable}

@endpoint GET /api/v2/usage/total-mau
@desc Get MAU total usage
@optional {from: str(string) # The series of data returned starts from this timestamp (Unix milliseconds). Defaults to the beginning of the current month., to: str(string) # The series of data returned ends at this timestamp (Unix milliseconds). Defaults to the current time., projectKey: str(string) # A project key to filter results by. Can be specified multiple times, one query parameter per project key., environmentKey: str(string) # An environment key to filter results by. If specified, exactly one `projectKey` must be provided. Can be specified multiple times, one query parameter per environment key., sdkName: str(string) # An SDK name to filter results by. Can be specified multiple times, one query parameter per SDK name., sdkType: str(string) # An SDK type to filter results by. Can be specified multiple times, one query parameter per SDK type., anonymous: str(string) # An anonymous value to filter results by. Can be specified multiple times, one query parameter per anonymous value.Valid values: `true`, `false`., groupBy: str(string) # If specified, returns data for each distinct value of the given field. Can be specified multiple times to group data by multiple dimensions, one query parameter per dimension.Valid values: `projectId`, `environmentId`, `sdkName`, `sdkType`, `sdkAppId`, `anonymousV2`., aggregationType: str(string) # Specifies the aggregation method. Defaults to `month_to_date`.Valid values: `month_to_date`, `incremental`, `rolling_30d`., granularity: str(string) # Specifies the data granularity. Defaults to `daily`. Valid values depend on `aggregationType`: **month_to_date** supports `daily` and `monthly`; **incremental** and **rolling_30d** support `daily` only.}
@returns(200) {_links: map, metadata: [map], series: [map]} # Usage response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 429: Rate limited, 503: Service unavailable}

@endpoint GET /api/v2/usage/vega-ai
@desc Get Vega AI usage
@optional {from: str(string) # The series of data returned starts from this timestamp (Unix seconds). Defaults to the beginning of the current month., to: str(string) # The series of data returned ends at this timestamp (Unix seconds). Defaults to the current time., projectKey: str(string) # A project key to filter results by. Can be specified multiple times, one query parameter per project key., granularity: str(string) # Specifies the data granularity. Defaults to `daily`. Valid values depend on `aggregationType`: **month_to_date** supports `daily` and `monthly`; **incremental** and **rolling_30d** support `daily` only., aggregationType: str(string) # Specifies the aggregation method. Defaults to `month_to_date`.Valid values: `month_to_date`, `incremental`, `rolling_30d`.}
@returns(200) {_links: map, metadata: [map], series: [map]} # Usage response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/user-attributes/{projectKey}/{environmentKey}
@desc Get user attribute names
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key}
@returns(200) {private: [str], custom: [str], standard: [str]} # User attribute names response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier}

@endpoint GET /api/v2/user-search/{projectKey}/{environmentKey}
@desc Find users
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key}
@optional {q: str(string) # Full-text search for users based on name, first name, last name, e-mail address, or key, limit: int(int64) # Specifies the maximum number of items in the collection to return (max: 50, default: 20), offset: int(int64) # Deprecated, use `searchAfter` instead. Specifies the first item to return in the collection., after: int(int64) # A Unix epoch time in milliseconds specifying the maximum last time a user requested a feature flag from LaunchDarkly, sort: str(string) # Specifies a field by which to sort. LaunchDarkly supports the `userKey` and `lastSeen` fields. Fields prefixed by a dash ( - ) sort in descending order., searchAfter: str(string) # 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., filter: str(string) # A comma-separated list of user attribute filters. Each filter is in the form of attributeKey:attributeValue}
@returns(200) {_links: map, totalCount: int, items: [map]} # Users collection response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/users/{projectKey}/{environmentKey}
@desc List users
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key}
@optional {limit: int(int64) # The number of elements to return per page, searchAfter: str(string) # 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.}
@returns(200) {_links: map, totalCount: int, items: [map]} # Users collection response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/users/{projectKey}/{environmentKey}/{userKey}
@desc Get user
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, userKey: str(string) # The user key}
@returns(200) {lastPing: str(date-time), environmentId: str, ownerId: str, user: map{key: str, secondary: str, ip: str, country: str, email: str, firstName: str, lastName: str, avatar: str, name: str, anonymous: bool, custom: map, privateAttrs: [str]}, sortValue: any, _links: map, _access: map{denied: [map], allowed: [map]}} # User response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint DELETE /api/v2/users/{projectKey}/{environmentKey}/{userKey}
@desc Delete user
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, userKey: str(string) # The user key}
@returns(204) Action succeeded
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 409: Status conflict, 429: Rate limited}

@endpoint GET /api/v2/users/{projectKey}/{environmentKey}/{userKey}/flags
@desc List flag settings for user
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, userKey: str(string) # The user key}
@returns(200) {items: map, _links: map} # User flag settings collection response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/users/{projectKey}/{environmentKey}/{userKey}/flags/{featureFlagKey}
@desc Get flag setting for user
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, userKey: str(string) # The user key, featureFlagKey: str(string) # The feature flag key}
@returns(200) {_links: map, _value: any, setting: any, reason: map{kind: str, ruleIndex: int, ruleID: str, prerequisiteKey: str, inExperiment: bool, errorKind: str}} # User flag settings response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint PUT /api/v2/users/{projectKey}/{environmentKey}/{userKey}/flags/{featureFlagKey}
@desc Update flag settings for user
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, userKey: str(string) # The user key, featureFlagKey: str(string) # The feature flag key}
@optional {setting: any # The variation value to set for the context. Must match the flag's variation type., comment: str # Optional comment describing the change}
@returns(204) Action succeeded
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/users/{projectKey}/{userKey}/expiring-user-targets/{environmentKey}
@desc Get expiring dates on flags for user
@required {projectKey: str(string) # The project key, userKey: str(string) # The user key, environmentKey: str(string) # The environment key}
@returns(200) {items: [map], _links: map} # Expiring user target response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint PATCH /api/v2/users/{projectKey}/{userKey}/expiring-user-targets/{environmentKey}
@desc Update expiring user target for flags
@required {projectKey: str(string) # The project key, userKey: str(string) # The user key, environmentKey: str(string) # The environment key, instructions: [map{kind!: str, flagKey!: str, variationId!: str, value: int, version: int}] # The instructions to perform when updating}
@optional {comment: str # Optional comment describing the change}
@returns(200) {items: [map], _links: map, totalInstructions: int, successfulInstructions: int, failedInstructions: int, errors: [map]} # Expiring user target response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/versions
@desc Get version information
@returns(200) {validVersions: [int], latestVersion: int, currentVersion: int, beta: bool} # Versions information response
@errors {401: Invalid access token, 403: Forbidden, 429: Rate limited}

@endpoint GET /api/v2/webhooks
@desc List webhooks
@returns(200) {_links: map, items: [map]} # Webhooks response
@errors {401: Invalid access token, 403: Forbidden, 429: Rate limited}

@endpoint POST /api/v2/webhooks
@desc Creates a webhook
@required {url: str # The URL of the remote webhook, sign: bool # If sign is false, the webhook does not include a signature header, and the secret can be omitted., on: bool # Whether or not this webhook is enabled.}
@optional {name: str # A human-readable name for your webhook, secret: str # If sign is true, and the secret attribute is omitted, LaunchDarkly automatically generates a secret for you., statements: [map{resources: [str], notResources: [str], actions: [str], notActions: [str], effect!: str}], tags: [str] # List of tags for this webhook}
@returns(200) {_links: map, _id: str, name: str, url: str, secret: str, statements: [map], on: bool, tags: [str], _access: map{denied: [map], allowed: [map]}} # Webhook response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 429: Rate limited}
@example_request {"name":"apidocs test webhook","on":true,"sign":false,"statements":[{"actions":["*"],"effect":"allow","resources":["proj/test"]}],"tags":["example-tag"],"url":"https://example.com"}

@endpoint GET /api/v2/webhooks/{id}
@desc Get webhook
@required {id: str(string) # The ID of the webhook}
@returns(200) {_links: map, _id: str, name: str, url: str, secret: str, statements: [map], on: bool, tags: [str], _access: map{denied: [map], allowed: [map]}} # Webhook response
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint PATCH /api/v2/webhooks/{id}
@desc Update webhook
@required {id: str(string) # The ID of the webhook to update}
@returns(200) {_links: map, _id: str, name: str, url: str, secret: str, statements: [map], on: bool, tags: [str], _access: map{denied: [map], allowed: [map]}} # Webhook response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}
@example_request [{"op":"replace","path":"/on","value":false}]

@endpoint DELETE /api/v2/webhooks/{id}
@desc Delete webhook
@required {id: str(string) # The ID of the webhook to delete}
@returns(204) Action succeeded
@errors {401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/tags
@desc List tags
@optional {kind: [str] # Fetch tags associated with the specified resource type. Options are `flag`, `project`, `environment`, `segment`, `metric`, `metric-data-source`, `aiconfig`, and `view`. Returns all types by default., pre: str # Return tags with the specified prefix, archived: bool # Whether or not to return archived flags, limit: int # The number of tags to return. Maximum is 1000., offset: int # The index of the first tag to return. Default is 0., asOf: str # The time to retrieve tags as of. Default is the current time.}
@returns(200) {items: [str], _links: map, totalCount: int} # Tag collection response
@errors {400: Bad request, 401: Invalid access token, 403: Forbidden, 429: Rate Limited, 500: Internal server error}

@endpoint GET /api/v2/projects/{projectKey}/ai-configs/{configKey}/targeting
@desc Show an AI Config's targeting
@required {projectKey: str, configKey: str}
@returns(200) {createdAt: int(int64), defaults: any, environments: map, experiments: map{baselineIdx: int, items: [map]}, key: str, name: str, tags: [str], variations: [map], _version: int} # Successful response
@errors {403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint PATCH /api/v2/projects/{projectKey}/ai-configs/{configKey}/targeting
@desc Update AI Config targeting
@required {projectKey: str, configKey: str, environmentKey: str, instructions: [map]}
@optional {comment: str}
@returns(200) {createdAt: int(int64), defaults: any, environments: map, experiments: map{baselineIdx: int, items: [map]}, key: str, name: str, tags: [str], variations: [map], _version: int} # AI Config targeting updated
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint GET /api/v2/projects/{projectKey}/ai-configs
@desc List AI Configs
@required {projectKey: str}
@optional {sort: str # A sort to apply to the list of AI Configs., limit: int # The number of resources to return., offset: int # 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`., filter: str # A filter to apply to the list.}
@returns(200) {_links: map{first: map{href: str, type: str}, last: map{href: str, type: str}, next: map{href: str, type: str}, prev: map{href: str, type: str}, self: map{href: str, type: str}}, items: [map], totalCount: int} # Successful response
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint POST /api/v2/projects/{projectKey}/ai-configs
@desc Create new AI Config
@required {projectKey: str, key: str, name: str}
@optional {description: str=, maintainerId: str, maintainerTeamKey: str, mode: str(agent/completion/judge)=completion, tags: [str], defaultVariation: map{comment: str, description: str, instructions: str, key!: str, messages: [map], model: map, name!: str, modelConfigKey: str, tools: [map], toolKeys: [str], judgeConfiguration: map}, evaluationMetricKey: str # Evaluation metric key for this AI Config, isInverted: bool # Whether the evaluation metric is inverted, meaning a lower value is better if set as true}
@returns(201) {_access: map{denied: [map], allowed: [map]}, _links: map{self: map{href: str, type: str}, parent: map{href: str, type: str}}, description: str, key: str, _maintainer: any, mode: str, name: str, tags: [str], version: int, variations: [map], createdAt: int(int64), updatedAt: int(int64), evaluationMetricKey: str, evaluationMetricKeys: [str], isInverted: bool, dependencies: [map]} # AI Config created
@errors {400: Bad request, 403: Forbidden, 429: Rate Limited, 500: Internal server error}

@endpoint DELETE /api/v2/projects/{projectKey}/ai-configs/{configKey}
@desc Delete AI Config
@required {projectKey: str, configKey: str}
@returns(204) No content
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint GET /api/v2/projects/{projectKey}/ai-configs/{configKey}
@desc Get AI Config
@required {projectKey: str, configKey: str}
@returns(200) {_access: map{denied: [map], allowed: [map]}, _links: map{self: map{href: str, type: str}, parent: map{href: str, type: str}}, description: str, key: str, _maintainer: any, mode: str, name: str, tags: [str], version: int, variations: [map], createdAt: int(int64), updatedAt: int(int64), evaluationMetricKey: str, evaluationMetricKeys: [str], isInverted: bool, dependencies: [map]} # AI Config found
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint PATCH /api/v2/projects/{projectKey}/ai-configs/{configKey}
@desc Update AI Config
@required {projectKey: str, configKey: str}
@optional {description: str, maintainerId: str, maintainerTeamKey: str, name: str, tags: [str], evaluationMetricKey: str # Evaluation metric key for this AI Config, isInverted: bool # Whether the evaluation metric is inverted, meaning a lower value is better if set as true}
@returns(200) {_access: map{denied: [map], allowed: [map]}, _links: map{self: map{href: str, type: str}, parent: map{href: str, type: str}}, description: str, key: str, _maintainer: any, mode: str, name: str, tags: [str], version: int, variations: [map], createdAt: int(int64), updatedAt: int(int64), evaluationMetricKey: str, evaluationMetricKeys: [str], isInverted: bool, dependencies: [map]} # AI Config updated
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint POST /api/v2/projects/{projectKey}/ai-configs/{configKey}/variations
@desc Create AI Config variation
@required {projectKey: str, configKey: str, key: str, name: str}
@optional {comment: str # Human-readable description of this variation, description: str # Returns the description for the agent. This is only returned for agent variations., instructions: str # Returns the instructions for the agent. This is only returned for agent variations., messages: [map{content!: str, role!: str}], model: map, modelConfigKey: str, tools: [map{key!: str, version!: int}] # List of tools to use for this variation. The latest version of the tool will be used., toolKeys: [str] # List of tool keys to use for this variation. The latest version of the tool will be used., judgeConfiguration: map{judges: [map]}}
@returns(201) {_links: map{parent: map{href: str, type: str}}, color: str, comment: str, description: str, instructions: str, key: str, _id: str, messages: [map], model: map, modelConfigKey: str, name: str, createdAt: int(int64), version: int, state: str, _archivedAt: int(int64), _publishedAt: int(int64), tools: [map], judgeConfiguration: map{judges: [map]}, judgingConfigKeys: [str]} # AI Config variation created
@errors {400: Bad request, 403: Forbidden, 429: Rate Limited, 500: Internal server error}

@endpoint DELETE /api/v2/projects/{projectKey}/ai-configs/{configKey}/variations/{variationKey}
@desc Delete AI Config variation
@required {projectKey: str, configKey: str, variationKey: str}
@returns(204) No content
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint GET /api/v2/projects/{projectKey}/ai-configs/{configKey}/variations/{variationKey}
@desc Get AI Config variation
@required {projectKey: str, configKey: str, variationKey: str}
@returns(200) {items: [map], totalCount: int} # Successful response
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint PATCH /api/v2/projects/{projectKey}/ai-configs/{configKey}/variations/{variationKey}
@desc Update AI Config variation
@required {projectKey: str, configKey: str, variationKey: str}
@optional {comment: str # Human-readable description of what this patch changes, description: str # Description for agent when AI Config is in agent mode., instructions: str # Instructions for agent when AI Config is in agent mode., messages: [map{content!: str, role!: str}], model: map, modelConfigKey: str, name: str, published: bool, state: str # One of 'archived', 'published', tools: [map{key!: str, version!: int}] # List of tools to use for this variation. The latest version of the tool will be used., toolKeys: [str] # List of tool keys to use for this variation. The latest version of the tool will be used., judgeConfiguration: map{judges: [map]}}
@returns(200) {_links: map{parent: map{href: str, type: str}}, color: str, comment: str, description: str, instructions: str, key: str, _id: str, messages: [map], model: map, modelConfigKey: str, name: str, createdAt: int(int64), version: int, state: str, _archivedAt: int(int64), _publishedAt: int(int64), tools: [map], judgeConfiguration: map{judges: [map]}, judgingConfigKeys: [str]} # AI Config variation updated
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint GET /api/v2/projects/{projectKey}/ai-configs/quick-stats
@desc Get AI Config quick stats
@required {projectKey: str, env: str # An environment key. Only metrics from this environment will be included.}
@returns(200) {activeConfigs: int, activeExperiments: int, averageSatisfaction7D: num(float)?, spendMonthToDate: num(double)?} # Quick stats computed
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint GET /api/v2/projects/{projectKey}/ai-configs/{configKey}/metrics
@desc Get AI Config metrics
@required {projectKey: str, configKey: str, from: int # The starting time, as milliseconds since epoch (inclusive)., to: int # The ending time, as milliseconds since epoch (exclusive). May not be more than 100 days after `from`., env: str # An environment key. Only metrics from this environment will be included.}
@returns(200) {inputTokens: int, outputTokens: int, totalTokens: int, generationCount: int, generationSuccessCount: int, generationErrorCount: int, thumbsUp: int, thumbsDown: int, durationMs: int, timeToFirstTokenMs: int, satisfactionRating: num(float), inputCost: num(double), outputCost: num(double), judgeAccuracy: num(float), judgeRelevance: num(float), judgeToxicity: num(float)} # Metrics computed
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint GET /api/v2/projects/{projectKey}/ai-configs/{configKey}/metrics-by-variation
@desc Get AI Config metrics by variation
@required {projectKey: str, configKey: str, from: int # The starting time, as milliseconds since epoch (inclusive)., to: int # The ending time, as milliseconds since epoch (exclusive). May not be more than 100 days after `from`., env: str # An environment key. Only metrics from this environment will be included.}
@returns(200) Metrics computed
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint DELETE /api/v2/projects/{projectKey}/ai-configs/model-configs/restricted
@desc Remove AI models from the restricted list
@required {projectKey: str, keys: [str]}
@returns(204) No content
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint POST /api/v2/projects/{projectKey}/ai-configs/model-configs/restricted
@desc Add AI models to the restricted list
@required {projectKey: str, keys: [str]}
@returns(200) {successes: [str], errors: [map]} # Successful response
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint GET /api/v2/projects/{projectKey}/ai-configs/model-configs
@desc List AI model configs
@required {projectKey: str}
@optional {restricted: bool # Whether to return only restricted models}
@returns(200) Successful response
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint POST /api/v2/projects/{projectKey}/ai-configs/model-configs
@desc Create an AI model config
@required {projectKey: str, name: str # Human readable name of the model, key: str # Unique key for the model, id: str # Identifier for the model, for use with third party providers}
@optional {icon: str # Icon for the model, provider: str # Provider for the model, params: map, customParams: map, tags: [str], costPerInputToken: num(double) # Cost per input token in USD, costPerOutputToken: num(double) # Cost per output token in USD}
@returns(200) {_access: map{denied: [map], allowed: [map]}, name: str, key: str, id: str, icon: str, provider: str, global: bool, params: map, customParams: map, tags: [str], version: int, costPerInputToken: num(double), costPerOutputToken: num(double), isRestricted: bool} # Successful response
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint DELETE /api/v2/projects/{projectKey}/ai-configs/model-configs/{modelConfigKey}
@desc Delete an AI model config
@required {projectKey: str, modelConfigKey: str}
@returns(204) No content
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint GET /api/v2/projects/{projectKey}/ai-configs/model-configs/{modelConfigKey}
@desc Get AI model config
@required {projectKey: str, modelConfigKey: str}
@returns(200) {_access: map{denied: [map], allowed: [map]}, name: str, key: str, id: str, icon: str, provider: str, global: bool, params: map, customParams: map, tags: [str], version: int, costPerInputToken: num(double), costPerOutputToken: num(double), isRestricted: bool} # Successful response
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint GET /api/v2/projects/{projectKey}/ai-tools
@desc List AI tools
@required {projectKey: str}
@optional {sort: str # A sort to apply to the list of AI Configs., limit: int # The number of resources to return., offset: int # 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`., filter: str # A filter to apply to the list.}
@returns(200) {_links: map{first: map{href: str, type: str}, last: map{href: str, type: str}, next: map{href: str, type: str}, prev: map{href: str, type: str}, self: map{href: str, type: str}}, items: [map], totalCount: int} # Successful response
@errors {400: Bad request, 403: Forbidden, 500: Internal server error}

@endpoint POST /api/v2/projects/{projectKey}/ai-tools
@desc Create an AI tool
@required {projectKey: str, key: str, schema: map # JSON Schema defining the tool's parameters for LLM consumption}
@optional {maintainerId: str, maintainerTeamKey: str, description: str, customParameters: map # Custom metadata and configuration for application-level use (not sent to LLM)}
@returns(201) {key: str, _access: map{denied: [map], allowed: [map]}, _links: map{self: map{href: str, type: str}, parent: map{href: str, type: str}}, _maintainer: any, description: str, schema: map, customParameters: map, version: int, createdAt: int(int64)} # AI tool created
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint GET /api/v2/projects/{projectKey}/ai-tools/{toolKey}/versions
@desc List AI tool versions
@required {projectKey: str, toolKey: str}
@optional {sort: str # A sort to apply to the list of AI Configs., limit: int # The number of resources to return., offset: int # 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`.}
@returns(200) {_links: map{first: map{href: str, type: str}, last: map{href: str, type: str}, next: map{href: str, type: str}, prev: map{href: str, type: str}, self: map{href: str, type: str}}, items: [map], totalCount: int} # Successful response
@errors {400: Bad request, 403: Forbidden, 500: Internal server error}

@endpoint DELETE /api/v2/projects/{projectKey}/ai-tools/{toolKey}
@desc Delete AI tool
@required {projectKey: str, toolKey: str}
@returns(204) No content
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint GET /api/v2/projects/{projectKey}/ai-tools/{toolKey}
@desc Get AI tool
@required {projectKey: str, toolKey: str}
@returns(200) {key: str, _access: map{denied: [map], allowed: [map]}, _links: map{self: map{href: str, type: str}, parent: map{href: str, type: str}}, _maintainer: any, description: str, schema: map, customParameters: map, version: int, createdAt: int(int64)} # AI tool found
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint PATCH /api/v2/projects/{projectKey}/ai-tools/{toolKey}
@desc Update AI tool
@required {projectKey: str, toolKey: str}
@optional {maintainerId: str, maintainerTeamKey: str, description: str, schema: map # JSON Schema defining the tool's parameters for LLM consumption, customParameters: map # Custom metadata and configuration for application-level use (not sent to LLM)}
@returns(200) {key: str, _access: map{denied: [map], allowed: [map]}, _links: map{self: map{href: str, type: str}, parent: map{href: str, type: str}}, _maintainer: any, description: str, schema: map, customParameters: map, version: int, createdAt: int(int64)} # AI tool updated
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint GET /api/v2/projects/{projectKey}/ai-configs/prompt-snippets
@desc List prompt snippets
@required {projectKey: str}
@optional {limit: int # The number of resources to return., offset: int # 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`.}
@returns(200) {_links: map{first: map{href: str, type: str}, last: map{href: str, type: str}, next: map{href: str, type: str}, prev: map{href: str, type: str}, self: map{href: str, type: str}}, items: [map], totalCount: int} # Prompt snippets list
@errors {403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint POST /api/v2/projects/{projectKey}/ai-configs/prompt-snippets
@desc Create a prompt snippet
@required {projectKey: str, key: str, name: str, text: str # The text content of the prompt snippet}
@optional {description: str}
@returns(201) {key: str, _access: map{denied: [map], allowed: [map]}, _links: map{self: map{href: str, type: str}, parent: map{href: str, type: str}}, name: str, description: str, text: str, version: int, createdAt: int(int64)} # Prompt snippet created
@errors {400: Bad request, 403: Forbidden, 404: Not found, 409: Conflict, 500: Internal server error}

@endpoint DELETE /api/v2/projects/{projectKey}/ai-configs/prompt-snippets/{snippetKey}
@desc Delete a prompt snippet
@required {projectKey: str, snippetKey: str}
@returns(204) No content
@errors {403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint GET /api/v2/projects/{projectKey}/ai-configs/prompt-snippets/{snippetKey}
@desc Get a prompt snippet
@required {projectKey: str, snippetKey: str}
@returns(200) {key: str, _access: map{denied: [map], allowed: [map]}, _links: map{self: map{href: str, type: str}, parent: map{href: str, type: str}}, name: str, description: str, text: str, version: int, createdAt: int(int64)} # Prompt snippet found
@errors {403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint PATCH /api/v2/projects/{projectKey}/ai-configs/prompt-snippets/{snippetKey}
@desc Update a prompt snippet
@required {projectKey: str, snippetKey: str}
@optional {name: str, description: str, text: str # The text content of the prompt snippet}
@returns(200) {key: str, _access: map{denied: [map], allowed: [map]}, _links: map{self: map{href: str, type: str}, parent: map{href: str, type: str}}, name: str, description: str, text: str, version: int, createdAt: int(int64)} # Prompt snippet updated
@errors {400: Bad request, 403: Forbidden, 404: Not found, 409: Conflict, 500: Internal server error}

@endpoint GET /api/v2/projects/{projectKey}/ai-configs/prompt-snippets/{snippetKey}/references
@desc List prompt snippet references
@required {projectKey: str, snippetKey: str}
@optional {limit: int # The number of resources to return., offset: int # 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`.}
@returns(200) {_links: map{first: map{href: str, type: str}, last: map{href: str, type: str}, next: map{href: str, type: str}, prev: map{href: str, type: str}, self: map{href: str, type: str}}, resourceKey: str, resourceType: str, items: [map], totalCount: int} # Prompt snippet references
@errors {403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint GET /api/v2/projects/{projectKey}/agent-graphs
@desc List agent graphs
@required {LD-API-Version: str # Version of the endpoint., projectKey: str}
@optional {limit: int # The number of resources to return., offset: int # 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`.}
@returns(200) {_links: map{first: map{href: str, type: str}, last: map{href: str, type: str}, next: map{href: str, type: str}, prev: map{href: str, type: str}, self: map{href: str, type: str}}, items: [map], totalCount: int} # Successful response
@errors {400: Bad request, 403: Forbidden, 500: Internal server error}

@endpoint POST /api/v2/projects/{projectKey}/agent-graphs
@desc Create new agent graph
@required {LD-API-Version: str # Version of the endpoint., projectKey: str, key: str # A unique key for the agent graph, name: str # A human-readable name for the agent graph}
@optional {description: str # A description of the agent graph, maintainerId: str # The ID of the member who maintains this agent graph, maintainerTeamKey: str # The key of the team that maintains this agent graph, rootConfigKey: str # The AI Config key of the root node. A missing root implies a newly created graph with metadata only., edges: [map{key!: str, sourceConfig!: str, targetConfig!: str, handoff: map}] # The edges in the graph. If edges or rootConfigKey is present, both must be present.}
@returns(201) {_access: map{denied: [map], allowed: [map]}, key: str, name: str, description: str, _maintainer: map{kind: str}, rootConfigKey: str, edges: [map], createdAt: int(int64), updatedAt: int(int64)} # Agent graph created
@errors {400: Bad request, 403: Forbidden, 413: Payload too large, 500: Internal server error}

@endpoint DELETE /api/v2/projects/{projectKey}/agent-graphs/{graphKey}
@desc Delete agent graph
@required {LD-API-Version: str # Version of the endpoint., projectKey: str, graphKey: str}
@returns(204) No content
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint GET /api/v2/projects/{projectKey}/agent-graphs/{graphKey}
@desc Get agent graph
@required {LD-API-Version: str # Version of the endpoint., projectKey: str, graphKey: str}
@returns(200) {_access: map{denied: [map], allowed: [map]}, key: str, name: str, description: str, _maintainer: map{kind: str}, rootConfigKey: str, edges: [map], createdAt: int(int64), updatedAt: int(int64)} # Agent graph found
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint PATCH /api/v2/projects/{projectKey}/agent-graphs/{graphKey}
@desc Update agent graph
@required {LD-API-Version: str # Version of the endpoint., projectKey: str, graphKey: str}
@optional {name: str # A human-readable name for the agent graph, description: str # A description of the agent graph, maintainerId: str # The ID of the member who maintains this agent graph. Pass an empty string to remove maintainer., maintainerTeamKey: str # The key of the team that maintains this agent graph. Pass an empty string to remove maintainer., rootConfigKey: str # The AI Config key of the root node. If present, edges must also be present., edges: [map{key!: str, sourceConfig!: str, targetConfig!: str, handoff: map}] # The edges in the graph. If present, rootConfigKey must also be present. Replaces all existing edges.}
@returns(200) {_access: map{denied: [map], allowed: [map]}, key: str, name: str, description: str, _maintainer: map{kind: str}, rootConfigKey: str, edges: [map], createdAt: int(int64), updatedAt: int(int64)} # Agent graph updated
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint GET /api/v2/projects/{projectKey}/agent-optimizations
@desc List agent optimizations
@required {projectKey: str}
@optional {limit: int # The number of resources to return., offset: int # 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`.}
@returns(200) {_links: map{first: map{href: str, type: str}, last: map{href: str, type: str}, next: map{href: str, type: str}, prev: map{href: str, type: str}, self: map{href: str, type: str}}, items: [map], totalCount: int} # Agent optimizations list
@errors {403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint POST /api/v2/projects/{projectKey}/agent-optimizations
@desc Create agent optimization
@required {projectKey: str, key: str, aiConfigKey: str, maxAttempts: int, judgeModel: str}
@optional {modelChoices: [str], variableChoices: [map], acceptanceStatements: [map{statement!: str, threshold!: num(double)}], judges: [map{key!: str, threshold!: num(double)}], userInputOptions: [str], groundTruthResponses: [str], metricKey: str}
@returns(201) {_access: map{denied: [map], allowed: [map]}, _links: map{self: map{href: str, type: str}, parent: map{href: str, type: str}}, id: str, key: str, aiConfigKey: str, maxAttempts: int, modelChoices: [str], judgeModel: str, variableChoices: [map], acceptanceStatements: [map], judges: [map], userInputOptions: [str], groundTruthResponses: [str], metricKey: str, version: int, createdAt: int(int64)} # Agent optimization created
@errors {400: Bad request, 403: Forbidden, 409: Conflict, 500: Internal server error}

@endpoint DELETE /api/v2/projects/{projectKey}/agent-optimizations/{optimizationKey}
@desc Delete an agent optimization
@required {projectKey: str, optimizationKey: str}
@returns(204) No content
@errors {403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint GET /api/v2/projects/{projectKey}/agent-optimizations/{optimizationKey}
@desc Get an agent optimization
@required {projectKey: str, optimizationKey: str}
@returns(200) {_access: map{denied: [map], allowed: [map]}, _links: map{self: map{href: str, type: str}, parent: map{href: str, type: str}}, id: str, key: str, aiConfigKey: str, maxAttempts: int, modelChoices: [str], judgeModel: str, variableChoices: [map], acceptanceStatements: [map], judges: [map], userInputOptions: [str], groundTruthResponses: [str], metricKey: str, version: int, createdAt: int(int64)} # Agent optimization found
@errors {403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint PATCH /api/v2/projects/{projectKey}/agent-optimizations/{optimizationKey}
@desc Update an agent optimization
@required {projectKey: str, optimizationKey: str}
@optional {maxAttempts: int, modelChoices: [str], judgeModel: str, variableChoices: [map], acceptanceStatements: [map{statement!: str, threshold!: num(double)}], judges: [map{key!: str, threshold!: num(double)}], userInputOptions: [str], groundTruthResponses: [str], metricKey: str}
@returns(200) {_access: map{denied: [map], allowed: [map]}, _links: map{self: map{href: str, type: str}, parent: map{href: str, type: str}}, id: str, key: str, aiConfigKey: str, maxAttempts: int, modelChoices: [str], judgeModel: str, variableChoices: [map], acceptanceStatements: [map], judges: [map], userInputOptions: [str], groundTruthResponses: [str], metricKey: str, version: int, createdAt: int(int64)} # Agent optimization updated
@errors {400: Bad request, 403: Forbidden, 404: Not found, 409: Conflict, 500: Internal server error}

@endpoint GET /api/v2/announcements
@desc Get announcements
@optional {status: str(active/inactive/scheduled) # Filter announcements by status., limit: int # The number of announcements to return., offset: int # 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`.}
@returns(200) {items: [map], _links: map{first: map{href: str, type: str}, last: map{href: str, type: str}, next: map{href: str, type: str}, prev: map{href: str, type: str}, self: map{href: str, type: str}}} # Announcement response
@errors {400: Bad request, 403: Forbidden, 404: Not found, 429: Rate limit exceeded, 500: Internal server error}

@endpoint POST /api/v2/announcements
@desc Create an announcement
@required {isDismissible: bool # true if the announcement is dismissible, title: str # The title of the announcement, message: str # The message of the announcement, startTime: int(int64) # The start time of the announcement. This is a Unix timestamp in milliseconds., severity: str(info/warning/critical) # The severity of the announcement}
@optional {endTime: int(int64) # The end time of the announcement. This is a Unix timestamp in milliseconds.}
@returns(201) {_id: str, isDismissible: bool, title: str, message: str, startTime: int(int64), endTime: int(int64), severity: str, _status: str, _access: any, _links: map{parent: map{href: str, type: str}}} # Created announcement
@errors {400: Bad request, 403: Forbidden, 404: Not found, 409: Conflict, 500: Internal server error}

@endpoint DELETE /api/v2/announcements/{announcementId}
@desc Delete an announcement
@required {announcementId: str}
@returns(204) No content
@errors {404: Not found, 500: Internal server error}

@endpoint PATCH /api/v2/announcements/{announcementId}
@desc Update an announcement
@required {announcementId: str}
@returns(200) {_id: str, isDismissible: bool, title: str, message: str, startTime: int(int64), endTime: int(int64), severity: str, _status: str, _access: any, _links: map{parent: map{href: str, type: str}}} # Updated announcement
@errors {400: Bad request, 403: Forbidden, 404: Not found, 409: Conflict, 500: Internal server error}

@endpoint GET /api/v2/approval-requests/projects/{projectKey}/settings
@desc Get approval request settings
@required {LD-API-Version: str # Version of the endpoint., projectKey: str}
@optional {environmentKey: str # An environment key filter to apply to the approval request settings., resourceKind: str # A resource kind filter to apply to the approval request settings., expand: str # A comma-separated list of fields to expand in the response. Options include 'default' and 'strict'.}
@returns(200) Successful response
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint PATCH /api/v2/approval-requests/projects/{projectKey}/settings
@desc Update approval request settings
@required {LD-API-Version: str # Version of the endpoint., projectKey: str, environmentKey: str, resourceKind: str}
@optional {autoApplyApprovedChanges: bool # Automatically apply changes that have been approved by all reviewers. This field is only applicable for approval services other than LaunchDarkly., bypassApprovalsForPendingChanges: bool # Whether to skip approvals for pending changes, canApplyDeclinedChanges: bool # Allow applying the change as long as at least one person has approved, canReviewOwnRequest: bool # Allow someone who makes an approval request to apply their own change, minNumApprovals: int(int) # Sets the amount of approvals required before a member can apply a change. The minimum is one and the maximum is five., required: bool # If approvals are required for this environment, requiredApprovalTags: [str] # Require approval only on flags with the provided tags. Otherwise all flags will require approval., serviceConfig: map # Arbitrary service-specific configuration, serviceKind: str # Which service to use for managing approvals, serviceKindConfigurationId: str # Optional integration configuration ID of a custom approval integration. This is an Enterprise-only feature.}
@returns(200) Successful response
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint GET /api/v2/projects/{projectKey}/views
@desc List views
@required {LD-API-Version: str # Version of the endpoint., projectKey: str}
@optional {sort: str(key/name/updatedAt) # A sort to apply to the list of views., limit: int # The number of views to return., offset: int # 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`., filter: str # A filter to apply to the list of views. Supports the following fields and operators: `name` (equals, notEquals, startsWith, contains, anyOf), `key` (equals, notEquals, startsWith, contains, anyOf), `tag` (equals, anyOf), `maintainerId` (equals, anyOf), `isPayloadView` (equals)., expand: [str] # A comma-separated list of fields to expand.}
@returns(200) {_links: map{first: map{href: str, type: str}, last: map{href: str, type: str}, next: map{href: str, type: str}, prev: map{href: str, type: str}, self: map{href: str, type: str}}, items: [map], totalCount: int} # Successful response
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint POST /api/v2/projects/{projectKey}/views
@desc Create view
@required {LD-API-Version: str # Version of the endpoint., projectKey: str, key: str # Unique key for the view within the account/project, name: str # Human-readable name for the view}
@optional {description: str= # Optional detailed description of the view, generateSdkKeys: bool=false # Whether to generate SDK keys for this view, maintainerId: str # Member ID of the maintainer for this view. Only one of `maintainerId` or `maintainerTeamKey` can be specified., maintainerTeamKey: str # Key of the maintainer team for this view. Only one of `maintainerId` or `maintainerTeamKey` can be specified., tags: [str] # Tags associated with this view}
@returns(200) {_access: any, _links: map{self: map{href: str, type: str}, parent: map{href: str, type: str}}, id: str(string), accountId: str, projectId: str, projectKey: str, key: str, name: str, description: str, generateSdkKeys: bool, version: int, tags: [str], createdAt: int(int64), updatedAt: int(int64), archived: bool, archivedAt: int(int64), deletedAt: int(int64), deleted: bool, maintainer: map{id: str, kind: str, maintainerMember: map{id: str, email: str, role: str, firstName: str, lastName: str}, maintainerTeam: map{id: str, key: str, name: str}}, flagsSummary: map{count: int, linkedFlags: map{items: [map], totalCount: int}}, segmentsSummary: map{count: int, linkedSegments: map{items: [map], totalCount: int}}, metricsSummary: map{count: int}, aiConfigsSummary: map{count: int}, resourceSummary: map{flagCount: int, segmentCount: int, totalCount: int}, flagsExpanded: map{items: [map], totalCount: int}, segmentsExpanded: map{items: [map], totalCount: int}, metricsExpanded: map{items: [map], totalCount: int}, aiConfigsExpanded: map{items: [map], totalCount: int}, resourcesExpanded: map{items: map{flags: map{items: [map], totalCount: int}, segments: map{items: [map], totalCount: int}}, totalCount: int}} # Successful response
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint DELETE /api/v2/projects/{projectKey}/views/{viewKey}
@desc Delete view
@required {LD-API-Version: str # Version of the endpoint., projectKey: str, viewKey: str}
@returns(204) No content
@errors {403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint GET /api/v2/projects/{projectKey}/views/{viewKey}
@desc Get view
@required {LD-API-Version: str # Version of the endpoint., projectKey: str, viewKey: str}
@optional {sort: str(key/name/updatedAt) # A sort to apply to the list of views., limit: int # The number of views to return., offset: int # 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`., filter: str # A filter to apply to the list of views. Supports the following fields and operators: `name` (equals, notEquals, startsWith, contains, anyOf), `key` (equals, notEquals, startsWith, contains, anyOf), `tag` (equals, anyOf), `maintainerId` (equals, anyOf), `isPayloadView` (equals)., expand: [str] # A comma-separated list of fields to expand.}
@returns(200) {_access: any, _links: map{self: map{href: str, type: str}, parent: map{href: str, type: str}}, id: str(string), accountId: str, projectId: str, projectKey: str, key: str, name: str, description: str, generateSdkKeys: bool, version: int, tags: [str], createdAt: int(int64), updatedAt: int(int64), archived: bool, archivedAt: int(int64), deletedAt: int(int64), deleted: bool, maintainer: map{id: str, kind: str, maintainerMember: map{id: str, email: str, role: str, firstName: str, lastName: str}, maintainerTeam: map{id: str, key: str, name: str}}, flagsSummary: map{count: int, linkedFlags: map{items: [map], totalCount: int}}, segmentsSummary: map{count: int, linkedSegments: map{items: [map], totalCount: int}}, metricsSummary: map{count: int}, aiConfigsSummary: map{count: int}, resourceSummary: map{flagCount: int, segmentCount: int, totalCount: int}, flagsExpanded: map{items: [map], totalCount: int}, segmentsExpanded: map{items: [map], totalCount: int}, metricsExpanded: map{items: [map], totalCount: int}, aiConfigsExpanded: map{items: [map], totalCount: int}, resourcesExpanded: map{items: map{flags: map{items: [map], totalCount: int}, segments: map{items: [map], totalCount: int}}, totalCount: int}} # Successful response
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint PATCH /api/v2/projects/{projectKey}/views/{viewKey}
@desc Update view
@required {LD-API-Version: str # Version of the endpoint., projectKey: str, viewKey: str}
@optional {name: str # Human-readable name for the view, description: str # Optional detailed description of the view, generateSdkKeys: bool # Whether to generate SDK keys for this view, maintainerId: str # Member ID of the maintainer for this view. Only one of `maintainerId` or `maintainerTeamKey` can be specified., maintainerTeamKey: str # Key of the maintainer team for this view. Only one of `maintainerId` or `maintainerTeamKey` can be specified., tags: [str] # Tags associated with this view, archived: bool # Whether or not the view is archived}
@returns(200) {_access: any, _links: map{self: map{href: str, type: str}, parent: map{href: str, type: str}}, id: str(string), accountId: str, projectId: str, projectKey: str, key: str, name: str, description: str, generateSdkKeys: bool, version: int, tags: [str], createdAt: int(int64), updatedAt: int(int64), archived: bool, archivedAt: int(int64), deletedAt: int(int64), deleted: bool, maintainer: map{id: str, kind: str, maintainerMember: map{id: str, email: str, role: str, firstName: str, lastName: str}, maintainerTeam: map{id: str, key: str, name: str}}, flagsSummary: map{count: int, linkedFlags: map{items: [map], totalCount: int}}, segmentsSummary: map{count: int, linkedSegments: map{items: [map], totalCount: int}}, metricsSummary: map{count: int}, aiConfigsSummary: map{count: int}, resourceSummary: map{flagCount: int, segmentCount: int, totalCount: int}, flagsExpanded: map{items: [map], totalCount: int}, segmentsExpanded: map{items: [map], totalCount: int}, metricsExpanded: map{items: [map], totalCount: int}, aiConfigsExpanded: map{items: [map], totalCount: int}, resourcesExpanded: map{items: map{flags: map{items: [map], totalCount: int}, segments: map{items: [map], totalCount: int}}, totalCount: int}} # Successful response
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint DELETE /api/v2/projects/{projectKey}/views/{viewKey}/link/{resourceType}
@desc Unlink resource
@required {LD-API-Version: str # Version of the endpoint., projectKey: str, viewKey: str, resourceType: str(flags/segments)}
@returns(200) {successCount: int, failureCount: int, failedResources: [map]} # Successful response with unlink details
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint POST /api/v2/projects/{projectKey}/views/{viewKey}/link/{resourceType}
@desc Link resource
@required {LD-API-Version: str # Version of the endpoint., projectKey: str, viewKey: str, resourceType: str(flags/segments)}
@returns(200) {successCount: int, failureCount: int, linkedResources: map{_links: map{first: map{href: str, type: str}, last: map{href: str, type: str}, next: map{href: str, type: str}, prev: map{href: str, type: str}, self: map{href: str, type: str}}, items: [map], totalCount: int}, failedResources: [map]} # Successful response
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint GET /api/v2/projects/{projectKey}/views/{viewKey}/linked/{resourceType}
@desc Get linked resources
@required {LD-API-Version: str # Version of the endpoint., projectKey: str, viewKey: str, resourceType: str(flags/segments)}
@optional {limit: int # The number of views to return., offset: int # 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`., sort: str(linkedAt/name)=linkedAt # Field to sort by. Default field is `linkedAt`, default order is ascending., query: str # Case-insensitive search query for linked resources. Matches resource key and, when expanded, resource name., filter: str # Optional resource filter expression for linked resources. - Supported for `flags` and `segments` resource types. - Uses the same syntax as link/unlink and list endpoints. - For `segments`, `environmentId` is required when `filter` is provided., expand: [str] # A comma-separated list of fields to expand.}
@returns(200) {_links: map{first: map{href: str, type: str}, last: map{href: str, type: str}, next: map{href: str, type: str}, prev: map{href: str, type: str}, self: map{href: str, type: str}}, items: [map], totalCount: int} # Successful response
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint GET /api/v2/projects/{projectKey}/view-associations/{resourceType}/{resourceKey}
@desc Get linked views for a given resource
@required {LD-API-Version: str # Version of the endpoint., projectKey: str, resourceType: str(flags/segments), resourceKey: str}
@optional {environmentId: str # Environment ID. Required when resourceType is 'segments', limit: int # The number of views to return., offset: int # 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`.}
@returns(200) {_links: map{first: map{href: str, type: str}, last: map{href: str, type: str}, next: map{href: str, type: str}, prev: map{href: str, type: str}, self: map{href: str, type: str}}, items: [map], totalCount: int} # Successful response
@errors {400: Bad request, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint GET /api/v2/projects/{projectKey}/release-policies
@desc List release policies
@required {LD-API-Version: str # Version of the endpoint., projectKey: str # The project key}
@optional {excludeDefault: bool=false # When true, exclude the default release policy from the response. When false or omitted, include the default policy if an environment filter is present.}
@returns(200) {items: [map], totalCount: int} # List of release policies
@errors {400: Bad request, 401: Invalid access token, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint POST /api/v2/projects/{projectKey}/release-policies
@desc Create a release policy
@required {LD-API-Version: str # Version of the endpoint., projectKey: str # The project key, releaseMethod: str(guarded-release/progressive-release) # The release method for this policy, name: str # The name of the release policy, key: str # The human-readable key of the release policy}
@optional {scope: map{environmentKeys: [str], flagTagKeys: [str]}, guardedReleaseConfig: map{rolloutContextKindKey: str, minSampleSize: int, rollbackOnRegression: bool, metricKeys: [str], metricGroupKeys: [str], stages: [map]} # Configuration for guarded releases, progressiveReleaseConfig: map{rolloutContextKindKey: str, stages: [map]} # Configuration for progressive releases}
@returns(201) {_access: any, _id: str, scope: map{environmentKeys: [str], flagTagKeys: [str]}, rank: int, releaseMethod: str, guardedReleaseConfig: map{rolloutContextKindKey: str, minSampleSize: int, rollbackOnRegression: bool, metricKeys: [str], metricGroupKeys: [str], stages: [map]}, progressiveReleaseConfig: map{rolloutContextKindKey: str, stages: [map]}, name: str, key: str} # Release policy created successfully
@errors {400: Bad request, 401: Invalid access token, 403: Forbidden, 404: Not found, 409: Conflict, 500: Internal server error}

@endpoint POST /api/v2/projects/{projectKey}/release-policies/order
@desc Update the order of existing release policies
@required {LD-API-Version: str # Version of the endpoint., projectKey: str # The project key}
@returns(200) Release policies updated successfully
@errors {400: Bad request, 401: Invalid access token, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint DELETE /api/v2/projects/{projectKey}/release-policies/{policyKey}
@desc Delete a release policy
@required {LD-API-Version: str # Version of the endpoint., projectKey: str # The project key, policyKey: str # The human-readable key of the release policy}
@returns(204) Release policy deleted successfully
@errors {400: Bad request, 401: Invalid access token, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint GET /api/v2/projects/{projectKey}/release-policies/{policyKey}
@desc Get a release policy by key
@required {LD-API-Version: str # Version of the endpoint., projectKey: str # The project key, policyKey: str # The release policy key}
@returns(200) {_access: any, _id: str, scope: map{environmentKeys: [str], flagTagKeys: [str]}, rank: int, releaseMethod: str, guardedReleaseConfig: map{rolloutContextKindKey: str, minSampleSize: int, rollbackOnRegression: bool, metricKeys: [str], metricGroupKeys: [str], stages: [map]}, progressiveReleaseConfig: map{rolloutContextKindKey: str, stages: [map]}, name: str, key: str} # Release policy found
@errors {400: Bad request, 401: Invalid access token, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint PUT /api/v2/projects/{projectKey}/release-policies/{policyKey}
@desc Update a release policy
@required {LD-API-Version: str # Version of the endpoint., projectKey: str # The project key, policyKey: str # The human-readable key of the release policy, releaseMethod: str(guarded-release/progressive-release) # The release method for this policy, name: str # The name of the release policy}
@optional {scope: map{environmentKeys: [str], flagTagKeys: [str]}, guardedReleaseConfig: map{rolloutContextKindKey: str, minSampleSize: int, rollbackOnRegression: bool, metricKeys: [str], metricGroupKeys: [str], stages: [map]} # Configuration for guarded releases, progressiveReleaseConfig: map{rolloutContextKindKey: str, stages: [map]} # Configuration for progressive releases}
@returns(200) {_access: any, _id: str, scope: map{environmentKeys: [str], flagTagKeys: [str]}, rank: int, releaseMethod: str, guardedReleaseConfig: map{rolloutContextKindKey: str, minSampleSize: int, rollbackOnRegression: bool, metricKeys: [str], metricGroupKeys: [str], stages: [map]}, progressiveReleaseConfig: map{rolloutContextKindKey: str, stages: [map]}, name: str, key: str} # Release policy updated successfully
@errors {400: Bad request, 401: Invalid access token, 403: Forbidden, 404: Not found, 500: Internal server error}

@endpoint GET /api/v2/engineering-insights/charts/deployments/frequency
@desc Get deployment frequency chart data
@optional {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key, applicationKey: str(string) # Comma separated list of application keys, from: str(date-time) # Unix timestamp in milliseconds. Default value is 7 days ago., to: str(date-time) # Unix timestamp in milliseconds. Default value is now., bucketType: str(string) # Specify type of bucket. Options: `rolling`, `hour`, `day`. Default: `rolling`., bucketMs: int(int64) # Duration of intervals for x-axis in milliseconds. Default value is one day (`86400000` milliseconds)., groupBy: str(string) # Options: `application`, `kind`, expand: str(string) # Options: `metrics`}
@returns(200) {metadata: map{summary: map, name: str, metrics: map, xAxis: map{unit: str}, yAxis: map{unit: str}}, series: [map]} # Chart response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/engineering-insights/charts/flags/stale
@desc Get stale flags chart data
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key}
@optional {applicationKey: str(string) # Comma separated list of application keys, groupBy: str(string) # Property to group results by. Options: `maintainer`, maintainerId: str(string) # Comma-separated list of individual maintainers to filter results., maintainerTeamKey: str(string) # Comma-separated list of team maintainer keys to filter results., expand: str(string) # Options: `metrics`}
@returns(200) {metadata: map{summary: map, name: str, metrics: map, xAxis: map{unit: str}, yAxis: map{unit: str}}, series: [map]} # Chart response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/engineering-insights/charts/flags/status
@desc Get flag status chart data
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key}
@optional {applicationKey: str(string) # Comma separated list of application keys}
@returns(200) {metadata: map{summary: map, name: str, metrics: map, xAxis: map{unit: str}, yAxis: map{unit: str}}, series: [map]} # Chart response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/engineering-insights/charts/lead-time
@desc Get lead time chart data
@required {projectKey: str(string) # The project key}
@optional {environmentKey: str(string) # The environment key, applicationKey: str(string) # Comma separated list of application keys, from: int(int64) # Unix timestamp in milliseconds. Default value is 7 days ago., to: int(int64) # Unix timestamp in milliseconds. Default value is now., bucketType: str(string) # Specify type of bucket. Options: `rolling`, `hour`, `day`. Default: `rolling`., bucketMs: int(int64) # Duration of intervals for x-axis in milliseconds. Default value is one day (`86400000` milliseconds)., groupBy: str(string) # Options: `application`, `stage`. Default: `stage`., expand: str(string) # Options: `metrics`, `percentiles`.}
@returns(200) {metadata: map{summary: map, name: str, metrics: map, xAxis: map{unit: str}, yAxis: map{unit: str}}, series: [map]} # Chart response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/engineering-insights/charts/releases/frequency
@desc Get release frequency chart data
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key}
@optional {applicationKey: str(string) # Comma separated list of application keys, hasExperiments: bool # Filter events to those associated with an experiment (`true`) or without an experiment (`false`), global: str(string) # Filter to include or exclude global events. Default value is `include`. Options: `include`, `exclude`, groupBy: str(string) # Property to group results by. Options: `impact`, from: str(date-time) # Unix timestamp in milliseconds. Default value is 7 days ago., to: str(date-time) # Unix timestamp in milliseconds. Default value is now., bucketType: str(string) # Specify type of bucket. Options: `rolling`, `hour`, `day`. Default: `rolling`., bucketMs: int(int64) # Duration of intervals for x-axis in milliseconds. Default value is one day (`86400000` milliseconds)., expand: str(string) # Options: `metrics`}
@returns(200) {metadata: map{summary: map, name: str, metrics: map, xAxis: map{unit: str}, yAxis: map{unit: str}}, series: [map]} # Chart response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint POST /api/v2/engineering-insights/deployment-events
@desc Create deployment event
@required {projectKey: str # The project key, environmentKey: str # The environment key, applicationKey: str # The application key. This defines the granularity at which you want to view your insights metrics. Typically it is the name of one of the GitHub repositories that you use in this project.LaunchDarkly automatically creates a new application each time you send a unique application key., version: str # The application version. You can set the application version to any string that includes only letters, numbers, periods (.), hyphens (-), or underscores (_).We recommend setting the application version to at least the first seven characters of the SHA or to the tag of the GitHub commit for this deployment., eventType: str(started/failed/finished/custom) # The event type}
@optional {applicationName: str # The application name. This defines how the application is displayed, applicationKind: str(server/browser/mobile) # The kind of application. Default: server, versionName: str # The version name. This defines how the version is displayed, eventTime: int(int64), eventMetadata: map # A JSON object containing metadata about the event, deploymentMetadata: map # A JSON object containing metadata about the deployment}
@returns(201) Created
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/engineering-insights/deployments
@desc List deployments
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key}
@optional {applicationKey: str(string) # Comma separated list of application keys, limit: int(int64) # The number of deployments to return. Default is 20. Maximum allowed is 100., expand: str(string) # Expand properties in response. Options: `pullRequests`, `flagReferences`, from: int(int64) # Unix timestamp in milliseconds. Default value is 7 days ago., to: int(int64) # Unix timestamp in milliseconds. Default value is now., after: str(string) # Identifier used for pagination, before: str(string) # Identifier used for pagination, kind: str(string) # The deployment kind, status: str(string) # The deployment status}
@returns(200) {totalCount: int, items: [map], _links: map} # Deployment collection response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/engineering-insights/deployments/{deploymentID}
@desc Get deployment
@required {deploymentID: str(string) # The deployment ID}
@optional {expand: str(string) # Expand properties in response. Options: `pullRequests`, `flagReferences`}
@returns(200) {id: str(uuid), applicationKey: str, applicationVersion: str, startedAt: int(int64), endedAt: int(int64), durationMs: int(int64), status: str, kind: str, active: bool, metadata: map, archived: bool, environmentKey: str, numberOfContributors: int, numberOfPullRequests: int, linesAdded: int(int64), linesDeleted: int(int64), leadTime: int(int64), pullRequests: map{totalCount: int, items: [map], _links: map}, flagReferences: map{totalCount: int, items: [map]}, leadTimeStages: map{codingDurationMs: int(int64), reviewDurationMs: int(int64), waitDurationMs: int(int64), deployDurationMs: int(int64), totalLeadTimeMs: int(int64)}} # Deployment response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint PATCH /api/v2/engineering-insights/deployments/{deploymentID}
@desc Update deployment
@required {deploymentID: str(string) # The deployment ID}
@returns(200) {id: str(uuid), applicationKey: str, applicationVersion: str, startedAt: int(int64), endedAt: int(int64), durationMs: int(int64), status: str, kind: str, active: bool, metadata: map, archived: bool, environmentKey: str, numberOfContributors: int, numberOfPullRequests: int, linesAdded: int(int64), linesDeleted: int(int64), leadTime: int(int64), pullRequests: map{totalCount: int, items: [map], _links: map}, flagReferences: map{totalCount: int, items: [map]}, leadTimeStages: map{codingDurationMs: int(int64), reviewDurationMs: int(int64), waitDurationMs: int(int64), deployDurationMs: int(int64), totalLeadTimeMs: int(int64)}} # Deployment response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}
@example_request [{"op":"replace","path":"/status","value":"finished"}]

@endpoint GET /api/v2/engineering-insights/flag-events
@desc List flag events
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key}
@optional {applicationKey: str(string) # Comma separated list of application keys, query: str(string) # Filter events by flag key, impactSize: str(string) # Filter events by impact size. A small impact created a less than 20% change in the proportion of end users receiving one or more flag variations. A medium impact created between a 20%-80% change. A large impact created a more than 80% change. Options: `none`, `small`, `medium`, `large`, hasExperiments: bool # Filter events to those associated with an experiment (`true`) or without an experiment (`false`), global: str(string) # Filter to include or exclude global events. Default value is `include`. Options: `include`, `exclude`, expand: str(string) # Expand properties in response. Options: `experiments`, limit: int(int64) # The number of deployments to return. Default is 20. Maximum allowed is 100., from: int(int64) # Unix timestamp in milliseconds. Default value is 7 days ago., to: int(int64) # Unix timestamp in milliseconds. Default value is now., after: str(string) # Identifier used for pagination, before: str(string) # Identifier used for pagination}
@returns(200) {totalCount: int, items: [map], _links: map} # Flag event collection response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint POST /api/v2/engineering-insights/insights/group
@desc Create insight group
@required {name: str # The name of the insight group, key: str # The key of the insight group, projectKey: str # The projectKey to be associated with the insight group, environmentKey: str # The environmentKey to be associated with the insight group}
@optional {applicationKeys: [str] # The application keys to associate with the insight group. If not provided, the insight group will include data from all applications.}
@returns(201) {environment: map{_links: map, _id: str, key: str, name: str, apiKey: str, mobileKey: str, color: str, defaultTtl: int, secureMode: bool, _access: map{denied: [map], allowed: [map]}, defaultTrackEvents: bool, requireComments: bool, confirmChanges: bool, tags: [str], approvalSettings: map{required: bool, bypassApprovalsForPendingChanges: bool, minNumApprovals: int, canReviewOwnRequest: bool, canApplyDeclinedChanges: bool, autoApplyApprovedChanges: bool, serviceKind: str, serviceConfig: map, requiredApprovalTags: [str], serviceKindConfigurationId: str}, resourceApprovalSettings: map, critical: bool}, scores: map{overall: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, deploymentFrequency: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, deploymentFailureRate: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, leadTime: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, impactSize: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, experimentationCoverage: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, flagHealth: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, velocity: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, risk: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, efficiency: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, creationRatio: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}}, scoreMetadata: map{period: map{startTime: int(int64), endTime: int(int64)}, lastPeriod: map{startTime: int(int64), endTime: int(int64)}}, key: str, name: str, projectKey: str, environmentKey: str, applicationKeys: [str], createdAt: int(int64)} # Created
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 409: Status conflict, 429: Rate limited}

@endpoint GET /api/v2/engineering-insights/insights/groups
@desc List insight groups
@optional {limit: int(int64) # The number of insight groups to return. Default is 20. Must be between 1 and 20 inclusive., offset: int(int64) # 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`., sort: str(string) # Sort flag list by field. Prefix field with - to sort in descending order. Allowed fields: name, query: str(string) # Filter list of insights groups by name., expand: str(string) # Options: `scores`, `environment`, `metadata`}
@returns(200) {totalCount: int, items: [map], _links: map, metadata: map{countByIndicator: map{excellent: int, good: int, fair: int, needsAttention: int, notCalculated: int, unknown: int, total: int}}, scoreMetadata: map{period: map{startTime: int(int64), endTime: int(int64)}, lastPeriod: map{startTime: int(int64), endTime: int(int64)}}} # Insight groups collection response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 429: Rate limited}

@endpoint GET /api/v2/engineering-insights/insights/groups/{insightGroupKey}
@desc Get insight group
@required {insightGroupKey: str(string) # The insight group key}
@optional {expand: str(string) # Options: `scores`, `environment`}
@returns(200) {environment: map{_links: map, _id: str, key: str, name: str, apiKey: str, mobileKey: str, color: str, defaultTtl: int, secureMode: bool, _access: map{denied: [map], allowed: [map]}, defaultTrackEvents: bool, requireComments: bool, confirmChanges: bool, tags: [str], approvalSettings: map{required: bool, bypassApprovalsForPendingChanges: bool, minNumApprovals: int, canReviewOwnRequest: bool, canApplyDeclinedChanges: bool, autoApplyApprovedChanges: bool, serviceKind: str, serviceConfig: map, requiredApprovalTags: [str], serviceKindConfigurationId: str}, resourceApprovalSettings: map, critical: bool}, scores: map{overall: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, deploymentFrequency: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, deploymentFailureRate: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, leadTime: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, impactSize: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, experimentationCoverage: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, flagHealth: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, velocity: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, risk: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, efficiency: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, creationRatio: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}}, scoreMetadata: map{period: map{startTime: int(int64), endTime: int(int64)}, lastPeriod: map{startTime: int(int64), endTime: int(int64)}}, key: str, name: str, projectKey: str, environmentKey: str, applicationKeys: [str], createdAt: int(int64)} # Insight group response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint PATCH /api/v2/engineering-insights/insights/groups/{insightGroupKey}
@desc Patch insight group
@required {insightGroupKey: str(string) # The insight group key}
@returns(200) {environment: map{_links: map, _id: str, key: str, name: str, apiKey: str, mobileKey: str, color: str, defaultTtl: int, secureMode: bool, _access: map{denied: [map], allowed: [map]}, defaultTrackEvents: bool, requireComments: bool, confirmChanges: bool, tags: [str], approvalSettings: map{required: bool, bypassApprovalsForPendingChanges: bool, minNumApprovals: int, canReviewOwnRequest: bool, canApplyDeclinedChanges: bool, autoApplyApprovedChanges: bool, serviceKind: str, serviceConfig: map, requiredApprovalTags: [str], serviceKindConfigurationId: str}, resourceApprovalSettings: map, critical: bool}, scores: map{overall: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, deploymentFrequency: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, deploymentFailureRate: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, leadTime: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, impactSize: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, experimentationCoverage: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, flagHealth: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, velocity: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, risk: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, efficiency: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, creationRatio: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}}, scoreMetadata: map{period: map{startTime: int(int64), endTime: int(int64)}, lastPeriod: map{startTime: int(int64), endTime: int(int64)}}, key: str, name: str, projectKey: str, environmentKey: str, applicationKeys: [str], createdAt: int(int64)} # Insight group response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 422: Invalid patch content, 429: Rate limited}
@example_request [{"op":"replace","path":"/name","value":"Prod group"}]

@endpoint DELETE /api/v2/engineering-insights/insights/groups/{insightGroupKey}
@desc Delete insight group
@required {insightGroupKey: str(string) # The insight group key}
@returns(204) Action succeeded
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/engineering-insights/insights/scores
@desc Get insight scores
@required {projectKey: str(string) # The project key, environmentKey: str(string) # The environment key}
@optional {applicationKey: str(string) # Comma separated list of application keys}
@returns(200) {period: map{startTime: int(int64), endTime: int(int64)}, lastPeriod: map{startTime: int(int64), endTime: int(int64)}, scores: map{overall: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, deploymentFrequency: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, deploymentFailureRate: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, leadTime: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, impactSize: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, experimentationCoverage: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, flagHealth: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, velocity: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, risk: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, efficiency: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}, creationRatio: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map{min: int, max: int}, lastPeriod: map{score: int, aggregateOf: [str], diffVsLastPeriod: int, indicator: str, indicatorRange: map, lastPeriod: map}}}, _links: map} # Insight score response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 429: Rate limited}

@endpoint GET /api/v2/engineering-insights/pull-requests
@desc List pull requests
@required {projectKey: str(string) # The project key}
@optional {environmentKey: str(string) # Required if you are using the sort parameter's leadTime option to sort pull requests., applicationKey: str(string) # Filter the results to pull requests deployed to a comma separated list of applications, status: str(string) # Filter results to pull requests with the given status. Options: `open`, `merged`, `closed`, `deployed`., query: str(string) # Filter list of pull requests by title or author, limit: int(int64) # The number of pull requests to return. Default is 20. Maximum allowed is 100., expand: str(string) # Expand properties in response. Options: `deployments`, `flagReferences`, `leadTime`., sort: str(string) # Sort results. Requires the `environmentKey` to be set. Options: `leadTime` (asc) and `-leadTime` (desc). When query option is excluded, default sort is by created or merged date., from: str(date-time) # Unix timestamp in milliseconds. Default value is 7 days ago., to: str(date-time) # Unix timestamp in milliseconds. Default value is now., after: str(string) # Identifier used for pagination, before: str(string) # Identifier used for pagination}
@returns(200) {totalCount: int, items: [map], _links: map} # Pull request collection response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint GET /api/v2/engineering-insights/repositories
@desc List repositories
@optional {expand: str(string) # Expand properties in response. Options: `projects`}
@returns(200) {totalCount: int, items: [map], _links: map} # Repository collection response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint PUT /api/v2/engineering-insights/repositories/projects
@desc Associate repositories with projects
@required {mappings: [map{repositoryKey!: str, projectKey!: str}]}
@returns(200) {totalCount: int, items: [map], _links: map} # Repositories projects response
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@endpoint DELETE /api/v2/engineering-insights/repositories/{repositoryKey}/projects/{projectKey}
@desc Remove repository project association
@required {repositoryKey: str(string) # The repository key, projectKey: str(string) # The project key}
@returns(204) Action succeeded
@errors {400: Invalid request, 401: Invalid access token, 403: Forbidden, 404: Invalid resource identifier, 429: Rate limited}

@end
