You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

15181 lines
480 KiB

  1. ---
  2. openapi: 3.0.0
  3. info:
  4. title: LaunchDarkly REST API
  5. description: |
  6. # Overview
  7. ## Authentication
  8. All REST API resources are authenticated with either [personal or service access tokens](https://docs.launchdarkly.com/home/account-security/api-access-tokens), or session cookies. Other authentication mechanisms are not supported. You can manage personal access tokens on your [Account settings](https://app.launchdarkly.com/settings/tokens) page.
  9. LaunchDarkly also has SDK keys, mobile keys, and client-side IDs that are used by our server-side SDKs, mobile SDKs, and client-side SDKs, respectively. **These keys cannot be used to access our REST API**. These keys are environment-specific, and can only perform read-only operations (fetching feature flag settings).
  10. | Auth mechanism | Allowed resources | Use cases |
  11. | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
  12. | [Personal access tokens](https://docs.launchdarkly.com/home/account-security/api-access-tokens) | Can be customized on a per-token basis | Building scripts, custom integrations, data export |
  13. | SDK keys | Can only access read-only SDK-specific resources and the firehose, restricted to a single environment | Server-side SDKs, Firehose API |
  14. | Mobile keys | Can only access read-only mobile SDK-specific resources, restricted to a single environment | Mobile SDKs |
  15. | Client-side ID | Single environment, only flags marked available to client-side | Client-side JavaScript |
  16. > #### Keep your access tokens and SDK keys private
  17. >
  18. > Access tokens should _never_ be exposed in untrusted contexts. Never put an access token in client-side JavaScript, or embed it in a mobile application. LaunchDarkly has special mobile keys that you can embed in mobile apps. If you accidentally expose an access token or SDK key, you can reset it from your [Account Settings](https://app.launchdarkly.com/settings#/tokens) page.
  19. >
  20. > The client-side ID is safe to embed in untrusted contexts. It's designed for use in client-side JavaScript.
  21. ### Via request header
  22. The preferred way to authenticate with the API is by adding an `Authorization` header containing your access token to your requests. The value of the `Authorization` header must be your access token.
  23. Manage personal access tokens from the [Account Settings](https://app.launchdarkly.com/settings/tokens) page.
  24. ### Via session cookie
  25. For testing purposes, you can make API calls directly from your web browser. If you're logged in to the application, the API will use your existing session to authenticate calls.
  26. If you have a [role](https://docs.launchdarkly.com/home/team/built-in-roles) other than Admin, or have a [custom role](https://docs.launchdarkly.com/home/team/custom-roles) defined, you may not have permission to perform some API calls. You will receive a `401` response code in that case.
  27. > ### Modifying the Origin header causes an error
  28. >
  29. > LaunchDarkly validates that the Origin header for any API request authenticated by a session cookie matches the expected Origin header. The expected Origin header is `https://app.launchdarkly.com`.
  30. >
  31. > If the Origin header does not match what's expected, LaunchDarkly returns an error. This error can prevent the LaunchDarkly app from working correctly.
  32. >
  33. > Any browser extension that intentionally changes the Origin header can cause this problem. For example, the `Allow-Control-Allow-Origin: *` Chrome extension changes the Origin header to `http://evil.com` and causes the app to fail.
  34. >
  35. > To prevent this error, do not modify your Origin header.
  36. >
  37. > LaunchDarkly does not require origin matching when authenticating with an access token, so this issue does not affect normal API usage.
  38. ## Representations
  39. All resources expect and return JSON response bodies. Error responses will also send a JSON body. Read [Errors](#section/Errors) for a more detailed description of the error format used by the API.
  40. In practice this means that you always get a response with a `Content-Type` header set to `application/json`.
  41. In addition, request bodies for `PUT`, `POST`, `REPORT` and `PATCH` requests must be encoded as JSON with a `Content-Type` header set to `application/json`.
  42. ### Summary and detailed representations
  43. When you fetch a list of resources, the response includes only the most important attributes of each resource. This is a _summary representation_ of the resource. When you fetch an individual resource (for example, a single feature flag), you receive a _detailed representation_ containing all of the attributes of the resource.
  44. The best way to find a detailed representation is to follow links. Every summary representation includes a link to its detailed representation.
  45. ### Links and addressability
  46. The best way to navigate the API is by following links. These are attributes in representations that link to other resources. The API always uses the same format for links:
  47. - Links to other resources within the API are encapsulated in a `_links` object.
  48. - If the resource has a corresponding link to HTML content on the site, it is stored in a special `_site` link.
  49. Each link has two attributes: an href (the URL) and a type (the content type). For example, a feature resource might return the following:
  50. ```json
  51. {
  52. "_links": {
  53. "parent": {
  54. "href": "/api/features",
  55. "type": "application/json"
  56. },
  57. "self": {
  58. "href": "/api/features/sort.order",
  59. "type": "application/json"
  60. }
  61. },
  62. "_site": {
  63. "href": "/features/sort.order",
  64. "type": "text/html"
  65. }
  66. }
  67. ```
  68. From this, you can navigate to the parent collection of features by following the `parent` link, or navigate to the site page for the feature by following the `_site` link.
  69. Collections are always represented as a JSON object with an `items` attribute containing an array of representations. Like all other representations, collections have `_links` defined at the top level.
  70. Paginated collections include `first`, `last`, `next`, and `prev` links containing a URL with the respective set of elements in the collection.
  71. ## Updates
  72. Resources that accept partial updates use the `PATCH` verb, and support the [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902) format. Some resources also support the [JSON Merge Patch](https://datatracker.ietf.org/doc/html/rfc7386) format. In addition, some resources support optional comments that can be submitted with updates. Comments appear in outgoing webhooks, the audit log, and other integrations.
  73. ### Updates via JSON Patch
  74. [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902) is a way to specify the modifications to perform on a resource. For example, in this feature flag representation:
  75. ```json
  76. {
  77. "name": "New recommendations engine",
  78. "key": "engine.enable",
  79. "description": "This is the description",
  80. ...
  81. }
  82. ```
  83. You can change the feature flag's description with the following patch document:
  84. ```json
  85. [{ "op": "replace", "path": "/description", "value": "This is the new description" }]
  86. ```
  87. JSON Patch documents are always arrays. You can specify multiple modifications to perform in a single request. You can also test that certain preconditions are met before applying the patch:
  88. ```json
  89. [
  90. { "op": "test", "path": "/version", "value": 10 },
  91. { "op": "replace", "path": "/description", "value": "The new description" }
  92. ]
  93. ```
  94. The above patch request tests whether the feature flag's `version` is `10`, and if so, changes the feature flag's description.
  95. Attributes that aren't editable, like a resource's `_links`, have names that start with an underscore.
  96. ### Updates via JSON Merge Patch
  97. The API also supports the [JSON Merge Patch](https://datatracker.ietf.org/doc/html/rfc7386) format, as well as the [Update feature flag](/tag/Feature-flags#operation/patchFeatureFlag) resource.
  98. JSON Merge Patch is less expressive than JSON Patch but in many cases, it is simpler to construct a merge patch document. For example, you can change a feature flag's description with the following merge patch document:
  99. ```json
  100. {
  101. "description": "New flag description"
  102. }
  103. ```
  104. ### Updates with comments
  105. You can submit optional comments with `PATCH` changes. The [Update feature flag](/tag/Feature-flags#operation/patchFeatureFlag) resource supports comments.
  106. To submit a comment along with a JSON Patch document, use the following format:
  107. ```json
  108. {
  109. "comment": "This is a comment string",
  110. "patch": [{ "op": "replace", "path": "/description", "value": "The new description" }]
  111. }
  112. ```
  113. To submit a comment along with a JSON Merge Patch document, use the following format:
  114. ```json
  115. {
  116. "comment": "This is a comment string",
  117. "merge": { "description": "New flag description" }
  118. }
  119. ```
  120. ### Updates via semantic patches
  121. The API also supports the Semantic patch format. A semantic `PATCH` is a way to specify the modifications to perform on a resource as a set of executable instructions.
  122. JSON Patch uses paths and a limited set of operations to describe how to transform the current state of the resource into a new state. Semantic patch allows you to be explicit about intent using precise, custom instructions. In many cases, semantic patch instructions can also be defined independently of the current state of the resource. This can be useful when defining a change that may be applied at a future date.
  123. For example, in this feature flag configuration in environment Production:
  124. ```json
  125. {
  126. "name": "Alternate sort order",
  127. "kind": "boolean",
  128. "key": "sort.order",
  129. ...
  130. "environments": {
  131. "production": {
  132. "on": true,
  133. "archived": false,
  134. "salt": "c29ydC5vcmRlcg==",
  135. "sel": "8de1085cb7354b0ab41c0e778376dfd3",
  136. "lastModified": 1469131558260,
  137. "version": 81,
  138. "targets": [
  139. {
  140. "values": [
  141. "Gerhard.Little@yahoo.com"
  142. ],
  143. "variation": 0
  144. },
  145. {
  146. "values": [
  147. "1461797806429-33-861961230",
  148. "438580d8-02ee-418d-9eec-0085cab2bdf0"
  149. ],
  150. "variation": 1
  151. }
  152. ],
  153. "rules": [],
  154. "fallthrough": {
  155. "variation": 0
  156. },
  157. "offVariation": 1,
  158. "prerequisites": [],
  159. "_site": {
  160. "href": "/default/production/features/sort.order",
  161. "type": "text/html"
  162. }
  163. }
  164. }
  165. }
  166. ```
  167. You can add a date you want a user to be removed from the feature flag's user targets. For example, “remove user 1461797806429-33-861961230 from the user target for variation 0 on the Alternate sort order flag in the production environment on Wed Jul 08 2020 at 15:27:41 pm”. This is done using the following:
  168. ```json
  169. {
  170. "comment": "update expiring user targets",
  171. "instructions": [
  172. {
  173. "kind": "removeExpireUserTargetDate",
  174. "userKey": "userKey",
  175. "variationId": "978d53f9-7fe3-4a63-992d-97bcb4535dc8"
  176. },
  177. {
  178. "kind": "updateExpireUserTargetDate",
  179. "userKey": "userKey2",
  180. "variationId": "978d53f9-7fe3-4a63-992d-97bcb4535dc8",
  181. "value": 1587582000000
  182. },
  183. {
  184. "kind": "addExpireUserTargetDate",
  185. "userKey": "userKey3",
  186. "variationId": "978d53f9-7fe3-4a63-992d-97bcb4535dc8",
  187. "value": 1594247266386
  188. }
  189. ]
  190. }
  191. ```
  192. Here is another example. In this feature flag configuration:
  193. ```json
  194. {
  195. "name": "New recommendations engine",
  196. "key": "engine.enable",
  197. "environments": {
  198. "test": {
  199. "on": true
  200. }
  201. }
  202. }
  203. ```
  204. You can change the feature flag's description with the following patch document as a set of executable instructions. For example, “add user X to targets for variation Y and remove user A from targets for variation B for test flag”:
  205. ```json
  206. {
  207. "comment": "",
  208. "instructions": [
  209. {
  210. "kind": "removeUserTargets",
  211. "values": ["438580d8-02ee-418d-9eec-0085cab2bdf0"],
  212. "variationId": "852cb784-54ff-46b9-8c35-5498d2e4f270"
  213. },
  214. {
  215. "kind": "addUserTargets",
  216. "values": ["438580d8-02ee-418d-9eec-0085cab2bdf0"],
  217. "variationId": "1bb18465-33b6-49aa-a3bd-eeb6650b33ad"
  218. }
  219. ]
  220. }
  221. ```
  222. > ### Supported semantic patch API endpoints
  223. >
  224. > - [Update feature flag](/tag/Feature-flags#operation/patchFeatureFlag)
  225. > - [Update expiring user targets on feature flag](/tag/Feature-flags#operation/patchExpiringUserTargets)
  226. > - [Update expiring user target for flags](/tag/User-settings#operation/patchExpiringFlagsForUser)
  227. > - [Update expiring user targets on segment](/tag/Segments#operation/patchExpiringUserTargetsForSegment)
  228. ## Errors
  229. The API always returns errors in a common format. Here's an example:
  230. ```json
  231. {
  232. "code": "invalid_request",
  233. "message": "A feature with that key already exists",
  234. "id": "30ce6058-87da-11e4-b116-123b93f75cba"
  235. }
  236. ```
  237. The general class of error is indicated by the `code`. The `message` is a human-readable explanation of what went wrong. The `id` is a unique identifier. Use it when you're working with LaunchDarkly support to debug a problem with a specific API call.
  238. ### HTTP Status - Error Response Codes
  239. | Code | Definition | Desc. | Possible Solution |
  240. | ---- | ----------------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
  241. | 400 | Bad Request | A request that fails may return this HTTP response code. | Ensure JSON syntax in request body is correct. |
  242. | 401 | Unauthorized | User doesn't have permission to an API call. | Ensure your SDK key is good. |
  243. | 403 | Forbidden | User does not have permission for operation. | Ensure that the user or access token has proper permissions set. |
  244. | 409 | Conflict | The API request could not be completed because it conflicted with a concurrent API request. | Retry your request. |
  245. | 429 | Too many requests | See [Rate limiting](/#section/Rate-limiting). | Wait and try again later. |
  246. ## CORS
  247. The LaunchDarkly API supports Cross Origin Resource Sharing (CORS) for AJAX requests from any origin. If an `Origin` header is given in a request, it will be echoed as an explicitly allowed origin. Otherwise, a wildcard is returned: `Access-Control-Allow-Origin: *`. For more information on CORS, see the [CORS W3C Recommendation](http://www.w3.org/TR/cors). Example CORS headers might look like:
  248. ```http
  249. Access-Control-Allow-Headers: Accept, Content-Type, Content-Length, Accept-Encoding, Authorization
  250. Access-Control-Allow-Methods: OPTIONS, GET, DELETE, PATCH
  251. Access-Control-Allow-Origin: *
  252. Access-Control-Max-Age: 300
  253. ```
  254. You can make authenticated CORS calls just as you would make same-origin calls, using either [token or session-based authentication](#section/Authentication). If you’re using session auth, you should set the `withCredentials` property for your `xhr` request to `true`. You should never expose your access tokens to untrusted users.
  255. ## Rate limiting
  256. We use several rate limiting strategies to ensure the availability of our APIs. Rate-limited calls to our APIs will return a `429` status code. Calls to our APIs will include headers indicating the current rate limit status. The specific headers returned depend on the API route being called. The limits differ based on the route, authentication mechanism, and other factors. Routes that are not rate limited may not contain any of the headers described below.
  257. > ### Rate limiting and SDKs
  258. >
  259. > LaunchDarkly SDKs are never rate limited and do not use the API endpoints defined here. LaunchDarkly uses a different set of approaches, including streaming/server-sent events and a global CDN, to ensure availability to the routes used by LaunchDarkly SDKs.
  260. >
  261. > The client-side ID is safe to embed in untrusted contexts. It's designed for use in client-side JavaScript.
  262. ### Global rate limits
  263. Authenticated requests are subject to a global limit. This is the maximum number of calls that can be made to the API per ten seconds. All personal access tokens on the account share this limit, so exceeding the limit with one access token will impact other tokens. Calls that are subject to global rate limits will return the headers below:
  264. | Header name | Description |
  265. | ------------------------------ | -------------------------------------------------------------------------------- |
  266. | `X-Ratelimit-Global-Remaining` | The maximum number of requests the account is permitted to make per ten seconds. |
  267. | `X-Ratelimit-Reset` | The time at which the current rate limit window resets in epoch milliseconds. |
  268. We do not publicly document the specific number of calls that can be made globally. This limit may change, and we encourage clients to program against the specification, relying on the two headers defined above, rather than hardcoding to the current limit.
  269. ### Route-level rate limits
  270. Some authenticated routes have custom rate limits. These also reset every ten seconds. Any access tokens hitting the same route share this limit, so exceeding the limit with one access token may impact other tokens. Calls that are subject to route-level rate limits will return the headers below:
  271. | Header name | Description |
  272. | ----------------------------- | ----------------------------------------------------------------------------------------------------- |
  273. | `X-Ratelimit-Route-Remaining` | The maximum number of requests to the current route the account is permitted to make per ten seconds. |
  274. | `X-Ratelimit-Reset` | The time at which the current rate limit window resets in epoch milliseconds. |
  275. A _route_ represents a specific URL pattern and verb. For example, the [Delete environment](/tag/Environments#operation/deleteEnvironment) endpoint is considered a single route, and each call to delete an environment counts against your route-level rate limit for that route.
  276. We do not publicly document the specific number of calls that can be made to each endpoint per ten seconds. These limits may change, and we encourage clients to program against the specification, relying on the two headers defined above, rather than hardcoding to the current limits.
  277. ### IP-based rate limiting
  278. We also employ IP-based rate limiting on some API routes. If you hit an IP-based rate limit, your API response will include a `Retry-After` header indicating how long to wait before re-trying the call. Clients must wait at least `Retry-After` seconds before making additional calls to our API, and should employ jitter and backoff strategies to avoid triggering rate limits again.
  279. ## OpenAPI (Swagger)
  280. We have a [complete OpenAPI (Swagger) specification](https://app.launchdarkly.com/api/v2/openapi.json) for our API.
  281. You can use this specification to generate client libraries to interact with our REST API in your language of choice.
  282. This specification is supported by several API-based tools such as Postman and Insomnia. In many cases, you can directly import our specification to ease use in navigating the APIs in the tooling.
  283. ## Client libraries
  284. We auto-generate multiple client libraries based on our OpenAPI specification. To learn more, visit [GitHub](https://github.com/search?q=topic%3Alaunchdarkly-api+org%3Alaunchdarkly&type=Repositories).
  285. ## Method Overriding
  286. Some firewalls and HTTP clients restrict the use of verbs other than `GET` and `POST`. In those environments, our API endpoints that use `PUT`, `PATCH`, and `DELETE` verbs will be inaccessible.
  287. To avoid this issue, our API supports the `X-HTTP-Method-Override` header, allowing clients to "tunnel" `PUT`, `PATCH`, and `DELETE` requests via a `POST` request.
  288. For example, if you wish to call one of our `PATCH` resources via a `POST` request, you can include `X-HTTP-Method-Override:PATCH` as a header.
  289. ## Beta resources
  290. We sometimes release new API resources in **beta** status before we release them with general availability.
  291. Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible.
  292. We try to promote resources into general availability as quickly as possible. This happens after sufficient testing and when we're satisfied that we no longer need to make backwards-incompatible changes.
  293. We mark beta resources with a "Beta" callout in our documentation, pictured below:
  294. > ### This feature is in beta
  295. >
  296. > To use this feature, pass in a header including the `LD-API-Version` key with value set to `beta`. Use this header with each call. To learn more, read [Beta resources](/#section/Beta-resources).
  297. ### Using beta resources
  298. To use a beta resource, you must include a header in the request. If you call a beta resource without this header, you'll receive a `403` response.
  299. Use this header:
  300. ```
  301. LD-API-Version: beta
  302. ```
  303. ## Versioning
  304. We try hard to keep our REST API backwards compatible, but we occasionally have to make backwards-incompatible changes in the process of shipping new features. These breaking changes can cause unexpected behavior if you don't prepare for them accordingly.
  305. Updates to our REST API include support for the latest features in LaunchDarkly. We also release a new version of our REST API every time we make a breaking change. We provide simultaneous support for multiple API versions so you can migrate from your current API version to a new version at your own pace.
  306. ### Setting the API version per request
  307. You can set the API version on a specific request by sending an `LD-API-Version` header, as shown in the example below:
  308. ```
  309. LD-API-Version: 20191212
  310. ```
  311. The header value is the version number of the API version you'd like to request. The number for each version corresponds to the date the version was released. In the example above the version `20191212` corresponds to December 12, 2019.
  312. ### Setting the API version per access token
  313. When creating an access token, you must specify a specific version of the API to use. This ensures that integrations using this token cannot be broken by version changes.
  314. Tokens created before versioning was released have their version set to `20160426` (the version of the API that existed before versioning) so that they continue working the same way they did before versioning.
  315. If you would like to upgrade your integration to use a new API version, you can explicitly set the header described above.
  316. > ### Best practice: Set the header for every client or integration
  317. >
  318. > We recommend that you set the API version header explicitly in any client or integration you build.
  319. >
  320. > Only rely on the access token API version during manual testing.
  321. contact:
  322. name: LaunchDarkly Technical Support Team
  323. url: https://support.launchdarkly.com
  324. email: support@launchdarkly.com
  325. license:
  326. name: Apache 2.0
  327. url: https://www.apache.org/licenses/LICENSE-2.0
  328. version: '2.0'
  329. servers:
  330. - url: https://app.launchdarkly.com
  331. paths:
  332. "/api/v2":
  333. get:
  334. responses:
  335. '200':
  336. description: Root response
  337. content:
  338. application/json:
  339. schema:
  340. "$ref": "#/components/schemas/RootResponse"
  341. tags:
  342. - Other
  343. summary: Root resource
  344. description: Issue a `GET` request to the root resource to find all of the resource
  345. categories supported by the API
  346. operationId: getRoot
  347. "/api/v2/account/relay-auto-configs":
  348. get:
  349. responses:
  350. '200':
  351. description: Relay auto config response
  352. content:
  353. application/json:
  354. schema:
  355. "$ref": "#/components/schemas/RelayAutoConfigCollectionRep"
  356. '401':
  357. description: Invalid access token
  358. content:
  359. application/json:
  360. schema:
  361. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  362. '403':
  363. description: Forbidden
  364. content:
  365. application/json:
  366. schema:
  367. "$ref": "#/components/schemas/ForbiddenErrorRep"
  368. '429':
  369. description: Rate limited
  370. content:
  371. application/json:
  372. schema:
  373. "$ref": "#/components/schemas/RateLimitedErrorRep"
  374. tags:
  375. - Relay Proxy configurations
  376. summary: List Relay Proxy configs
  377. description: Get a list of Relay Proxy configurations in the account.
  378. operationId: getRelayProxyConfigs
  379. post:
  380. responses:
  381. '201':
  382. description: Relay auto config response
  383. content:
  384. application/json:
  385. schema:
  386. "$ref": "#/components/schemas/RelayAutoConfigRep"
  387. '400':
  388. description: Invalid request
  389. content:
  390. application/json:
  391. schema:
  392. "$ref": "#/components/schemas/InvalidRequestErrorRep"
  393. '401':
  394. description: Invalid access token
  395. content:
  396. application/json:
  397. schema:
  398. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  399. '429':
  400. description: Rate limited
  401. content:
  402. application/json:
  403. schema:
  404. "$ref": "#/components/schemas/RateLimitedErrorRep"
  405. tags:
  406. - Relay Proxy configurations
  407. summary: Create a new Relay Proxy config
  408. description: Create a Relay Proxy config
  409. requestBody:
  410. content:
  411. application/json:
  412. schema:
  413. "$ref": "#/components/schemas/RelayAutoConfigPost"
  414. required: true
  415. operationId: postRelayAutoConfig
  416. "/api/v2/account/relay-auto-configs/{id}":
  417. get:
  418. responses:
  419. '200':
  420. description: Relay auto config response
  421. content:
  422. application/json:
  423. schema:
  424. "$ref": "#/components/schemas/RelayAutoConfigRep"
  425. '401':
  426. description: Invalid access token
  427. content:
  428. application/json:
  429. schema:
  430. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  431. '403':
  432. description: Forbidden
  433. content:
  434. application/json:
  435. schema:
  436. "$ref": "#/components/schemas/ForbiddenErrorRep"
  437. '404':
  438. description: Invalid resource identifier
  439. content:
  440. application/json:
  441. schema:
  442. "$ref": "#/components/schemas/NotFoundErrorRep"
  443. '429':
  444. description: Rate limited
  445. content:
  446. application/json:
  447. schema:
  448. "$ref": "#/components/schemas/RateLimitedErrorRep"
  449. tags:
  450. - Relay Proxy configurations
  451. summary: Get Relay Proxy config
  452. description: Get a single Relay Proxy Auto Config by ID
  453. parameters:
  454. - name: id
  455. in: path
  456. description: The relay auto config id
  457. required: true
  458. schema:
  459. type: string
  460. format: string
  461. description: The relay auto config id
  462. operationId: getRelayProxyConfig
  463. patch:
  464. responses:
  465. '200':
  466. description: Relay auto config response
  467. content:
  468. application/json:
  469. schema:
  470. "$ref": "#/components/schemas/RelayAutoConfigRep"
  471. '400':
  472. description: Invalid request
  473. content:
  474. application/json:
  475. schema:
  476. "$ref": "#/components/schemas/InvalidRequestErrorRep"
  477. '401':
  478. description: Invalid access token
  479. content:
  480. application/json:
  481. schema:
  482. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  483. '404':
  484. description: Invalid resource identifier
  485. content:
  486. application/json:
  487. schema:
  488. "$ref": "#/components/schemas/NotFoundErrorRep"
  489. '409':
  490. description: Status conflict
  491. content:
  492. application/json:
  493. schema:
  494. "$ref": "#/components/schemas/StatusConflictErrorRep"
  495. '422':
  496. description: Invalid patch content
  497. content:
  498. application/json:
  499. schema:
  500. "$ref": "#/components/schemas/PatchFailedErrorRep"
  501. '429':
  502. description: Rate limited
  503. content:
  504. application/json:
  505. schema:
  506. "$ref": "#/components/schemas/RateLimitedErrorRep"
  507. tags:
  508. - Relay Proxy configurations
  509. summary: Update a Relay Proxy config
  510. description: Update a Relay Proxy config.
  511. parameters:
  512. - name: id
  513. in: path
  514. description: The relay auto config id
  515. required: true
  516. schema:
  517. type: string
  518. format: string
  519. description: The relay auto config id
  520. requestBody:
  521. content:
  522. application/json:
  523. schema:
  524. "$ref": "#/components/schemas/PatchWithComment"
  525. required: true
  526. operationId: patchRelayAutoConfig
  527. delete:
  528. responses:
  529. '204':
  530. description: Action succeeded
  531. '401':
  532. description: Invalid access token
  533. content:
  534. application/json:
  535. schema:
  536. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  537. '404':
  538. description: Invalid resource identifier
  539. content:
  540. application/json:
  541. schema:
  542. "$ref": "#/components/schemas/NotFoundErrorRep"
  543. '409':
  544. description: Status conflict
  545. content:
  546. application/json:
  547. schema:
  548. "$ref": "#/components/schemas/StatusConflictErrorRep"
  549. '429':
  550. description: Rate limited
  551. content:
  552. application/json:
  553. schema:
  554. "$ref": "#/components/schemas/RateLimitedErrorRep"
  555. tags:
  556. - Relay Proxy configurations
  557. summary: Delete Relay Proxy config by ID
  558. description: Delete a Relay Proxy config
  559. parameters:
  560. - name: id
  561. in: path
  562. description: The relay auto config id
  563. required: true
  564. schema:
  565. type: string
  566. format: string
  567. description: The relay auto config id
  568. operationId: deleteRelayAutoConfig
  569. "/api/v2/account/relay-auto-configs/{id}/reset":
  570. post:
  571. responses:
  572. '200':
  573. description: Relay auto config response
  574. content:
  575. application/json:
  576. schema:
  577. "$ref": "#/components/schemas/RelayAutoConfigRep"
  578. '401':
  579. description: Invalid access token
  580. content:
  581. application/json:
  582. schema:
  583. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  584. '403':
  585. description: Forbidden
  586. content:
  587. application/json:
  588. schema:
  589. "$ref": "#/components/schemas/ForbiddenErrorRep"
  590. '404':
  591. description: Invalid resource identifier
  592. content:
  593. application/json:
  594. schema:
  595. "$ref": "#/components/schemas/NotFoundErrorRep"
  596. '429':
  597. description: Rate limited
  598. content:
  599. application/json:
  600. schema:
  601. "$ref": "#/components/schemas/RateLimitedErrorRep"
  602. tags:
  603. - Relay Proxy configurations
  604. summary: Reset Relay Proxy configuration key
  605. description: Reset a Relay Proxy configuration's secret key with an optional
  606. expiry time for the old key.
  607. parameters:
  608. - name: id
  609. in: path
  610. description: The Relay Proxy configuration ID
  611. required: true
  612. schema:
  613. type: string
  614. format: string
  615. description: The Relay Proxy configuration ID
  616. - name: expiry
  617. in: query
  618. description: An expiration time for the old Relay Proxy configuration key,
  619. expressed as a Unix epoch time in milliseconds. By default, the Relay Proxy
  620. configuration will expire immediately.
  621. schema:
  622. type: integer
  623. format: int64
  624. description: An expiration time for the old Relay Proxy configuration key,
  625. expressed as a Unix epoch time in milliseconds. By default, the Relay
  626. Proxy configuration will expire immediately.
  627. operationId: resetRelayAutoConfig
  628. "/api/v2/auditlog":
  629. get:
  630. responses:
  631. '200':
  632. description: Audit log entries response
  633. content:
  634. application/json:
  635. schema:
  636. "$ref": "#/components/schemas/AuditLogEntryListingRepCollection"
  637. '400':
  638. description: Invalid request
  639. content:
  640. application/json:
  641. schema:
  642. "$ref": "#/components/schemas/InvalidRequestErrorRep"
  643. '401':
  644. description: Invalid access token
  645. content:
  646. application/json:
  647. schema:
  648. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  649. '403':
  650. description: Forbidden
  651. content:
  652. application/json:
  653. schema:
  654. "$ref": "#/components/schemas/ForbiddenErrorRep"
  655. '429':
  656. description: Rate limited
  657. content:
  658. application/json:
  659. schema:
  660. "$ref": "#/components/schemas/RateLimitedErrorRep"
  661. tags:
  662. - Audit log
  663. summary: List audit log feature flag entries
  664. description: Get a list of all audit log entries. The query parameters let you
  665. restrict the results that return by date ranges, resource specifiers, or a
  666. full-text search query.
  667. parameters:
  668. - name: before
  669. in: query
  670. description: A timestamp filter, expressed as a Unix epoch time in milliseconds. All
  671. entries this returns occurred before the timestamp.
  672. schema:
  673. type: integer
  674. format: int64
  675. description: A timestamp filter, expressed as a Unix epoch time in milliseconds. All
  676. entries this returns occurred before the timestamp.
  677. - name: after
  678. in: query
  679. description: A timestamp filter, expressed as a Unix epoch time in milliseconds.
  680. All entries this returns occurred after the timestamp.
  681. schema:
  682. type: integer
  683. format: int64
  684. description: A timestamp filter, expressed as a Unix epoch time in milliseconds.
  685. All entries this returns occurred after the timestamp.
  686. - name: q
  687. in: query
  688. description: Text to search for. You can search for the full or partial name
  689. of the resource, or full or partial email address of the member who made
  690. a change.
  691. schema:
  692. type: string
  693. format: string
  694. description: Text to search for. You can search for the full or partial
  695. name of the resource, or full or partial email address of the member who
  696. made a change.
  697. - name: limit
  698. in: query
  699. description: A limit on the number of audit log entries that return. Set between
  700. 1 and 20.
  701. schema:
  702. type: integer
  703. format: int64
  704. description: A limit on the number of audit log entries that return. Set
  705. between 1 and 20.
  706. - name: spec
  707. in: query
  708. description: A resource specifier that lets you filter audit log listings
  709. by resource
  710. schema:
  711. type: string
  712. format: string
  713. description: A resource specifier that lets you filter audit log listings
  714. by resource
  715. operationId: getAuditLogEntries
  716. "/api/v2/auditlog/{id}":
  717. get:
  718. responses:
  719. '200':
  720. description: Audit log entry response
  721. content:
  722. application/json:
  723. schema:
  724. "$ref": "#/components/schemas/AuditLogEntryRep"
  725. '401':
  726. description: Invalid access token
  727. content:
  728. application/json:
  729. schema:
  730. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  731. '403':
  732. description: Forbidden
  733. content:
  734. application/json:
  735. schema:
  736. "$ref": "#/components/schemas/ForbiddenErrorRep"
  737. '404':
  738. description: Invalid resource identifier
  739. content:
  740. application/json:
  741. schema:
  742. "$ref": "#/components/schemas/NotFoundErrorRep"
  743. '429':
  744. description: Rate limited
  745. content:
  746. application/json:
  747. schema:
  748. "$ref": "#/components/schemas/RateLimitedErrorRep"
  749. tags:
  750. - Audit log
  751. summary: Get audit log entry
  752. description: |
  753. Fetch a detailed audit log entry representation. The detailed representation includes several fields that are not present in the summary representation:
  754. - `delta`: the JSON patch body that was used in the request to update the entity
  755. - `previousVersion`: a JSON representation of the previous version of the entity
  756. - `currentVersion`: a JSON representation of the current version of the entity
  757. parameters:
  758. - name: id
  759. in: path
  760. description: The ID of the audit log entry
  761. required: true
  762. schema:
  763. type: string
  764. format: string
  765. description: The ID of the audit log entry
  766. operationId: getAuditLogEntry
  767. "/api/v2/code-refs/extinctions":
  768. get:
  769. responses:
  770. '200':
  771. description: Extinction collection response
  772. content:
  773. application/json:
  774. schema:
  775. "$ref": "#/components/schemas/ExtinctionCollectionRep"
  776. '401':
  777. description: Invalid access token
  778. content:
  779. application/json:
  780. schema:
  781. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  782. '403':
  783. description: Forbidden
  784. content:
  785. application/json:
  786. schema:
  787. "$ref": "#/components/schemas/ForbiddenErrorRep"
  788. '429':
  789. description: Rate limited
  790. content:
  791. application/json:
  792. schema:
  793. "$ref": "#/components/schemas/RateLimitedErrorRep"
  794. tags:
  795. - Code references
  796. summary: List extinctions
  797. description: Get a list of all extinctions.
  798. parameters:
  799. - name: repoName
  800. in: query
  801. description: Filter results to a specific repository
  802. schema:
  803. type: string
  804. format: string
  805. description: Filter results to a specific repository
  806. - name: branchName
  807. in: query
  808. description: Filter results to a specific branch. By default, only the default
  809. branch will be queried for extinctions.
  810. schema:
  811. type: string
  812. format: string
  813. description: Filter results to a specific branch. By default, only the default
  814. branch will be queried for extinctions.
  815. - name: projKey
  816. in: query
  817. description: Filter results to a specific project
  818. schema:
  819. type: string
  820. format: string
  821. description: Filter results to a specific project
  822. - name: flagKey
  823. in: query
  824. description: Filter results to a specific flag key
  825. schema:
  826. type: string
  827. format: string
  828. description: Filter results to a specific flag key
  829. - name: from
  830. in: query
  831. description: Filter results to a specific timeframe based on commit time,
  832. expressed as a Unix epoch time in milliseconds. Must be used with `to`.
  833. schema:
  834. type: integer
  835. format: int64
  836. description: Filter results to a specific timeframe based on commit time,
  837. expressed as a Unix epoch time in milliseconds. Must be used with `to`.
  838. - name: to
  839. in: query
  840. description: Filter results to a specific timeframe based on commit time,
  841. expressed as a Unix epoch time in milliseconds. Must be used with `from`.
  842. schema:
  843. type: integer
  844. format: int64
  845. description: Filter results to a specific timeframe based on commit time,
  846. expressed as a Unix epoch time in milliseconds. Must be used with `from`.
  847. operationId: getExtinctions
  848. "/api/v2/code-refs/repositories":
  849. get:
  850. responses:
  851. '200':
  852. description: Repository collection response
  853. content:
  854. application/json:
  855. schema:
  856. "$ref": "#/components/schemas/RepositoryCollectionRep"
  857. '401':
  858. description: Invalid access token
  859. content:
  860. application/json:
  861. schema:
  862. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  863. '403':
  864. description: Forbidden
  865. content:
  866. application/json:
  867. schema:
  868. "$ref": "#/components/schemas/ForbiddenErrorRep"
  869. '429':
  870. description: Rate limited
  871. content:
  872. application/json:
  873. schema:
  874. "$ref": "#/components/schemas/RateLimitedErrorRep"
  875. tags:
  876. - Code references
  877. summary: List repositories
  878. description: Get a list of connected repositories. Optionally, you can include
  879. branch metadata with the `withBranches` query parameter. Embed references
  880. for the default branch with `ReferencesForDefaultBranch`. You can also filter
  881. the list of code references by project key and flag key.
  882. parameters:
  883. - name: withBranches
  884. in: query
  885. description: If set to any value, the endpoint returns repositories with associated
  886. branch data
  887. schema:
  888. type: string
  889. format: string
  890. description: If set to any value, the endpoint returns repositories with
  891. associated branch data
  892. - name: withReferencesForDefaultBranch
  893. in: query
  894. description: If set to any value, the endpoint returns repositories with associated
  895. branch data, as well as code references for the default git branch
  896. schema:
  897. type: string
  898. format: string
  899. description: If set to any value, the endpoint returns repositories with
  900. associated branch data, as well as code references for the default git
  901. branch
  902. - name: projKey
  903. in: query
  904. description: A LaunchDarkly project key. If provided, this filters code reference
  905. results to the specified project.
  906. schema:
  907. type: string
  908. format: string
  909. description: A LaunchDarkly project key. If provided, this filters code
  910. reference results to the specified project.
  911. - name: flagKey
  912. in: query
  913. description: If set to any value, the endpoint returns repositories with associated
  914. branch data, as well as code references for the default git branch
  915. schema:
  916. type: string
  917. format: string
  918. description: If set to any value, the endpoint returns repositories with
  919. associated branch data, as well as code references for the default git
  920. branch
  921. operationId: getRepositories
  922. post:
  923. responses:
  924. '200':
  925. description: Repository response
  926. content:
  927. application/json:
  928. schema:
  929. "$ref": "#/components/schemas/RepositoryRep"
  930. '400':
  931. description: Invalid request
  932. content:
  933. application/json:
  934. schema:
  935. "$ref": "#/components/schemas/InvalidRequestErrorRep"
  936. '401':
  937. description: Invalid access token
  938. content:
  939. application/json:
  940. schema:
  941. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  942. '403':
  943. description: Forbidden
  944. content:
  945. application/json:
  946. schema:
  947. "$ref": "#/components/schemas/ForbiddenErrorRep"
  948. '409':
  949. description: Status conflict
  950. content:
  951. application/json:
  952. schema:
  953. "$ref": "#/components/schemas/StatusConflictErrorRep"
  954. '429':
  955. description: Rate limited
  956. content:
  957. application/json:
  958. schema:
  959. "$ref": "#/components/schemas/RateLimitedErrorRep"
  960. tags:
  961. - Code references
  962. summary: Create repository
  963. description: Create a repository with the specified name.
  964. requestBody:
  965. content:
  966. application/json:
  967. schema:
  968. "$ref": "#/components/schemas/repositoryPost"
  969. required: true
  970. operationId: postRepository
  971. "/api/v2/code-refs/repositories/{repo}":
  972. get:
  973. responses:
  974. '200':
  975. description: Repository response
  976. content:
  977. application/json:
  978. schema:
  979. "$ref": "#/components/schemas/RepositoryRep"
  980. '400':
  981. description: Invalid request
  982. content:
  983. application/json:
  984. schema:
  985. "$ref": "#/components/schemas/InvalidRequestErrorRep"
  986. '401':
  987. description: Invalid access token
  988. content:
  989. application/json:
  990. schema:
  991. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  992. '403':
  993. description: Forbidden
  994. content:
  995. application/json:
  996. schema:
  997. "$ref": "#/components/schemas/ForbiddenErrorRep"
  998. '404':
  999. description: Invalid resource identifier
  1000. content:
  1001. application/json:
  1002. schema:
  1003. "$ref": "#/components/schemas/NotFoundErrorRep"
  1004. '429':
  1005. description: Rate limited
  1006. content:
  1007. application/json:
  1008. schema:
  1009. "$ref": "#/components/schemas/RateLimitedErrorRep"
  1010. tags:
  1011. - Code references
  1012. summary: Get repository
  1013. description: Get a single repository by name.
  1014. parameters:
  1015. - name: repo
  1016. in: path
  1017. description: The repository name
  1018. required: true
  1019. schema:
  1020. type: string
  1021. format: string
  1022. description: The repository name
  1023. operationId: getRepository
  1024. patch:
  1025. responses:
  1026. '200':
  1027. description: Repository response
  1028. content:
  1029. application/json:
  1030. schema:
  1031. "$ref": "#/components/schemas/RepositoryRep"
  1032. '400':
  1033. description: Invalid request
  1034. content:
  1035. application/json:
  1036. schema:
  1037. "$ref": "#/components/schemas/InvalidRequestErrorRep"
  1038. '401':
  1039. description: Invalid access token
  1040. content:
  1041. application/json:
  1042. schema:
  1043. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  1044. '403':
  1045. description: Forbidden
  1046. content:
  1047. application/json:
  1048. schema:
  1049. "$ref": "#/components/schemas/ForbiddenErrorRep"
  1050. '404':
  1051. description: Invalid resource identifier
  1052. content:
  1053. application/json:
  1054. schema:
  1055. "$ref": "#/components/schemas/NotFoundErrorRep"
  1056. '429':
  1057. description: Rate limited
  1058. content:
  1059. application/json:
  1060. schema:
  1061. "$ref": "#/components/schemas/RateLimitedErrorRep"
  1062. tags:
  1063. - Code references
  1064. summary: Update repository
  1065. description: Update a repository's settings. The request must be a valid JSON
  1066. Patch document describing the changes to be made to the repository.
  1067. parameters:
  1068. - name: repo
  1069. in: path
  1070. description: The repository name
  1071. required: true
  1072. schema:
  1073. type: string
  1074. format: string
  1075. description: The repository name
  1076. requestBody:
  1077. content:
  1078. application/json:
  1079. schema:
  1080. "$ref": "#/components/schemas/JSONPatch"
  1081. required: true
  1082. operationId: patchRepository
  1083. delete:
  1084. responses:
  1085. '204':
  1086. description: Action succeeded
  1087. '400':
  1088. description: Invalid request
  1089. content:
  1090. application/json:
  1091. schema:
  1092. "$ref": "#/components/schemas/InvalidRequestErrorRep"
  1093. '401':
  1094. description: Invalid access token
  1095. content:
  1096. application/json:
  1097. schema:
  1098. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  1099. '403':
  1100. description: Forbidden
  1101. content:
  1102. application/json:
  1103. schema:
  1104. "$ref": "#/components/schemas/ForbiddenErrorRep"
  1105. '404':
  1106. description: Invalid resource identifier
  1107. content:
  1108. application/json:
  1109. schema:
  1110. "$ref": "#/components/schemas/NotFoundErrorRep"
  1111. '429':
  1112. description: Rate limited
  1113. content:
  1114. application/json:
  1115. schema:
  1116. "$ref": "#/components/schemas/RateLimitedErrorRep"
  1117. tags:
  1118. - Code references
  1119. summary: Delete repository
  1120. description: Delete a repository with the specified name
  1121. parameters:
  1122. - name: repo
  1123. in: path
  1124. description: The repository name
  1125. required: true
  1126. schema:
  1127. type: string
  1128. format: string
  1129. description: The repository name
  1130. operationId: deleteRepository
  1131. "/api/v2/code-refs/repositories/{repo}/branch-delete-tasks":
  1132. post:
  1133. responses:
  1134. '200':
  1135. description: Action succeeded
  1136. '400':
  1137. description: Invalid request
  1138. content:
  1139. application/json:
  1140. schema:
  1141. "$ref": "#/components/schemas/InvalidRequestErrorRep"
  1142. '401':
  1143. description: Invalid access token
  1144. content:
  1145. application/json:
  1146. schema:
  1147. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  1148. '403':
  1149. description: Forbidden
  1150. content:
  1151. application/json:
  1152. schema:
  1153. "$ref": "#/components/schemas/ForbiddenErrorRep"
  1154. '404':
  1155. description: Invalid resource identifier
  1156. content:
  1157. application/json:
  1158. schema:
  1159. "$ref": "#/components/schemas/NotFoundErrorRep"
  1160. '429':
  1161. description: Rate limited
  1162. content:
  1163. application/json:
  1164. schema:
  1165. "$ref": "#/components/schemas/RateLimitedErrorRep"
  1166. tags:
  1167. - Code references
  1168. summary: Delete branches
  1169. description: Asynchronously delete a number of branches.
  1170. parameters:
  1171. - name: repo
  1172. in: path
  1173. description: The repository name to delete branches for.
  1174. required: true
  1175. schema:
  1176. type: string
  1177. format: string
  1178. description: The repository name to delete branches for.
  1179. requestBody:
  1180. content:
  1181. application/json:
  1182. schema:
  1183. type: array
  1184. items:
  1185. type: string
  1186. required: true
  1187. operationId: deleteBranches
  1188. "/api/v2/code-refs/repositories/{repo}/branches":
  1189. get:
  1190. responses:
  1191. '200':
  1192. description: Branch collection response
  1193. content:
  1194. application/json:
  1195. schema:
  1196. "$ref": "#/components/schemas/BranchCollectionRep"
  1197. '400':
  1198. description: Invalid request
  1199. content:
  1200. application/json:
  1201. schema:
  1202. "$ref": "#/components/schemas/InvalidRequestErrorRep"
  1203. '401':
  1204. description: Invalid access token
  1205. content:
  1206. application/json:
  1207. schema:
  1208. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  1209. '403':
  1210. description: Forbidden
  1211. content:
  1212. application/json:
  1213. schema:
  1214. "$ref": "#/components/schemas/ForbiddenErrorRep"
  1215. '404':
  1216. description: Invalid resource identifier
  1217. content:
  1218. application/json:
  1219. schema:
  1220. "$ref": "#/components/schemas/NotFoundErrorRep"
  1221. '429':
  1222. description: Rate limited
  1223. content:
  1224. application/json:
  1225. schema:
  1226. "$ref": "#/components/schemas/RateLimitedErrorRep"
  1227. tags:
  1228. - Code references
  1229. summary: List branches
  1230. description: Get a list of branches.
  1231. parameters:
  1232. - name: repo
  1233. in: path
  1234. description: The repository name
  1235. required: true
  1236. schema:
  1237. type: string
  1238. format: string
  1239. description: The repository name
  1240. operationId: getBranches
  1241. "/api/v2/code-refs/repositories/{repo}/branches/{branch}":
  1242. get:
  1243. responses:
  1244. '200':
  1245. description: Branch response
  1246. content:
  1247. application/json:
  1248. schema:
  1249. "$ref": "#/components/schemas/BranchRep"
  1250. '400':
  1251. description: Invalid request
  1252. content:
  1253. application/json:
  1254. schema:
  1255. "$ref": "#/components/schemas/InvalidRequestErrorRep"
  1256. '401':
  1257. description: Invalid access token
  1258. content:
  1259. application/json:
  1260. schema:
  1261. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  1262. '403':
  1263. description: Forbidden
  1264. content:
  1265. application/json:
  1266. schema:
  1267. "$ref": "#/components/schemas/ForbiddenErrorRep"
  1268. '404':
  1269. description: Invalid resource identifier
  1270. content:
  1271. application/json:
  1272. schema:
  1273. "$ref": "#/components/schemas/NotFoundErrorRep"
  1274. '429':
  1275. description: Rate limited
  1276. content:
  1277. application/json:
  1278. schema:
  1279. "$ref": "#/components/schemas/RateLimitedErrorRep"
  1280. tags:
  1281. - Code references
  1282. summary: Get branch
  1283. description: Get a specific branch in a repository
  1284. parameters:
  1285. - name: repo
  1286. in: path
  1287. description: The repository name
  1288. required: true
  1289. schema:
  1290. type: string
  1291. format: string
  1292. description: The repository name
  1293. - name: branch
  1294. in: path
  1295. description: The url-encoded branch name
  1296. required: true
  1297. schema:
  1298. type: string
  1299. format: string
  1300. description: The url-encoded branch name
  1301. - name: projKey
  1302. in: query
  1303. description: Filter results to a specific project
  1304. schema:
  1305. type: string
  1306. format: string
  1307. description: Filter results to a specific project
  1308. - name: flagKey
  1309. in: query
  1310. description: Filter results to a specific flag key
  1311. schema:
  1312. type: string
  1313. format: string
  1314. description: Filter results to a specific flag key
  1315. operationId: getBranch
  1316. put:
  1317. responses:
  1318. '200':
  1319. description: Action succeeded
  1320. '400':
  1321. description: Invalid request
  1322. content:
  1323. application/json:
  1324. schema:
  1325. "$ref": "#/components/schemas/InvalidRequestErrorRep"
  1326. '401':
  1327. description: Invalid access token
  1328. content:
  1329. application/json:
  1330. schema:
  1331. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  1332. '403':
  1333. description: Forbidden
  1334. content:
  1335. application/json:
  1336. schema:
  1337. "$ref": "#/components/schemas/ForbiddenErrorRep"
  1338. '404':
  1339. description: Invalid resource identifier
  1340. content:
  1341. application/json:
  1342. schema:
  1343. "$ref": "#/components/schemas/NotFoundErrorRep"
  1344. '409':
  1345. description: Status conflict
  1346. content:
  1347. application/json:
  1348. schema:
  1349. "$ref": "#/components/schemas/StatusConflictErrorRep"
  1350. '429':
  1351. description: Rate limited
  1352. content:
  1353. application/json:
  1354. schema:
  1355. "$ref": "#/components/schemas/RateLimitedErrorRep"
  1356. tags:
  1357. - Code references
  1358. summary: Upsert branch
  1359. description: Create a new branch if it doesn't exist, or updates the branch
  1360. if it already exists.
  1361. parameters:
  1362. - name: repo
  1363. in: path
  1364. description: The repository name
  1365. required: true
  1366. schema:
  1367. type: string
  1368. format: string
  1369. description: The repository name
  1370. - name: branch
  1371. in: path
  1372. description: The url-encoded branch name
  1373. required: true
  1374. schema:
  1375. type: string
  1376. format: string
  1377. description: The url-encoded branch name
  1378. requestBody:
  1379. content:
  1380. application/json:
  1381. schema:
  1382. "$ref": "#/components/schemas/putBranch"
  1383. required: true
  1384. operationId: putBranch
  1385. "/api/v2/code-refs/repositories/{repo}/branches/{branch}/extinction-events":
  1386. post:
  1387. responses:
  1388. '200':
  1389. description: Action succeeded
  1390. '400':
  1391. description: Invalid request
  1392. content:
  1393. application/json:
  1394. schema:
  1395. "$ref": "#/components/schemas/InvalidRequestErrorRep"
  1396. '401':
  1397. description: Invalid access token
  1398. content:
  1399. application/json:
  1400. schema:
  1401. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  1402. '403':
  1403. description: Forbidden
  1404. content:
  1405. application/json:
  1406. schema:
  1407. "$ref": "#/components/schemas/ForbiddenErrorRep"
  1408. '404':
  1409. description: Invalid resource identifier
  1410. content:
  1411. application/json:
  1412. schema:
  1413. "$ref": "#/components/schemas/NotFoundErrorRep"
  1414. '429':
  1415. description: Rate limited
  1416. content:
  1417. application/json:
  1418. schema:
  1419. "$ref": "#/components/schemas/RateLimitedErrorRep"
  1420. tags:
  1421. - Code references
  1422. summary: Create extinction
  1423. description: Create a new extinction
  1424. parameters:
  1425. - name: repo
  1426. in: path
  1427. description: The repository name
  1428. required: true
  1429. schema:
  1430. type: string
  1431. format: string
  1432. description: The repository name
  1433. - name: branch
  1434. in: path
  1435. description: The url-encoded branch name
  1436. required: true
  1437. schema:
  1438. type: string
  1439. format: string
  1440. description: The url-encoded branch name
  1441. requestBody:
  1442. content:
  1443. application/json:
  1444. schema:
  1445. "$ref": "#/components/schemas/ExtinctionListPost"
  1446. required: true
  1447. operationId: postExtinction
  1448. "/api/v2/code-refs/statistics":
  1449. get:
  1450. responses:
  1451. '200':
  1452. description: Statistic root response
  1453. content:
  1454. application/json:
  1455. schema:
  1456. "$ref": "#/components/schemas/StatisticsRoot"
  1457. '401':
  1458. description: Invalid access token
  1459. content:
  1460. application/json:
  1461. schema:
  1462. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  1463. '403':
  1464. description: Forbidden
  1465. content:
  1466. application/json:
  1467. schema:
  1468. "$ref": "#/components/schemas/ForbiddenErrorRep"
  1469. '404':
  1470. description: Invalid resource identifier
  1471. content:
  1472. application/json:
  1473. schema:
  1474. "$ref": "#/components/schemas/NotFoundErrorRep"
  1475. '429':
  1476. description: Rate limited
  1477. content:
  1478. application/json:
  1479. schema:
  1480. "$ref": "#/components/schemas/RateLimitedErrorRep"
  1481. tags:
  1482. - Code references
  1483. summary: Get links to code reference repositories for each project
  1484. description: Get links for all projects that have Code References.
  1485. operationId: getRootStatistic
  1486. "/api/v2/code-refs/statistics/{projKey}":
  1487. get:
  1488. responses:
  1489. '200':
  1490. description: Statistic collection response
  1491. content:
  1492. application/json:
  1493. schema:
  1494. "$ref": "#/components/schemas/StatisticCollectionRep"
  1495. '401':
  1496. description: Invalid access token
  1497. content:
  1498. application/json:
  1499. schema:
  1500. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  1501. '403':
  1502. description: Forbidden
  1503. content:
  1504. application/json:
  1505. schema:
  1506. "$ref": "#/components/schemas/ForbiddenErrorRep"
  1507. '404':
  1508. description: Invalid resource identifier
  1509. content:
  1510. application/json:
  1511. schema:
  1512. "$ref": "#/components/schemas/NotFoundErrorRep"
  1513. '429':
  1514. description: Rate limited
  1515. content:
  1516. application/json:
  1517. schema:
  1518. "$ref": "#/components/schemas/RateLimitedErrorRep"
  1519. tags:
  1520. - Code references
  1521. summary: Get number of code references for flags
  1522. description: 'Get the number of code references across repositories for all
  1523. flags in your project that have code references in the default branch (for
  1524. example: master). You can optionally include the `flagKey` query parameter
  1525. to get the number of code references across repositories for a single flag.
  1526. This endpoint returns the number of times your flag keys are referenced in
  1527. your repositories. You can filter to a single flag with by passing in a flag
  1528. key.'
  1529. parameters:
  1530. - name: projKey
  1531. in: path
  1532. description: The project key
  1533. required: true
  1534. schema:
  1535. type: string
  1536. format: string
  1537. description: The project key
  1538. - name: flagKey
  1539. in: query
  1540. description: Filter results to a specific flag key
  1541. schema:
  1542. type: string
  1543. format: string
  1544. description: Filter results to a specific flag key
  1545. operationId: getStatistics
  1546. "/api/v2/destinations":
  1547. get:
  1548. responses:
  1549. '200':
  1550. description: Destination collection response
  1551. content:
  1552. application/json:
  1553. schema:
  1554. "$ref": "#/components/schemas/Destinations"
  1555. '401':
  1556. description: Invalid access token
  1557. content:
  1558. application/json:
  1559. schema:
  1560. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  1561. '403':
  1562. description: Forbidden
  1563. content:
  1564. application/json:
  1565. schema:
  1566. "$ref": "#/components/schemas/ForbiddenErrorRep"
  1567. '429':
  1568. description: Rate limited
  1569. content:
  1570. application/json:
  1571. schema:
  1572. "$ref": "#/components/schemas/RateLimitedErrorRep"
  1573. tags:
  1574. - Data Export destinations
  1575. summary: List destinations
  1576. description: Get a list of Data Export destinations configured across all projects
  1577. and environments.
  1578. operationId: getDestinations
  1579. "/api/v2/destinations/{projKey}/{envKey}":
  1580. post:
  1581. responses:
  1582. '201':
  1583. description: Destination response
  1584. content:
  1585. application/json:
  1586. schema:
  1587. "$ref": "#/components/schemas/Destination"
  1588. '400':
  1589. description: Invalid request
  1590. content:
  1591. application/json:
  1592. schema:
  1593. "$ref": "#/components/schemas/InvalidRequestErrorRep"
  1594. '401':
  1595. description: Invalid access token
  1596. content:
  1597. application/json:
  1598. schema:
  1599. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  1600. '403':
  1601. description: Forbidden
  1602. content:
  1603. application/json:
  1604. schema:
  1605. "$ref": "#/components/schemas/ForbiddenErrorRep"
  1606. '409':
  1607. description: Status conflict
  1608. content:
  1609. application/json:
  1610. schema:
  1611. "$ref": "#/components/schemas/StatusConflictErrorRep"
  1612. '429':
  1613. description: Rate limited
  1614. content:
  1615. application/json:
  1616. schema:
  1617. "$ref": "#/components/schemas/RateLimitedErrorRep"
  1618. tags:
  1619. - Data Export destinations
  1620. summary: Create data export destination
  1621. description: Create a new destination. The `config` body parameter represents
  1622. the configuration parameters required for a destination type.
  1623. parameters:
  1624. - name: projKey
  1625. in: path
  1626. description: The project key
  1627. required: true
  1628. schema:
  1629. type: string
  1630. format: string
  1631. description: The project key
  1632. - name: envKey
  1633. in: path
  1634. description: The environment key
  1635. required: true
  1636. schema:
  1637. type: string
  1638. format: string
  1639. description: The environment key
  1640. requestBody:
  1641. content:
  1642. application/json:
  1643. schema:
  1644. "$ref": "#/components/schemas/DestinationPost"
  1645. example:
  1646. config:
  1647. project: test-prod
  1648. topic: ld-pubsub-test-192301
  1649. kind: google-pubsub
  1650. required: true
  1651. operationId: postDestination
  1652. "/api/v2/destinations/{projKey}/{envKey}/{id}":
  1653. get:
  1654. responses:
  1655. '200':
  1656. description: Destination response
  1657. content:
  1658. application/json:
  1659. schema:
  1660. "$ref": "#/components/schemas/Destination"
  1661. '401':
  1662. description: Invalid access token
  1663. content:
  1664. application/json:
  1665. schema:
  1666. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  1667. '403':
  1668. description: Forbidden
  1669. content:
  1670. application/json:
  1671. schema:
  1672. "$ref": "#/components/schemas/ForbiddenErrorRep"
  1673. '404':
  1674. description: Invalid resource identifier
  1675. content:
  1676. application/json:
  1677. schema:
  1678. "$ref": "#/components/schemas/NotFoundErrorRep"
  1679. '429':
  1680. description: Rate limited
  1681. content:
  1682. application/json:
  1683. schema:
  1684. "$ref": "#/components/schemas/RateLimitedErrorRep"
  1685. tags:
  1686. - Data Export destinations
  1687. summary: Get destination
  1688. description: Get a single Data Export destination by ID
  1689. parameters:
  1690. - name: projKey
  1691. in: path
  1692. description: The project key
  1693. required: true
  1694. schema:
  1695. type: string
  1696. format: string
  1697. description: The project key
  1698. - name: envKey
  1699. in: path
  1700. description: The environment key
  1701. required: true
  1702. schema:
  1703. type: string
  1704. format: string
  1705. description: The environment key
  1706. - name: id
  1707. in: path
  1708. description: The Data Export destination ID
  1709. required: true
  1710. schema:
  1711. type: string
  1712. format: string
  1713. description: The Data Export destination ID
  1714. operationId: getDestination
  1715. patch:
  1716. responses:
  1717. '200':
  1718. description: Destination response
  1719. content:
  1720. application/json:
  1721. schema:
  1722. "$ref": "#/components/schemas/Destination"
  1723. '400':
  1724. description: Invalid request
  1725. content:
  1726. application/json:
  1727. schema:
  1728. "$ref": "#/components/schemas/InvalidRequestErrorRep"
  1729. '401':
  1730. description: Invalid access token
  1731. content:
  1732. application/json:
  1733. schema:
  1734. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  1735. '403':
  1736. description: Forbidden
  1737. content:
  1738. application/json:
  1739. schema:
  1740. "$ref": "#/components/schemas/ForbiddenErrorRep"
  1741. '404':
  1742. description: Invalid resource identifier
  1743. content:
  1744. application/json:
  1745. schema:
  1746. "$ref": "#/components/schemas/NotFoundErrorRep"
  1747. '409':
  1748. description: Status conflict
  1749. content:
  1750. application/json:
  1751. schema:
  1752. "$ref": "#/components/schemas/StatusConflictErrorRep"
  1753. '429':
  1754. description: Rate limited
  1755. content:
  1756. application/json:
  1757. schema:
  1758. "$ref": "#/components/schemas/RateLimitedErrorRep"
  1759. tags:
  1760. - Data Export destinations
  1761. summary: Update Data Export destination
  1762. description: Update a Data Export destination. This requires a JSON Patch representation
  1763. of the modified destination.
  1764. parameters:
  1765. - name: projKey
  1766. in: path
  1767. description: The project key
  1768. required: true
  1769. schema:
  1770. type: string
  1771. format: string
  1772. description: The project key
  1773. - name: envKey
  1774. in: path
  1775. description: The environment key
  1776. required: true
  1777. schema:
  1778. type: string
  1779. format: string
  1780. description: The environment key
  1781. - name: id
  1782. in: path
  1783. description: The Data Export destination ID
  1784. required: true
  1785. schema:
  1786. type: string
  1787. format: string
  1788. description: The Data Export destination ID
  1789. requestBody:
  1790. content:
  1791. application/json:
  1792. schema:
  1793. "$ref": "#/components/schemas/JSONPatch"
  1794. example:
  1795. - op: replace
  1796. path: "/config/topic"
  1797. value: ld-pubsub-test-192302
  1798. required: true
  1799. operationId: patchDestination
  1800. delete:
  1801. responses:
  1802. '204':
  1803. description: Destination response
  1804. '401':
  1805. description: Invalid access token
  1806. content:
  1807. application/json:
  1808. schema:
  1809. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  1810. '403':
  1811. description: Forbidden
  1812. content:
  1813. application/json:
  1814. schema:
  1815. "$ref": "#/components/schemas/ForbiddenErrorRep"
  1816. '404':
  1817. description: Invalid resource identifier
  1818. content:
  1819. application/json:
  1820. schema:
  1821. "$ref": "#/components/schemas/NotFoundErrorRep"
  1822. '429':
  1823. description: Rate limited
  1824. content:
  1825. application/json:
  1826. schema:
  1827. "$ref": "#/components/schemas/RateLimitedErrorRep"
  1828. tags:
  1829. - Data Export destinations
  1830. summary: Delete Data Export destination
  1831. description: Delete Data Export destination by ID
  1832. parameters:
  1833. - name: projKey
  1834. in: path
  1835. description: The project key
  1836. required: true
  1837. schema:
  1838. type: string
  1839. format: string
  1840. description: The project key
  1841. - name: envKey
  1842. in: path
  1843. description: The environment key
  1844. required: true
  1845. schema:
  1846. type: string
  1847. format: string
  1848. description: The environment key
  1849. - name: id
  1850. in: path
  1851. description: The Data Export destination ID
  1852. required: true
  1853. schema:
  1854. type: string
  1855. format: string
  1856. description: The Data Export destination ID
  1857. operationId: deleteDestination
  1858. "/api/v2/flag-status/{projKey}/{key}":
  1859. get:
  1860. responses:
  1861. '200':
  1862. description: Flag status across environments response
  1863. content:
  1864. application/json:
  1865. schema:
  1866. "$ref": "#/components/schemas/FeatureFlagStatusAcrossEnvironments"
  1867. '401':
  1868. description: Invalid access token
  1869. content:
  1870. application/json:
  1871. schema:
  1872. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  1873. '403':
  1874. description: Forbidden
  1875. content:
  1876. application/json:
  1877. schema:
  1878. "$ref": "#/components/schemas/ForbiddenErrorRep"
  1879. '404':
  1880. description: Invalid resource identifier
  1881. content:
  1882. application/json:
  1883. schema:
  1884. "$ref": "#/components/schemas/NotFoundErrorRep"
  1885. '429':
  1886. description: Rate limited
  1887. content:
  1888. application/json:
  1889. schema:
  1890. "$ref": "#/components/schemas/RateLimitedErrorRep"
  1891. tags:
  1892. - Feature flags
  1893. summary: Get flag status across environments
  1894. description: Get the status for a particular feature flag across environments.
  1895. parameters:
  1896. - name: projKey
  1897. in: path
  1898. description: The project key
  1899. required: true
  1900. schema:
  1901. type: string
  1902. format: string
  1903. description: The project key
  1904. - name: key
  1905. in: path
  1906. description: The feature flag key
  1907. required: true
  1908. schema:
  1909. type: string
  1910. format: string
  1911. description: The feature flag key
  1912. - name: env
  1913. in: query
  1914. description: Optional environment filter
  1915. schema:
  1916. type: string
  1917. format: string
  1918. description: Optional environment filter
  1919. operationId: getFeatureFlagStatusAcrossEnvironments
  1920. "/api/v2/flag-statuses/{projKey}/{envKey}":
  1921. get:
  1922. responses:
  1923. '200':
  1924. description: Flag Statuses collection response
  1925. content:
  1926. application/json:
  1927. schema:
  1928. "$ref": "#/components/schemas/FeatureFlagStatuses"
  1929. '401':
  1930. description: Invalid access token
  1931. content:
  1932. application/json:
  1933. schema:
  1934. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  1935. '403':
  1936. description: Forbidden
  1937. content:
  1938. application/json:
  1939. schema:
  1940. "$ref": "#/components/schemas/ForbiddenErrorRep"
  1941. '404':
  1942. description: Invalid resource identifier
  1943. content:
  1944. application/json:
  1945. schema:
  1946. "$ref": "#/components/schemas/NotFoundErrorRep"
  1947. '429':
  1948. description: Rate limited
  1949. content:
  1950. application/json:
  1951. schema:
  1952. "$ref": "#/components/schemas/RateLimitedErrorRep"
  1953. tags:
  1954. - Feature flags
  1955. summary: List feature flag statuses
  1956. description: |
  1957. Get a list of statuses for all feature flags. The status includes the last time the feature flag was requested, as well as a state, which is one of the following:
  1958. - `new`: the feature flag was created within the last seven days, and has not been requested yet
  1959. - `active`: the feature flag was requested by your servers or clients within the last seven days
  1960. - `inactive`: the feature flag was created more than seven days ago, and hasn't been requested by your servers or clients within the past seven days
  1961. - `launched`: one variation of the feature flag has been rolled out to all your users for at least 7 days
  1962. parameters:
  1963. - name: projKey
  1964. in: path
  1965. description: The project key
  1966. required: true
  1967. schema:
  1968. type: string
  1969. format: string
  1970. description: The project key
  1971. - name: envKey
  1972. in: path
  1973. description: Filter configurations by environment
  1974. required: true
  1975. schema:
  1976. type: string
  1977. format: string
  1978. description: Filter configurations by environment
  1979. operationId: getFeatureFlagStatuses
  1980. "/api/v2/flag-statuses/{projKey}/{envKey}/{key}":
  1981. get:
  1982. responses:
  1983. '200':
  1984. description: Flag status response
  1985. content:
  1986. application/json:
  1987. schema:
  1988. "$ref": "#/components/schemas/FlagStatusRep"
  1989. '401':
  1990. description: Invalid access token
  1991. content:
  1992. application/json:
  1993. schema:
  1994. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  1995. '403':
  1996. description: Forbidden
  1997. content:
  1998. application/json:
  1999. schema:
  2000. "$ref": "#/components/schemas/ForbiddenErrorRep"
  2001. '404':
  2002. description: Invalid resource identifier
  2003. content:
  2004. application/json:
  2005. schema:
  2006. "$ref": "#/components/schemas/NotFoundErrorRep"
  2007. '429':
  2008. description: Rate limited
  2009. content:
  2010. application/json:
  2011. schema:
  2012. "$ref": "#/components/schemas/RateLimitedErrorRep"
  2013. tags:
  2014. - Feature flags
  2015. summary: Get feature flag status
  2016. description: Get the status for a particular feature flag.
  2017. parameters:
  2018. - name: projKey
  2019. in: path
  2020. description: The project key
  2021. required: true
  2022. schema:
  2023. type: string
  2024. format: string
  2025. description: The project key
  2026. - name: envKey
  2027. in: path
  2028. description: The environment key
  2029. required: true
  2030. schema:
  2031. type: string
  2032. format: string
  2033. description: The environment key
  2034. - name: key
  2035. in: path
  2036. description: The feature flag key
  2037. required: true
  2038. schema:
  2039. type: string
  2040. format: string
  2041. description: The feature flag key
  2042. operationId: getFeatureFlagStatus
  2043. "/api/v2/flags/{projKey}":
  2044. get:
  2045. responses:
  2046. '200':
  2047. description: Global flags collection response
  2048. content:
  2049. application/json:
  2050. schema:
  2051. "$ref": "#/components/schemas/FeatureFlags"
  2052. '400':
  2053. description: Invalid request
  2054. content:
  2055. application/json:
  2056. schema:
  2057. "$ref": "#/components/schemas/InvalidRequestErrorRep"
  2058. '401':
  2059. description: Invalid access token
  2060. content:
  2061. application/json:
  2062. schema:
  2063. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  2064. '403':
  2065. description: Forbidden
  2066. content:
  2067. application/json:
  2068. schema:
  2069. "$ref": "#/components/schemas/ForbiddenErrorRep"
  2070. '404':
  2071. description: Invalid resource identifier
  2072. content:
  2073. application/json:
  2074. schema:
  2075. "$ref": "#/components/schemas/NotFoundErrorRep"
  2076. '429':
  2077. description: Rate limited
  2078. content:
  2079. application/json:
  2080. schema:
  2081. "$ref": "#/components/schemas/RateLimitedErrorRep"
  2082. tags:
  2083. - Feature flags
  2084. summary: List feature flags
  2085. description: |
  2086. Get a list of all features in the given project. By default, each feature includes configurations for each environment. You can filter environments with the env query parameter. For example, setting `env=production` restricts the returned configurations to just your production environment. You can also filter feature flags by tag with the tag query parameter.
  2087. We support the following fields for filters:
  2088. - `query` is a string that matches against the flags' keys and names. It is not case sensitive.
  2089. - `archived` is a boolean to filter the list to archived flags. When this is absent, only unarchived flags are returned.
  2090. - `type` is a string allowing filtering to `temporary` or `permanent` flags.
  2091. - `status` is a string allowing filtering to `new`, `inactive`, `active`, or `launched` flags in the specified environment. This filter also requires a `filterEnv` field to be set to a valid environment. For example: `filter=status:active,filterEnv:production`.
  2092. - `tags` is a + separated list of tags. It filters the list to members who have all of the tags in the list.
  2093. - `hasExperiment` is a boolean with values of true or false and returns any flags that have an attached metric.
  2094. - `hasDataExport` is a boolean with values of true or false and returns any flags that are currently exporting data in the specified environment. This includes flags that are exporting data via Experimentation. This filter also requires a `filterEnv` field to be set to a valid environment key. e.g. `filter=hasExperiment:true,filterEnv:production`
  2095. - `evaluated` is an object that contains a key of `after` and a value in Unix time in milliseconds. This returns all flags that have been evaluated since the time you specify in the environment provided. This filter also requires a `filterEnv` field to be set to a valid environment. For example: `filter=evaluated:{"after": 1590768455282},filterEnv:production`.
  2096. - `filterEnv` is a string with the key of a valid environment. The filterEnv field is used for filters that are environment specific. If there are multiple environment specific filters you should only declare this parameter once. For example: `filter=evaluated:{"after": 1590768455282},filterEnv:production,status:active`.
  2097. An example filter is `query:abc,tags:foo+bar`. This matches flags with the string `abc` in their key or name, ignoring case, which also have the tags `foo` and `bar`.
  2098. By default, this returns all flags. You can page through the list with the `limit` parameter and by following the `first`, `prev`, `next`, and `last` links in the returned `_links` field. These links will not be present if the pages they refer to don't exist. For example, the `first` and `prev` links will be missing from the response on the first page.
  2099. parameters:
  2100. - name: projKey
  2101. in: path
  2102. description: The project key
  2103. required: true
  2104. schema:
  2105. type: string
  2106. format: string
  2107. description: The project key
  2108. - name: env
  2109. in: query
  2110. description: Filter configurations by environment
  2111. schema:
  2112. type: string
  2113. format: string
  2114. description: Filter configurations by environment
  2115. - name: tag
  2116. in: query
  2117. description: Filter feature flags by tag
  2118. schema:
  2119. type: string
  2120. format: string
  2121. description: Filter feature flags by tag
  2122. - name: limit
  2123. in: query
  2124. description: The number of feature flags to return. Defaults to -1, which
  2125. returns all flags
  2126. schema:
  2127. type: integer
  2128. format: int64
  2129. description: The number of feature flags to return. Defaults to -1, which
  2130. returns all flags
  2131. - name: offset
  2132. in: query
  2133. description: Where to start in the list. Use this with pagination. For example,
  2134. an offset of 10 skips the first ten items and then returns the next limit
  2135. items
  2136. schema:
  2137. type: integer
  2138. format: int64
  2139. description: Where to start in the list. Use this with pagination. For example,
  2140. an offset of 10 skips the first ten items and then returns the next limit
  2141. items
  2142. - name: archived
  2143. in: query
  2144. description: A boolean to filter the list to archived flags. When this is
  2145. absent, only unarchived flags will be returned
  2146. schema:
  2147. type: boolean
  2148. format: boolean
  2149. description: A boolean to filter the list to archived flags. When this is
  2150. absent, only unarchived flags will be returned
  2151. - name: summary
  2152. in: query
  2153. description: By default in API version >= 1, flags will _not_ include their
  2154. list of prerequisites, targets or rules. Set summary=0 to include these
  2155. fields for each flag returned
  2156. schema:
  2157. type: boolean
  2158. format: boolean
  2159. description: By default in API version >= 1, flags will _not_ include their
  2160. list of prerequisites, targets or rules. Set summary=0 to include these
  2161. fields for each flag returned
  2162. - name: filter
  2163. in: query
  2164. description: A comma-separated list of filters. Each filter is of the form
  2165. field:value
  2166. schema:
  2167. type: string
  2168. format: string
  2169. description: A comma-separated list of filters. Each filter is of the form
  2170. field:value
  2171. - name: sort
  2172. in: query
  2173. description: A comma-separated list of fields to sort by. Fields prefixed
  2174. by a dash ( - ) sort in descending order
  2175. schema:
  2176. type: string
  2177. format: string
  2178. description: A comma-separated list of fields to sort by. Fields prefixed
  2179. by a dash ( - ) sort in descending order
  2180. operationId: getFeatureFlags
  2181. post:
  2182. responses:
  2183. '201':
  2184. description: Global flag response
  2185. content:
  2186. application/json:
  2187. schema:
  2188. "$ref": "#/components/schemas/FeatureFlag"
  2189. '400':
  2190. description: Invalid request
  2191. content:
  2192. application/json:
  2193. schema:
  2194. "$ref": "#/components/schemas/InvalidRequestErrorRep"
  2195. '401':
  2196. description: Invalid access token
  2197. content:
  2198. application/json:
  2199. schema:
  2200. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  2201. '409':
  2202. description: Status conflict
  2203. content:
  2204. application/json:
  2205. schema:
  2206. "$ref": "#/components/schemas/StatusConflictErrorRep"
  2207. '429':
  2208. description: Rate limited
  2209. content:
  2210. application/json:
  2211. schema:
  2212. "$ref": "#/components/schemas/RateLimitedErrorRep"
  2213. tags:
  2214. - Feature flags
  2215. summary: Create a feature flag
  2216. description: Create a feature flag with the given name, key, and variations
  2217. parameters:
  2218. - name: projKey
  2219. in: path
  2220. description: The project key.
  2221. required: true
  2222. schema:
  2223. type: string
  2224. format: string
  2225. description: The project key.
  2226. - name: clone
  2227. in: query
  2228. description: The key of the feature flag to be cloned. The key identifies
  2229. the flag in your code. For example, setting `clone=flagKey` copies the full
  2230. targeting configuration for all environments, including `on/off` state,
  2231. from the original flag to the new flag.
  2232. schema:
  2233. type: string
  2234. format: string
  2235. description: The key of the feature flag to be cloned. The key identifies
  2236. the flag in your code. For example, setting `clone=flagKey` copies the
  2237. full targeting configuration for all environments, including `on/off`
  2238. state, from the original flag to the new flag.
  2239. requestBody:
  2240. content:
  2241. application/json:
  2242. schema:
  2243. "$ref": "#/components/schemas/FeatureFlagBody"
  2244. example:
  2245. key: my-flag
  2246. name: My Flag
  2247. required: true
  2248. operationId: postFeatureFlag
  2249. "/api/v2/flags/{projKey}/{envKey}/{flagKey}/dependent-flags":
  2250. get:
  2251. responses:
  2252. '200':
  2253. description: Dependent flags collection response
  2254. content:
  2255. application/json:
  2256. schema:
  2257. "$ref": "#/components/schemas/DependentFlagsByEnvironment"
  2258. '401':
  2259. description: Invalid access token
  2260. content:
  2261. application/json:
  2262. schema:
  2263. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  2264. '403':
  2265. description: Forbidden
  2266. content:
  2267. application/json:
  2268. schema:
  2269. "$ref": "#/components/schemas/ForbiddenErrorRep"
  2270. '404':
  2271. description: Invalid resource identifier
  2272. content:
  2273. application/json:
  2274. schema:
  2275. "$ref": "#/components/schemas/NotFoundErrorRep"
  2276. '429':
  2277. description: Rate limited
  2278. content:
  2279. application/json:
  2280. schema:
  2281. "$ref": "#/components/schemas/RateLimitedErrorRep"
  2282. tags:
  2283. - Feature flags (beta)
  2284. summary: List dependent feature flags by environment
  2285. description: List dependent flags across all environments for the flag specified
  2286. in the path parameters. A dependent flag is a flag that uses another flag
  2287. as a prerequisite.
  2288. parameters:
  2289. - name: projKey
  2290. in: path
  2291. description: The project key
  2292. required: true
  2293. schema:
  2294. type: string
  2295. format: string
  2296. description: The project key
  2297. - name: envKey
  2298. in: path
  2299. description: The environment key
  2300. required: true
  2301. schema:
  2302. type: string
  2303. format: string
  2304. description: The environment key
  2305. - name: flagKey
  2306. in: path
  2307. description: The flag key
  2308. required: true
  2309. schema:
  2310. type: string
  2311. format: string
  2312. description: The flag key
  2313. operationId: getDependentFlagsByEnv
  2314. "/api/v2/flags/{projKey}/{featureFlagKey}/copy":
  2315. post:
  2316. responses:
  2317. '201':
  2318. description: Global flag response
  2319. content:
  2320. application/json:
  2321. schema:
  2322. "$ref": "#/components/schemas/FeatureFlag"
  2323. '400':
  2324. description: Invalid request
  2325. content:
  2326. application/json:
  2327. schema:
  2328. "$ref": "#/components/schemas/InvalidRequestErrorRep"
  2329. '401':
  2330. description: Invalid access token
  2331. content:
  2332. application/json:
  2333. schema:
  2334. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  2335. '405':
  2336. description: Method not allowed
  2337. content:
  2338. application/json:
  2339. schema:
  2340. "$ref": "#/components/schemas/MethodNotAllowedErrorRep"
  2341. '409':
  2342. description: Status conflict
  2343. content:
  2344. application/json:
  2345. schema:
  2346. "$ref": "#/components/schemas/StatusConflictErrorRep"
  2347. '429':
  2348. description: Rate limited
  2349. content:
  2350. application/json:
  2351. schema:
  2352. "$ref": "#/components/schemas/RateLimitedErrorRep"
  2353. tags:
  2354. - Feature flags
  2355. summary: Copy feature flag
  2356. description: "The includedActions and excludedActions define the parts of the
  2357. flag configuration that are copied or not copied. By default, the entire flag
  2358. configuration is copied.\n\nYou can have either `includedActions` or `excludedActions`
  2359. but not both.\n\nValid `includedActions` and `excludedActions` include:\n\n-
  2360. `updateOn`\n- `updatePrerequisites`\n- `updateTargets`\n- `updateRules`\n-
  2361. `updateFallthrough`\n- `updateOffVariation`\n \n The `source` and `target`
  2362. must be JSON objects if using curl, specifying the environment key and (optional)
  2363. current flag configuration version in that environment. For example:\n\n```json\n{\n
  2364. \ \"key\": \"production\",\n \"currentVersion\": 3\n}\n```\n\nIf target is
  2365. specified as above, the API will test to ensure that the current flag version
  2366. in the `production` environment is `3`, and reject attempts to copy settings
  2367. to `production` otherwise. You can use this to enforce optimistic locking
  2368. on copy attempts.\n"
  2369. parameters:
  2370. - name: projKey
  2371. in: path
  2372. description: The project key.
  2373. required: true
  2374. schema:
  2375. type: string
  2376. format: string
  2377. description: The project key.
  2378. - name: featureFlagKey
  2379. in: path
  2380. description: The feature flag's key. The key identifies the flag in your code.
  2381. required: true
  2382. schema:
  2383. type: string
  2384. format: string
  2385. description: The feature flag's key. The key identifies the flag in your
  2386. code.
  2387. requestBody:
  2388. content:
  2389. application/json:
  2390. schema:
  2391. "$ref": "#/components/schemas/FlagCopyConfigPost"
  2392. required: true
  2393. operationId: copyFeatureFlag
  2394. "/api/v2/flags/{projKey}/{flagKey}/dependent-flags":
  2395. get:
  2396. responses:
  2397. '200':
  2398. description: Multi environment dependent flags collection response
  2399. content:
  2400. application/json:
  2401. schema:
  2402. "$ref": "#/components/schemas/MultiEnvironmentDependentFlags"
  2403. '401':
  2404. description: Invalid access token
  2405. content:
  2406. application/json:
  2407. schema:
  2408. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  2409. '403':
  2410. description: Forbidden
  2411. content:
  2412. application/json:
  2413. schema:
  2414. "$ref": "#/components/schemas/ForbiddenErrorRep"
  2415. '404':
  2416. description: Invalid resource identifier
  2417. content:
  2418. application/json:
  2419. schema:
  2420. "$ref": "#/components/schemas/NotFoundErrorRep"
  2421. '429':
  2422. description: Rate limited
  2423. content:
  2424. application/json:
  2425. schema:
  2426. "$ref": "#/components/schemas/RateLimitedErrorRep"
  2427. tags:
  2428. - Feature flags (beta)
  2429. summary: List dependent feature flags
  2430. description: List dependent flags across all environments for the flag specified
  2431. in the path parameters. A dependent flag is a flag that uses another flag
  2432. as a prerequisite.
  2433. parameters:
  2434. - name: projKey
  2435. in: path
  2436. description: The project key
  2437. required: true
  2438. schema:
  2439. type: string
  2440. format: string
  2441. description: The project key
  2442. - name: flagKey
  2443. in: path
  2444. description: The flag key
  2445. required: true
  2446. schema:
  2447. type: string
  2448. format: string
  2449. description: The flag key
  2450. operationId: getDependentFlags
  2451. "/api/v2/flags/{projKey}/{flagKey}/experiments/{envKey}/{metricKey}":
  2452. get:
  2453. responses:
  2454. '200':
  2455. description: Experiment results response
  2456. content:
  2457. application/json:
  2458. schema:
  2459. "$ref": "#/components/schemas/ExperimentResultsRep"
  2460. '400':
  2461. description: Invalid request
  2462. content:
  2463. application/json:
  2464. schema:
  2465. "$ref": "#/components/schemas/InvalidRequestErrorRep"
  2466. '401':
  2467. description: Invalid access token
  2468. content:
  2469. application/json:
  2470. schema:
  2471. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  2472. '403':
  2473. description: Forbidden
  2474. content:
  2475. application/json:
  2476. schema:
  2477. "$ref": "#/components/schemas/ForbiddenErrorRep"
  2478. '404':
  2479. description: Invalid resource identifier
  2480. content:
  2481. application/json:
  2482. schema:
  2483. "$ref": "#/components/schemas/NotFoundErrorRep"
  2484. '429':
  2485. description: Rate limited
  2486. content:
  2487. application/json:
  2488. schema:
  2489. "$ref": "#/components/schemas/RateLimitedErrorRep"
  2490. tags:
  2491. - Experiments (beta)
  2492. summary: Get experiment results
  2493. description: Get detailed experiment result data
  2494. parameters:
  2495. - name: projKey
  2496. in: path
  2497. description: The project key
  2498. required: true
  2499. schema:
  2500. type: string
  2501. format: string
  2502. description: The project key
  2503. - name: flagKey
  2504. in: path
  2505. description: The flag key
  2506. required: true
  2507. schema:
  2508. type: string
  2509. format: string
  2510. description: The flag key
  2511. - name: envKey
  2512. in: path
  2513. description: The environment key
  2514. required: true
  2515. schema:
  2516. type: string
  2517. format: string
  2518. description: The environment key
  2519. - name: metricKey
  2520. in: path
  2521. description: The metric key
  2522. required: true
  2523. schema:
  2524. type: string
  2525. format: string
  2526. description: The metric key
  2527. - name: from
  2528. in: query
  2529. description: A timestamp denoting the start of the data collection period,
  2530. expressed as a Unix epoch time in milliseconds.
  2531. schema:
  2532. type: integer
  2533. format: int64
  2534. description: A timestamp denoting the start of the data collection period,
  2535. expressed as a Unix epoch time in milliseconds.
  2536. - name: to
  2537. in: query
  2538. description: A timestamp denoting the end of the data collection period, expressed
  2539. as a Unix epoch time in milliseconds.
  2540. schema:
  2541. type: integer
  2542. format: int64
  2543. description: A timestamp denoting the end of the data collection period,
  2544. expressed as a Unix epoch time in milliseconds.
  2545. operationId: getExperiment
  2546. "/api/v2/flags/{projKey}/{flagKey}/experiments/{envKey}/{metricKey}/results":
  2547. delete:
  2548. responses:
  2549. '204':
  2550. description: Experiment results reset successfully
  2551. '401':
  2552. description: Invalid access token
  2553. content:
  2554. application/json:
  2555. schema:
  2556. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  2557. '403':
  2558. description: Forbidden
  2559. content:
  2560. application/json:
  2561. schema:
  2562. "$ref": "#/components/schemas/ForbiddenErrorRep"
  2563. '404':
  2564. description: Invalid resource identifier
  2565. content:
  2566. application/json:
  2567. schema:
  2568. "$ref": "#/components/schemas/NotFoundErrorRep"
  2569. '429':
  2570. description: Rate limited
  2571. content:
  2572. application/json:
  2573. schema:
  2574. "$ref": "#/components/schemas/RateLimitedErrorRep"
  2575. tags:
  2576. - Experiments (beta)
  2577. summary: Reset experiment results
  2578. description: Reset all experiment results by deleting all existing data for
  2579. an experiment
  2580. parameters:
  2581. - name: projKey
  2582. in: path
  2583. description: The project key
  2584. required: true
  2585. schema:
  2586. type: string
  2587. format: string
  2588. description: The project key
  2589. - name: flagKey
  2590. in: path
  2591. description: The feature flag's key
  2592. required: true
  2593. schema:
  2594. type: string
  2595. format: string
  2596. description: The feature flag's key
  2597. - name: envKey
  2598. in: path
  2599. description: The environment key
  2600. required: true
  2601. schema:
  2602. type: string
  2603. format: string
  2604. description: The environment key
  2605. - name: metricKey
  2606. in: path
  2607. description: The metric's key
  2608. required: true
  2609. schema:
  2610. type: string
  2611. format: string
  2612. description: The metric's key
  2613. operationId: resetExperiment
  2614. "/api/v2/flags/{projKey}/{flagKey}/expiring-user-targets/{envKey}":
  2615. get:
  2616. responses:
  2617. '200':
  2618. description: User targeting expirations on feature flag response.
  2619. content:
  2620. application/json:
  2621. schema:
  2622. "$ref": "#/components/schemas/ExpiringUserTargetGetResponse"
  2623. '401':
  2624. description: Invalid access token
  2625. content:
  2626. application/json:
  2627. schema:
  2628. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  2629. '403':
  2630. description: Forbidden
  2631. content:
  2632. application/json:
  2633. schema:
  2634. "$ref": "#/components/schemas/ForbiddenErrorRep"
  2635. '404':
  2636. description: Invalid resource identifier
  2637. content:
  2638. application/json:
  2639. schema:
  2640. "$ref": "#/components/schemas/NotFoundErrorRep"
  2641. '429':
  2642. description: Rate limited
  2643. content:
  2644. application/json:
  2645. schema:
  2646. "$ref": "#/components/schemas/RateLimitedErrorRep"
  2647. tags:
  2648. - Feature flags
  2649. summary: Get expiring user targets for feature flag
  2650. description: Get a list of user targets on a feature flag that are scheduled
  2651. for removal.
  2652. parameters:
  2653. - name: projKey
  2654. in: path
  2655. description: The project key.
  2656. required: true
  2657. schema:
  2658. type: string
  2659. format: string
  2660. description: The project key.
  2661. - name: envKey
  2662. in: path
  2663. description: The environment key.
  2664. required: true
  2665. schema:
  2666. type: string
  2667. format: string
  2668. description: The environment key.
  2669. - name: flagKey
  2670. in: path
  2671. description: The feature flag key.
  2672. required: true
  2673. schema:
  2674. type: string
  2675. format: string
  2676. description: The feature flag key.
  2677. operationId: getExpiringUserTargets
  2678. patch:
  2679. responses:
  2680. '200':
  2681. description: User targeting expirations on feature flag response.
  2682. content:
  2683. application/json:
  2684. schema:
  2685. "$ref": "#/components/schemas/ExpiringUserTargetPatchResponse"
  2686. '400':
  2687. description: Invalid request
  2688. content:
  2689. application/json:
  2690. schema:
  2691. "$ref": "#/components/schemas/InvalidRequestErrorRep"
  2692. '401':
  2693. description: Invalid access token
  2694. content:
  2695. application/json:
  2696. schema:
  2697. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  2698. '403':
  2699. description: Forbidden
  2700. content:
  2701. application/json:
  2702. schema:
  2703. "$ref": "#/components/schemas/ForbiddenErrorRep"
  2704. '404':
  2705. description: Invalid resource identifier
  2706. content:
  2707. application/json:
  2708. schema:
  2709. "$ref": "#/components/schemas/NotFoundErrorRep"
  2710. '429':
  2711. description: Rate limited
  2712. content:
  2713. application/json:
  2714. schema:
  2715. "$ref": "#/components/schemas/RateLimitedErrorRep"
  2716. tags:
  2717. - Feature flags
  2718. summary: Update expiring user targets on feature flag
  2719. description: Update the list of user targets on a feature flag that are scheduled
  2720. for removal.
  2721. parameters:
  2722. - name: projKey
  2723. in: path
  2724. description: The project key.
  2725. required: true
  2726. schema:
  2727. type: string
  2728. format: string
  2729. description: The project key.
  2730. - name: envKey
  2731. in: path
  2732. description: The environment key.
  2733. required: true
  2734. schema:
  2735. type: string
  2736. format: string
  2737. description: The environment key.
  2738. - name: flagKey
  2739. in: path
  2740. description: The feature flag key.
  2741. required: true
  2742. schema:
  2743. type: string
  2744. format: string
  2745. description: The feature flag key.
  2746. requestBody:
  2747. content:
  2748. application/json:
  2749. schema:
  2750. "$ref": "#/components/schemas/PatchWithComment"
  2751. required: true
  2752. operationId: patchExpiringUserTargets
  2753. "/api/v2/flags/{projKey}/{flagKey}/triggers/{envKey}":
  2754. get:
  2755. responses:
  2756. '200':
  2757. description: Flag trigger collection response JSON
  2758. content:
  2759. application/json:
  2760. schema:
  2761. "$ref": "#/components/schemas/TriggerWorkflowCollectionRep"
  2762. '401':
  2763. description: Invalid access token
  2764. content:
  2765. application/json:
  2766. schema:
  2767. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  2768. '403':
  2769. description: Forbidden
  2770. content:
  2771. application/json:
  2772. schema:
  2773. "$ref": "#/components/schemas/ForbiddenErrorRep"
  2774. '429':
  2775. description: Rate limited
  2776. content:
  2777. application/json:
  2778. schema:
  2779. "$ref": "#/components/schemas/RateLimitedErrorRep"
  2780. tags:
  2781. - Flag triggers
  2782. summary: List flag triggers
  2783. description: Get a list of all flag triggers.
  2784. parameters:
  2785. - name: projKey
  2786. in: path
  2787. description: The project key
  2788. required: true
  2789. schema:
  2790. type: string
  2791. format: string
  2792. description: The project key
  2793. - name: envKey
  2794. in: path
  2795. description: The environment key
  2796. required: true
  2797. schema:
  2798. type: string
  2799. format: string
  2800. description: The environment key
  2801. - name: flagKey
  2802. in: path
  2803. description: The flag key
  2804. required: true
  2805. schema:
  2806. type: string
  2807. format: string
  2808. description: The flag key
  2809. operationId: getTriggerWorkflows
  2810. post:
  2811. responses:
  2812. '201':
  2813. description: Successful flag trigger response
  2814. content:
  2815. application/json:
  2816. schema:
  2817. "$ref": "#/components/schemas/TriggerWorkflowRep"
  2818. '400':
  2819. description: Invalid request
  2820. content:
  2821. application/json:
  2822. schema:
  2823. "$ref": "#/components/schemas/InvalidRequestErrorRep"
  2824. '401':
  2825. description: Invalid access token
  2826. content:
  2827. application/json:
  2828. schema:
  2829. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  2830. '403':
  2831. description: Forbidden
  2832. content:
  2833. application/json:
  2834. schema:
  2835. "$ref": "#/components/schemas/ForbiddenErrorRep"
  2836. '404':
  2837. description: Invalid resource identifier
  2838. content:
  2839. application/json:
  2840. schema:
  2841. "$ref": "#/components/schemas/NotFoundErrorRep"
  2842. '429':
  2843. description: Rate limited
  2844. content:
  2845. application/json:
  2846. schema:
  2847. "$ref": "#/components/schemas/RateLimitedErrorRep"
  2848. tags:
  2849. - Flag triggers
  2850. summary: Create flag trigger
  2851. description: Create a new flag trigger. Triggers let you initiate changes to
  2852. flag targeting remotely using a unique webhook URL.
  2853. parameters:
  2854. - name: projKey
  2855. in: path
  2856. description: The project key
  2857. required: true
  2858. schema:
  2859. type: string
  2860. format: string
  2861. description: The project key
  2862. - name: envKey
  2863. in: path
  2864. description: The environment key
  2865. required: true
  2866. schema:
  2867. type: string
  2868. format: string
  2869. description: The environment key
  2870. - name: flagKey
  2871. in: path
  2872. description: The flag key
  2873. required: true
  2874. schema:
  2875. type: string
  2876. format: string
  2877. description: The flag key
  2878. requestBody:
  2879. content:
  2880. application/json:
  2881. schema:
  2882. "$ref": "#/components/schemas/triggerPost"
  2883. required: true
  2884. operationId: createTriggerWorkflow
  2885. "/api/v2/flags/{projKey}/{flagKey}/triggers/{envKey}/{id}":
  2886. get:
  2887. responses:
  2888. '200':
  2889. description: Flag trigger response
  2890. content:
  2891. application/json:
  2892. schema:
  2893. "$ref": "#/components/schemas/TriggerWorkflowRep"
  2894. '401':
  2895. description: Invalid access token
  2896. content:
  2897. application/json:
  2898. schema:
  2899. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  2900. '403':
  2901. description: Forbidden
  2902. content:
  2903. application/json:
  2904. schema:
  2905. "$ref": "#/components/schemas/ForbiddenErrorRep"
  2906. '404':
  2907. description: Invalid resource identifier
  2908. content:
  2909. application/json:
  2910. schema:
  2911. "$ref": "#/components/schemas/NotFoundErrorRep"
  2912. '429':
  2913. description: Rate limited
  2914. content:
  2915. application/json:
  2916. schema:
  2917. "$ref": "#/components/schemas/RateLimitedErrorRep"
  2918. tags:
  2919. - Flag triggers
  2920. summary: Get flag trigger by ID
  2921. description: Get a flag trigger by ID.
  2922. parameters:
  2923. - name: projKey
  2924. in: path
  2925. description: The project key
  2926. required: true
  2927. schema:
  2928. type: string
  2929. format: string
  2930. description: The project key
  2931. - name: flagKey
  2932. in: path
  2933. description: The flag key
  2934. required: true
  2935. schema:
  2936. type: string
  2937. format: string
  2938. description: The flag key
  2939. - name: envKey
  2940. in: path
  2941. description: The environment key
  2942. required: true
  2943. schema:
  2944. type: string
  2945. format: string
  2946. description: The environment key
  2947. - name: id
  2948. in: path
  2949. description: The flag trigger ID
  2950. required: true
  2951. schema:
  2952. type: string
  2953. format: string
  2954. description: The flag trigger ID
  2955. operationId: getTriggerWorkflowById
  2956. patch:
  2957. responses:
  2958. '200':
  2959. description: Flag trigger response
  2960. content:
  2961. application/json:
  2962. schema:
  2963. "$ref": "#/components/schemas/TriggerWorkflowRep"
  2964. '400':
  2965. description: Invalid request
  2966. content:
  2967. application/json:
  2968. schema:
  2969. "$ref": "#/components/schemas/InvalidRequestErrorRep"
  2970. '401':
  2971. description: Invalid access token
  2972. content:
  2973. application/json:
  2974. schema:
  2975. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  2976. '403':
  2977. description: Forbidden
  2978. content:
  2979. application/json:
  2980. schema:
  2981. "$ref": "#/components/schemas/ForbiddenErrorRep"
  2982. '404':
  2983. description: Invalid resource identifier
  2984. content:
  2985. application/json:
  2986. schema:
  2987. "$ref": "#/components/schemas/NotFoundErrorRep"
  2988. '409':
  2989. description: Status conflict
  2990. content:
  2991. application/json:
  2992. schema:
  2993. "$ref": "#/components/schemas/StatusConflictErrorRep"
  2994. '429':
  2995. description: Rate limited
  2996. content:
  2997. application/json:
  2998. schema:
  2999. "$ref": "#/components/schemas/RateLimitedErrorRep"
  3000. tags:
  3001. - Flag triggers
  3002. summary: Update flag trigger
  3003. description: Update a flag trigger. The request body must be a valid JSON patch
  3004. or JSON merge patch document. To learn more, read [Updates](/#section/Overview/Updates).
  3005. parameters:
  3006. - name: projKey
  3007. in: path
  3008. description: The project key
  3009. required: true
  3010. schema:
  3011. type: string
  3012. format: string
  3013. description: The project key
  3014. - name: envKey
  3015. in: path
  3016. description: The environment key
  3017. required: true
  3018. schema:
  3019. type: string
  3020. format: string
  3021. description: The environment key
  3022. - name: flagKey
  3023. in: path
  3024. description: The flag key
  3025. required: true
  3026. schema:
  3027. type: string
  3028. format: string
  3029. description: The flag key
  3030. - name: id
  3031. in: path
  3032. description: The flag trigger ID
  3033. required: true
  3034. schema:
  3035. type: string
  3036. format: string
  3037. description: The flag trigger ID
  3038. requestBody:
  3039. content:
  3040. application/json:
  3041. schema:
  3042. "$ref": "#/components/schemas/FlagTriggerInput"
  3043. required: true
  3044. operationId: patchTriggerWorkflow
  3045. delete:
  3046. responses:
  3047. '204':
  3048. description: Action succeeded
  3049. '400':
  3050. description: Invalid request
  3051. content:
  3052. application/json:
  3053. schema:
  3054. "$ref": "#/components/schemas/InvalidRequestErrorRep"
  3055. '401':
  3056. description: Invalid access token
  3057. content:
  3058. application/json:
  3059. schema:
  3060. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  3061. '403':
  3062. description: Forbidden
  3063. content:
  3064. application/json:
  3065. schema:
  3066. "$ref": "#/components/schemas/ForbiddenErrorRep"
  3067. '404':
  3068. description: Invalid resource identifier
  3069. content:
  3070. application/json:
  3071. schema:
  3072. "$ref": "#/components/schemas/NotFoundErrorRep"
  3073. '429':
  3074. description: Rate limited
  3075. content:
  3076. application/json:
  3077. schema:
  3078. "$ref": "#/components/schemas/RateLimitedErrorRep"
  3079. tags:
  3080. - Flag triggers
  3081. summary: Delete flag trigger
  3082. description: Delete a flag trigger by ID.
  3083. parameters:
  3084. - name: projKey
  3085. in: path
  3086. description: The project key
  3087. required: true
  3088. schema:
  3089. type: string
  3090. format: string
  3091. description: The project key
  3092. - name: envKey
  3093. in: path
  3094. description: The environment key
  3095. required: true
  3096. schema:
  3097. type: string
  3098. format: string
  3099. description: The environment key
  3100. - name: flagKey
  3101. in: path
  3102. description: The flag key
  3103. required: true
  3104. schema:
  3105. type: string
  3106. format: string
  3107. description: The flag key
  3108. - name: id
  3109. in: path
  3110. description: The flag trigger ID
  3111. required: true
  3112. schema:
  3113. type: string
  3114. format: string
  3115. description: The flag trigger ID
  3116. operationId: deleteTriggerWorkflow
  3117. "/api/v2/flags/{projKey}/{key}":
  3118. get:
  3119. responses:
  3120. '200':
  3121. description: Global flag response
  3122. content:
  3123. application/json:
  3124. schema:
  3125. "$ref": "#/components/schemas/FeatureFlag"
  3126. '401':
  3127. description: Invalid access token
  3128. content:
  3129. application/json:
  3130. schema:
  3131. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  3132. '403':
  3133. description: Forbidden
  3134. content:
  3135. application/json:
  3136. schema:
  3137. "$ref": "#/components/schemas/ForbiddenErrorRep"
  3138. '404':
  3139. description: Invalid resource identifier
  3140. content:
  3141. application/json:
  3142. schema:
  3143. "$ref": "#/components/schemas/NotFoundErrorRep"
  3144. '429':
  3145. description: Rate limited
  3146. content:
  3147. application/json:
  3148. schema:
  3149. "$ref": "#/components/schemas/RateLimitedErrorRep"
  3150. tags:
  3151. - Feature flags
  3152. summary: Get feature flag
  3153. description: Get a single feature flag by key. By default, this returns the
  3154. configurations for all environments. You can filter environments with the
  3155. `env` query parameter. For example, setting `env=production` restricts the
  3156. returned configurations to just the `production` environment.
  3157. parameters:
  3158. - name: projKey
  3159. in: path
  3160. description: The project key
  3161. required: true
  3162. schema:
  3163. type: string
  3164. format: string
  3165. description: The project key
  3166. - name: key
  3167. in: path
  3168. description: The feature flag key
  3169. required: true
  3170. schema:
  3171. type: string
  3172. format: string
  3173. description: The feature flag key
  3174. - name: env
  3175. in: query
  3176. description: Filter configurations by environment
  3177. schema:
  3178. type: string
  3179. format: string
  3180. description: Filter configurations by environment
  3181. operationId: getFeatureFlag
  3182. patch:
  3183. responses:
  3184. '200':
  3185. description: Global flag response
  3186. content:
  3187. application/json:
  3188. schema:
  3189. "$ref": "#/components/schemas/FeatureFlag"
  3190. '400':
  3191. description: Invalid request
  3192. content:
  3193. application/json:
  3194. schema:
  3195. "$ref": "#/components/schemas/InvalidRequestErrorRep"
  3196. '401':
  3197. description: Invalid access token
  3198. content:
  3199. application/json:
  3200. schema:
  3201. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  3202. '404':
  3203. description: Invalid resource identifier
  3204. content:
  3205. application/json:
  3206. schema:
  3207. "$ref": "#/components/schemas/NotFoundErrorRep"
  3208. '409':
  3209. description: Status conflict
  3210. content:
  3211. application/json:
  3212. schema:
  3213. "$ref": "#/components/schemas/StatusConflictErrorRep"
  3214. '429':
  3215. description: Rate limited
  3216. content:
  3217. application/json:
  3218. schema:
  3219. "$ref": "#/components/schemas/RateLimitedErrorRep"
  3220. tags:
  3221. - Feature flags
  3222. summary: Update feature flag
  3223. description: |
  3224. Perform a partial update to a feature flag.
  3225. ## Using JSON Patches on a feature flag
  3226. When using the update feature flag endpoint to add individual users to a specific variation, there are two different patch documents, depending on whether users are already being individually targeted for the variation.
  3227. If a flag variation already has users individually targeted, the path for the JSON Patch operation is:
  3228. ```json
  3229. {
  3230. "op": "add",
  3231. "path": "/environments/devint/targets/0/values/-",
  3232. "value": "TestClient10"
  3233. }
  3234. ```
  3235. If a flag variation does not already have users individually targeted, the path for the JSON Patch operation is:
  3236. ```json
  3237. [
  3238. {
  3239. "op": "add",
  3240. "path": "/environments/devint/targets/-",
  3241. "value": { "variation": 0, "values": ["TestClient10"] }
  3242. }
  3243. ]
  3244. ```
  3245. ## Using semantic patches on a feature flag
  3246. To use a [semantic patch](/reference#updates-via-semantic-patches) on a feature flag resource, you must include a header in the request. If you call a semantic patch resource without this header, you will receive a `400` response because your semantic patch will be interpreted as a JSON patch.
  3247. Use this header:
  3248. ```
  3249. Content-Type: application/json; domain-model=launchdarkly.semanticpatch
  3250. ```
  3251. The body of a semantic patch request takes the following three properties:
  3252. 1. comment `string`: (Optional) A description of the update.
  3253. 1. environmentKey `string`: (Required) The key of the LaunchDarkly environment.
  3254. 1. instructions `array`: (Required) The action or list of actions to be performed by the update. Each update action in the list must be an object/hash table with a `kind` property, although depending on the action, other properties may be necessary. Read below for more information on the specific supported semantic patch instructions.
  3255. If any instruction in the patch encounters an error, the error will be returned and the flag will not be changed. In general, instructions will silently do nothing if the flag is already in the state requested by the patch instruction. For example, `removeUserTargets` does nothing when the targets have already been removed). They will generally error if a parameter refers to something that does not exist, like a variation ID that doesn't correspond to a variation on the flag or a rule ID that doesn't belong to a rule on the flag. Other specific error conditions are noted in the instruction descriptions.
  3256. ### Instructions
  3257. #### `turnFlagOn`
  3258. Sets the flag's targeting state to on.
  3259. #### `turnFlagOff`
  3260. Sets the flag's targeting state to off.
  3261. #### `addUserTargets`
  3262. Adds the user keys in `values` to the individual user targets for the variation specified by `variationId`. Returns an error if this causes the same user key to be targeted in multiple variations.
  3263. ##### Parameters
  3264. - `values`: list of user keys
  3265. - `variationId`: ID of a variation on the flag
  3266. #### `removeUserTargets`
  3267. Removes the user keys in `values` to the individual user targets for the variation specified by `variationId`. Does nothing if the user keys are not targeted.
  3268. ##### Parameters
  3269. - `values`: list of user keys
  3270. - `variationId`: ID of a variation on the flag
  3271. #### `replaceUserTargets`
  3272. Completely replaces the existing set of user targeting. All variations must be provided. Example:
  3273. ```json
  3274. {
  3275. "kind": "replaceUserTargets",
  3276. "targets": [
  3277. {
  3278. "variationId": "variation-1",
  3279. "values": ["blah", "foo", "bar"]
  3280. },
  3281. {
  3282. "variationId": "variation-2",
  3283. "values": ["abc", "def"]
  3284. }
  3285. ]
  3286. }
  3287. ```
  3288. ##### Parameters
  3289. - `targets`: a list of user targeting
  3290. #### `clearUserTargets`
  3291. Removes all individual user targets from the variation specified by `variationId`
  3292. ##### Parameters
  3293. - `variationId`: ID of a variation on the flag
  3294. #### `addPrerequisite`
  3295. Adds the flag indicated by `key` with variation `variationId` as a prerequisite to the flag.
  3296. ##### Parameters
  3297. - `key`: flag key of another flag
  3298. - `variationId`: ID of a variation of the flag with key `key`
  3299. #### `removePrerequisite`
  3300. Removes the prerequisite indicated by `key`. Does nothing if this prerequisite does not exist.
  3301. ##### Parameters
  3302. - `key`: flag key of an existing prerequisite
  3303. #### `updatePrerequisite`
  3304. Changes the prerequisite with flag key `key` to the variation indicated by `variationId`. Returns an error if this prerequisite does not exist.
  3305. ##### Parameters
  3306. - `key`: flag key of an existing prerequisite
  3307. - `variationId`: ID of a variation of the flag with key `key`
  3308. #### `replacePrerequisites`
  3309. Completely replaces the existing set of prerequisites for a given flag. Example:
  3310. ```json
  3311. {
  3312. "kind": "replacePrerequisites",
  3313. "prerequisites": [
  3314. {
  3315. "key": "flag-key",
  3316. "variationId": "variation-1"
  3317. },
  3318. {
  3319. "key": "another-flag",
  3320. "variationId": "variation-2"
  3321. }
  3322. ]
  3323. }
  3324. ```
  3325. ##### Parameters
  3326. - `prerequisites`: a list of prerequisites
  3327. #### `addRule`
  3328. Adds a new rule to the flag with the given `clauses` which serves the variation indicated by `variationId` or the percent rollout indicated by `rolloutWeights` and `rolloutBucketBy`. If `beforeRuleId` is set, the rule will be added in the list of rules before the indicated rule. Otherwise, the rule will be added to the end of the list.
  3329. ##### Parameters
  3330. - `clauses`: Array of clauses (see `addClauses`)
  3331. - `beforeRuleId`: Optional ID of a rule in the flag
  3332. - `variationId`: ID of a variation of the flag
  3333. - `rolloutWeights`: Map of variationId to weight in thousandths of a percent (0-100000)
  3334. - `rolloutBucketBy`: Optional user attribute
  3335. #### `removeRule`
  3336. Removes the targeting rule specified by `ruleId`. Does nothing if the rule does not exist.
  3337. ##### Parameters
  3338. - `ruleId`: ID of a rule in the flag
  3339. #### `replaceRules`
  3340. Completely replaces the existing rules for a given flag. Example:
  3341. ```json
  3342. {
  3343. "kind": "replaceRules",
  3344. "rules": [
  3345. {
  3346. "variationId": "variation-1",
  3347. "description": "myRule",
  3348. "clauses": [
  3349. {
  3350. "attribute": "segmentMatch",
  3351. "op": "segmentMatch",
  3352. "values": ["test"]
  3353. }
  3354. ],
  3355. "trackEvents": true
  3356. }
  3357. ]
  3358. }
  3359. ```
  3360. ##### Parameters
  3361. - `rules`: a list of rules
  3362. #### `addClauses`
  3363. Adds the given clauses to the rule indicated by `ruleId`.
  3364. ##### Parameters
  3365. - `ruleId`: ID of a rule in the flag
  3366. - `clauses`: Array of clause objects, with `attribute` (string), `op` (string), and `values` (array of strings, numbers, or dates) properties.
  3367. #### `removeClauses`
  3368. Removes the clauses specified by `clauseIds` from the rule indicated by `ruleId`.
  3369. #### Parameters
  3370. - `ruleId`: ID of a rule in the flag
  3371. - `clauseIds`: Array of IDs of clauses in the rule
  3372. #### `updateClause`
  3373. Replaces the clause indicated by `ruleId` and `clauseId` with `clause`.
  3374. ##### Parameters
  3375. - `ruleId`: ID of a rule in the flag
  3376. - `clauseId`: ID of a clause in that rule
  3377. - `clause`: Clause object
  3378. #### `addValuesToClause`
  3379. Adds `values` to the values of the clause indicated by `ruleId` and `clauseId`.
  3380. ##### Parameters
  3381. - `ruleId`: ID of a rule in the flag
  3382. - `clauseId`: ID of a clause in that rule
  3383. - `values`: Array of strings
  3384. #### `removeValuesFromClause`
  3385. Removes `values` from the values of the clause indicated by `ruleId` and `clauseId`.
  3386. ##### Parameters
  3387. `ruleId`: ID of a rule in the flag
  3388. `clauseId`: ID of a clause in that rule
  3389. `values`: Array of strings
  3390. #### `reorderRules`
  3391. Rearranges the rules to match the order given in `ruleIds`. Will return an error if `ruleIds` does not match the current set of rules on the flag.
  3392. ##### Parameters
  3393. - `ruleIds`: Array of IDs of all rules in the flag
  3394. #### `updateRuleVariationOrRollout`
  3395. Updates what the rule indicated by `ruleId` serves if its clauses evaluate to true.
  3396. Can either be a fixed variation indicated by `variationId` or a percent rollout indicated by `rolloutWeights` and `rolloutBucketBy`.
  3397. ##### Parameters
  3398. - `ruleId`: ID of a rule in the flag
  3399. - `variationId`: ID of a variation of the flag
  3400. or
  3401. - `rolloutWeights`: Map of variationId to weight in thousandths of a percent (0-100000)
  3402. - `rolloutBucketBy`: Optional user attribute
  3403. #### `updateFallthroughVariationOrRollout`
  3404. Updates the flag's fallthrough, which is served if none of the targeting rules match.
  3405. Can either be a fixed variation indicated by `variationId` or a percent rollout indicated by `rolloutWeights` and `rolloutBucketBy`.
  3406. ##### Parameters
  3407. `variationId`: ID of a variation of the flag
  3408. or
  3409. `rolloutWeights`: Map of variationId to weight in thousandths of a percent (0-100000)
  3410. `rolloutBucketBy`: Optional user attribute
  3411. #### `updateOffVariation`
  3412. Updates the variation served when the flag's targeting is off to the variation indicated by `variationId`.
  3413. ##### Parameters
  3414. `variationId`: ID of a variation of the flag
  3415. ### Example
  3416. ```json
  3417. {
  3418. "environmentKey": "production",
  3419. "instructions": [
  3420. {
  3421. "kind": "turnFlagOn"
  3422. },
  3423. {
  3424. "kind": "turnFlagOff"
  3425. },
  3426. {
  3427. "kind": "addUserTargets",
  3428. "variationId": "8bfb304e-d516-47e5-8727-e7f798e8992d",
  3429. "values": ["userId", "userId2"]
  3430. },
  3431. {
  3432. "kind": "removeUserTargets",
  3433. "variationId": "8bfb304e-d516-47e5-8727-e7f798e8992d",
  3434. "values": ["userId3", "userId4"]
  3435. },
  3436. {
  3437. "kind": "updateFallthroughVariationOrRollout",
  3438. "rolloutWeights": {
  3439. "variationId": 50000,
  3440. "variationId2": 50000
  3441. },
  3442. "rolloutBucketBy": null
  3443. },
  3444. {
  3445. "kind": "addRule",
  3446. "clauses": [
  3447. {
  3448. "attribute": "segmentMatch",
  3449. "negate": false,
  3450. "values": ["test-segment"]
  3451. }
  3452. ],
  3453. "variationId": null,
  3454. "rolloutWeights": {
  3455. "variationId": 50000,
  3456. "variationId2": 50000
  3457. },
  3458. "rolloutBucketBy": "key"
  3459. },
  3460. {
  3461. "kind": "removeRule",
  3462. "ruleId": "99f12464-a429-40fc-86cc-b27612188955"
  3463. },
  3464. {
  3465. "kind": "reorderRules",
  3466. "ruleIds": ["2f72974e-de68-4243-8dd3-739582147a1f", "8bfb304e-d516-47e5-8727-e7f798e8992d"]
  3467. },
  3468. {
  3469. "kind": "addClauses",
  3470. "ruleId": "1134",
  3471. "clauses": [
  3472. {
  3473. "attribute": "email",
  3474. "op": "in",
  3475. "negate": false,
  3476. "values": ["test@test.com"]
  3477. }
  3478. ]
  3479. },
  3480. {
  3481. "kind": "removeClauses",
  3482. "ruleId": "1242529",
  3483. "clauseIds": ["8bfb304e-d516-47e5-8727-e7f798e8992d"]
  3484. },
  3485. {
  3486. "kind": "updateClause",
  3487. "ruleId": "2f72974e-de68-4243-8dd3-739582147a1f",
  3488. "clauseId": "309845",
  3489. "clause": {
  3490. "attribute": "segmentMatch",
  3491. "negate": false,
  3492. "values": ["test-segment"]
  3493. }
  3494. },
  3495. {
  3496. "kind": "updateRuleVariationOrRollout",
  3497. "ruleId": "2342",
  3498. "rolloutWeights": null,
  3499. "rolloutBucketBy": null
  3500. },
  3501. {
  3502. "kind": "updateOffVariation",
  3503. "variationId": "3242453"
  3504. },
  3505. {
  3506. "kind": "addPrerequisite",
  3507. "variationId": "234235",
  3508. "key": "flagKey2"
  3509. },
  3510. {
  3511. "kind": "updatePrerequisite",
  3512. "variationId": "234235",
  3513. "key": "flagKey2"
  3514. },
  3515. {
  3516. "kind": "removePrerequisite",
  3517. "key": "flagKey"
  3518. }
  3519. ]
  3520. }
  3521. ```
  3522. ## Using JSON patches on a feature flag
  3523. If you do not include the header described above, you can use [JSON patch](/reference#updates-via-json-patch).
  3524. parameters:
  3525. - name: projKey
  3526. in: path
  3527. description: The project key.
  3528. required: true
  3529. schema:
  3530. type: string
  3531. format: string
  3532. description: The project key.
  3533. - name: key
  3534. in: path
  3535. description: The feature flag's key. The key identifies the flag in your code.
  3536. required: true
  3537. schema:
  3538. type: string
  3539. format: string
  3540. description: The feature flag's key. The key identifies the flag in your
  3541. code.
  3542. requestBody:
  3543. content:
  3544. application/json:
  3545. schema:
  3546. "$ref": "#/components/schemas/PatchWithComment"
  3547. required: true
  3548. operationId: patchFeatureFlag
  3549. delete:
  3550. responses:
  3551. '204':
  3552. description: Action succeeded
  3553. '401':
  3554. description: Invalid access token
  3555. content:
  3556. application/json:
  3557. schema:
  3558. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  3559. '404':
  3560. description: Invalid resource identifier
  3561. content:
  3562. application/json:
  3563. schema:
  3564. "$ref": "#/components/schemas/NotFoundErrorRep"
  3565. '429':
  3566. description: Rate limited
  3567. content:
  3568. application/json:
  3569. schema:
  3570. "$ref": "#/components/schemas/RateLimitedErrorRep"
  3571. tags:
  3572. - Feature flags
  3573. summary: Delete feature flag
  3574. description: 'Delete a feature flag in all environments. Use with caution: only
  3575. delete feature flags your application no longer uses.'
  3576. parameters:
  3577. - name: projKey
  3578. in: path
  3579. description: The project key.
  3580. required: true
  3581. schema:
  3582. type: string
  3583. format: string
  3584. description: The project key.
  3585. - name: key
  3586. in: path
  3587. description: The feature flag's key. The key identifies the flag in your code.
  3588. required: true
  3589. schema:
  3590. type: string
  3591. format: string
  3592. description: The feature flag's key. The key identifies the flag in your
  3593. code.
  3594. operationId: deleteFeatureFlag
  3595. "/api/v2/integrations/{integrationKey}":
  3596. get:
  3597. responses:
  3598. '200':
  3599. description: Successful integrations response
  3600. content:
  3601. application/json:
  3602. schema:
  3603. "$ref": "#/components/schemas/Integrations"
  3604. '401':
  3605. description: Invalid access token
  3606. content:
  3607. application/json:
  3608. schema:
  3609. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  3610. '403':
  3611. description: Forbidden
  3612. content:
  3613. application/json:
  3614. schema:
  3615. "$ref": "#/components/schemas/ForbiddenErrorRep"
  3616. '404':
  3617. description: Invalid resource identifier
  3618. content:
  3619. application/json:
  3620. schema:
  3621. "$ref": "#/components/schemas/NotFoundErrorRep"
  3622. '429':
  3623. description: Rate limited
  3624. content:
  3625. application/json:
  3626. schema:
  3627. "$ref": "#/components/schemas/RateLimitedErrorRep"
  3628. tags:
  3629. - Integration audit log subscriptions
  3630. summary: Get audit log subscriptions by integration
  3631. description: Get all audit log subscriptions associated with a given integration.
  3632. parameters:
  3633. - name: integrationKey
  3634. in: path
  3635. description: The integration key
  3636. required: true
  3637. schema:
  3638. type: string
  3639. format: string
  3640. description: The integration key
  3641. operationId: getSubscriptions
  3642. post:
  3643. responses:
  3644. '201':
  3645. description: Successful integration
  3646. content:
  3647. application/json:
  3648. schema:
  3649. "$ref": "#/components/schemas/Integration"
  3650. '400':
  3651. description: Invalid request
  3652. content:
  3653. application/json:
  3654. schema:
  3655. "$ref": "#/components/schemas/InvalidRequestErrorRep"
  3656. '401':
  3657. description: Invalid access token
  3658. content:
  3659. application/json:
  3660. schema:
  3661. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  3662. '403':
  3663. description: Forbidden
  3664. content:
  3665. application/json:
  3666. schema:
  3667. "$ref": "#/components/schemas/ForbiddenErrorRep"
  3668. '404':
  3669. description: Invalid resource identifier
  3670. content:
  3671. application/json:
  3672. schema:
  3673. "$ref": "#/components/schemas/NotFoundErrorRep"
  3674. '429':
  3675. description: Rate limited
  3676. content:
  3677. application/json:
  3678. schema:
  3679. "$ref": "#/components/schemas/RateLimitedErrorRep"
  3680. tags:
  3681. - Integration audit log subscriptions
  3682. summary: Create audit log subscription
  3683. description: Create an audit log subscription.
  3684. parameters:
  3685. - name: integrationKey
  3686. in: path
  3687. description: The integration key
  3688. required: true
  3689. schema:
  3690. type: string
  3691. format: string
  3692. description: The integration key
  3693. requestBody:
  3694. content:
  3695. application/json:
  3696. schema:
  3697. "$ref": "#/components/schemas/subscriptionPost"
  3698. required: true
  3699. operationId: createSubscription
  3700. "/api/v2/integrations/{integrationKey}/{id}":
  3701. get:
  3702. responses:
  3703. '200':
  3704. description: Successful integrations response
  3705. content:
  3706. application/json:
  3707. schema:
  3708. "$ref": "#/components/schemas/Integration"
  3709. '401':
  3710. description: Invalid access token
  3711. content:
  3712. application/json:
  3713. schema:
  3714. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  3715. '403':
  3716. description: Forbidden
  3717. content:
  3718. application/json:
  3719. schema:
  3720. "$ref": "#/components/schemas/ForbiddenErrorRep"
  3721. '404':
  3722. description: Invalid resource identifier
  3723. content:
  3724. application/json:
  3725. schema:
  3726. "$ref": "#/components/schemas/NotFoundErrorRep"
  3727. '429':
  3728. description: Rate limited
  3729. content:
  3730. application/json:
  3731. schema:
  3732. "$ref": "#/components/schemas/RateLimitedErrorRep"
  3733. tags:
  3734. - Integration audit log subscriptions
  3735. summary: Get audit log subscription by ID
  3736. description: Get an audit log subscription by ID.
  3737. parameters:
  3738. - name: integrationKey
  3739. in: path
  3740. description: The integration key
  3741. required: true
  3742. schema:
  3743. type: string
  3744. format: string
  3745. description: The integration key
  3746. - name: id
  3747. in: path
  3748. description: The subscription ID
  3749. required: true
  3750. schema:
  3751. type: string
  3752. format: string
  3753. description: The subscription ID
  3754. operationId: getSubscriptionByID
  3755. patch:
  3756. responses:
  3757. '200':
  3758. description: Successful
  3759. content:
  3760. application/json:
  3761. schema:
  3762. "$ref": "#/components/schemas/Integration"
  3763. '400':
  3764. description: Invalid request
  3765. content:
  3766. application/json:
  3767. schema:
  3768. "$ref": "#/components/schemas/InvalidRequestErrorRep"
  3769. '403':
  3770. description: Forbidden
  3771. content:
  3772. application/json:
  3773. schema:
  3774. "$ref": "#/components/schemas/ForbiddenErrorRep"
  3775. '404':
  3776. description: Invalid resource identifier
  3777. content:
  3778. application/json:
  3779. schema:
  3780. "$ref": "#/components/schemas/NotFoundErrorRep"
  3781. '409':
  3782. description: Status conflict
  3783. content:
  3784. application/json:
  3785. schema:
  3786. "$ref": "#/components/schemas/StatusConflictErrorRep"
  3787. '429':
  3788. description: Rate limited
  3789. content:
  3790. application/json:
  3791. schema:
  3792. "$ref": "#/components/schemas/RateLimitedErrorRep"
  3793. tags:
  3794. - Integration audit log subscriptions
  3795. summary: Update audit log subscription
  3796. description: Update an audit log subscription configuration. Requires a [JSON
  3797. Patch](https://datatracker.ietf.org/doc/html/rfc6902) representation of the
  3798. desired changes to the audit log subscription.
  3799. parameters:
  3800. - name: integrationKey
  3801. in: path
  3802. description: The integration key
  3803. required: true
  3804. schema:
  3805. type: string
  3806. format: string
  3807. description: The integration key
  3808. - name: id
  3809. in: path
  3810. description: The ID of the audit log subscription
  3811. required: true
  3812. schema:
  3813. type: string
  3814. format: string
  3815. description: The ID of the audit log subscription
  3816. requestBody:
  3817. content:
  3818. application/json:
  3819. schema:
  3820. "$ref": "#/components/schemas/JSONPatch"
  3821. required: true
  3822. operationId: updateSubscription
  3823. delete:
  3824. responses:
  3825. '204':
  3826. description: Action succeeded
  3827. '401':
  3828. description: Invalid access token
  3829. content:
  3830. application/json:
  3831. schema:
  3832. "$ref": "#/components/schemas/UnauthorizedErrorRep"
  3833. '403':
  3834. description: Forbidden
  3835. content:
  3836. application/json:
  3837. schema:
  3838. "$ref": "#/components/schemas/ForbiddenErrorRep"
  3839. '404':
  3840. description: Invalid resource identifier
  3841. content:
  3842. application/json:
  3843. schema:
  3844. "$ref": "#/components/schemas/NotFoundErrorRep"
  3845. '429':
  3846. description: Rate limited
  3847. content:
  3848. application/json:
  3849. schema:
  3850. "$ref": "#/components/schemas/RateLimitedErrorRep"
  3851. tags:
  3852. - Integration audit log subscriptions
  3853. summary: Delete audit log subscription
  3854. description: Delete an audit log subscription.
  3855. parameters:
  3856. - name: integrationKey
  3857. in: path