openapi-directory
Version:
Building & bundling https://github.com/APIs-guru/openapi-directory for easy use from JS
1 lines • 288 kB
JSON
{"openapi":"3.0.3","servers":[{"description":"Rudder server","url":"https://rudder.example.local/rudder/api/latest"}],"info":{"contact":{"email":"dev@rudder.io","name":"Rudder developers","url":"https://www.rudder.io"},"description":"Download OpenAPI specification: [openapi.yml](openapi.yml)\n\n# Introduction\n\nRudder exposes a REST API, enabling the user to interact with Rudder without using the webapp, for example in scripts or cronjobs.\n\n## Versioning\n\nEach time the API is extended with new features (new functions, new parameters, new responses, ...), it will be assigned a new version number. This will allow you\nto keep your existing scripts (based on previous behavior). Versions will always be integers (no 2.1 or 3.3, just 2, 3, 4, ...) or `latest`.\n\nYou can change the version of the API used by setting it either within the url or in a header:\n\n* the URL: each URL is prefixed by its version id, like `/api/version/function`.\n\n```bash\n# Version 10\ncurl -X GET -H \"X-API-Token: yourToken\" https://rudder.example.com/rudder/api/10/rules\n# Latest\ncurl -X GET -H \"X-API-Token: yourToken\" https://rudder.example.com/rudder/api/latest/rules\n# Wrong (not an integer) => 404 not found\ncurl -X GET -H \"X-API-Token: yourToken\" https://rudder.example.com/rudder/api/3.14/rules\n```\n\n* the HTTP headers. You can add the **X-API-Version** header to your request. The value needs to be an integer or `latest`.\n\n```bash\n# Version 10\ncurl -X GET -H \"X-API-Token: yourToken\" -H \"X-API-Version: 10\" https://rudder.example.com/rudder/api/rules\n# Wrong => Error response indicating which versions are available\ncurl -X GET -H \"X-API-Token: yourToken\" -H \"X-API-Version: 3.14\" https://rudder.example.com/rudder/api/rules\n```\n\nIn the future, we may declare some versions as deprecated, in order to remove them in a later version of Rudder, but we will never remove any versions without warning, or without a safe\nperiod of time to allow migration from previous versions.\n\n\n<h4>Existing versions</h4>\n<table>\n <thead>\n <tr>\n <th style=\"width: 20%\">Version</th>\n <th style=\"width: 20%\">Rudder versions it appeared in</th>\n <th style=\"width: 70%\">Description</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td class=\"code\">1</td>\n <td class=\"code\">Never released (for internal use only)</td>\n <td>Experimental version</td>\n </tr>\n <tr>\n <td class=\"code\">2 to 10 (deprecated)</td>\n <td class=\"code\">4.3 and before</td>\n <td>These versions provided the core set of API features for rules, directives, nodes global parameters, change requests and compliance, rudder settings and system API</td>\n </tr>\n <tr>\n <td class=\"code\">11</td>\n <td class=\"code\">5.0</td>\n <td>New system API (replacing old localhost v1 api): status, maintenance operations and server behavior</td>\n </tr>\n <tr>\n <td class=\"code\">12</td>\n <td class=\"code\">6.0 and 6.1</td>\n <td>Node key management</td>\n </tr>\n <tr>\n <td class=\"code\">13</td>\n <td class=\"code\">6.2</td>\n <td><ul>\n <li>Node status endpoint</li>\n <li>System health check</li>\n <li>System maintenance job to purge software [that endpoint was back-ported in 6.1]</li>\n </ul></td>\n </tr>\n <tr>\n <td class=\"code\">14</td>\n <td class=\"code\">7.0</td>\n <td><ul>\n <li>Secret management</li>\n <li>Directive tree</li>\n <li>Improve techniques management</li>\n <li>Demote a relay</li>\n </ul></td>\n </tr>\n <tr>\n <td class=\"code\">15</td>\n <td class=\"code\">7.1</td>\n <td><ul>\n <li>Package updates in nodes</li>\n </ul></td>\n </tr>\n <tr>\n <td class=\"code\">16</td>\n <td class=\"code\">7.2</td>\n <td><ul>\n <li>Create node API included from plugin</li>\n <li>Configuration archive import/export</li>\n </ul></td>\n </tr>\n </tbody>\n</table>\n\n\n## Response format\n\nAll responses from the API are in the JSON format.\n\n```json\n{\n \"action\": \"The name of the called function\",\n \"id\": \"The ID of the element you want, if relevant\",\n \"result\": \"The result of your action: success or error\",\n \"data\": \"Only present if this is a success and depends on the function, it's usually a JSON object\",\n \"errorDetails\": \"Only present if this is an error, it contains the error message\"\n}\n```\n\n\n* __Success__ responses are sent with the 200 HTTP (Success) code\n\n* __Error__ responses are sent with a HTTP error code (mostly 5xx...)\n\n\n## HTTP method\n\nRudder's REST API is based on the usage of [HTTP methods](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html). We use them to indicate what action will be done by the request. Currently, we use four of them:\n\n\n* **GET**: search or retrieve information (get rule details, get a group, ...)\n\n* **PUT**: add new objects (create a directive, clone a Rule, ...)\n\n* **DELETE**: remove objects (delete a node, delete a parameter, ...)\n\n* **POST**: update existing objects (update a directive, reload a group, ...)\n\n\n## Parameters\n\n### General parameters\n\nSome parameters are available for almost all API functions. They will be described in this section.\nThey must be part of the query and can't be submitted in a JSON form.\n\n#### Available for all requests\n\n<table>\n <thead>\n <tr>\n <th style=\"width: 30%\">Field</th>\n <th style=\"width: 10%\">Type</th>\n <th style=\"width: 70%\">Description</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td class=\"code\">prettify</td>\n <td><b>boolean</b><br><i>optional</i></td>\n <td>\n Determine if the answer should be prettified (human friendly) or not. We recommend using this for debugging purposes, but not for general script usage as this does add some unnecessary load on the server side.\n <p class=\"default-value\">Default value: <code>false</code></p>\n </td>\n </tr>\n </tbody>\n</table>\n\n\n#### Available for modification requests (PUT/POST/DELETE)\n\n<table>\n <thead>\n <tr>\n <th style=\"width: 25%\">Field</th>\n <th style=\"width: 12%\">Type</th>\n <th style=\"width: 70%\">Description</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td class=\"code\">reason</td>\n <td><b>string</b><br><i>optional</i> or <i>required</i></td>\n <td>\n Set a message to explain the change. If you set the reason messages to be mandatory in the web interface, failing to supply this value will lead to an error.\n <p class=\"default-value\">Default value: <code>\"\"</code></p>\n </td>\n </tr>\n <tr>\n <td class=\"code\">changeRequestName</td>\n <td><b>string</b><br><i>optional</i></td>\n <td>\n Set the change request name, is used only if workflows are enabled. The default value depends on the function called\n <p class=\"default-value\">Default value: <code>A default string for each function</code></p>\n </td>\n </tr>\n <tr>\n <td class=\"code\">changeRequestDescription</td>\n <td><b>string</b><br><i>optional</i></td>\n <td>\n Set the change request description, is used only if workflows are enabled.\n <p class=\"default-value\">Default value: <code>\"\"</code></p>\n </td>\n </tr>\n </tbody>\n</table>\n\n\n### Passing parameters\n\nParameters to the API can be sent:\n\n* As part of the URL for resource identification\n\n* As data for POST/PUT requests\n\n * Directly in JSON format\n\n * As request arguments\n\n#### As part of the URL for resource identification\n\nParameters in URLs are used to indicate which resource you want to interact with. The function will not work if this resource is missing.\n\n```bash\n# Get the Rule of ID \"id\"\ncurl -H \"X-API-Token: yourToken\" https://rudder.example.com/rudder/api/latest/rules/id\n```\n\n\n\nCAUTION: To avoid surprising behavior, do not put a '/' at the end of an URL: it would be interpreted as '/[empty string parameter]' and redirected to '/index', likely not what you wanted to do.\n\n\n#### Sending data for POST/PUT requests\n\n##### Directly in JSON format\n\nJSON format is the preferred way to interact with Rudder API for creating or updating resources.\nYou'll also have to set the *Content-Type* header to **application/json** (without it the JSON content would be ignored).\nIn a `curl` `POST` request, that header can be provided with the `-H` parameter:\n\n```bash\ncurl -X POST -H \"Content-Type: application/json\" ...\n```\n\nThe supplied file must contain a valid JSON: strings need quotes, booleans and integers don't, etc.\n\nThe (human readable) format is:\n\n```json\n{\n \"key1\": \"value1\",\n \"key2\": false,\n \"key3\": 42\n}\n```\n\n\nHere is an example with inlined data:\n\n```bash\n# Update the Rule 'id' with a new name, disabled, and setting it one directive\ncurl -X POST -H \"X-API-Token: yourToken\" -H \"Content-Type: application/json\"\nhttps://rudder.example.com/rudder/api/rules/latest/{id}\n -d '{ \"displayName\": \"new name\", \"enabled\": false, \"directives\": \"directiveId\"}'\n```\n\nYou can also pass a supply the JSON in a file:\n\n```bash\n# Update the Rule 'id' with a new name, disabled, and setting it one directive\ncurl -X POST -H \"X-API-Token: yourToken\" -H \"Content-Type: application/json\" https://rudder.example.com/rudder/api/rules/latest/{id} -d @jsonParam\n```\n\nNote that the general parameters view in the previous chapter cannot be passed in a JSON, and you will need to pass them a URL parameters if you want them to be taken into account (you can't mix JSON and request parameters):\n\n```bash\n# Update the Rule 'id' with a new name, disabled, and setting it one directive with reason message \"Reason used\"\ncurl -X POST -H \"X-API-Token: yourToken\" -H \"Content-Type: application/json\" \"https://rudder.example.com/rudder/api/rules/latest/{id}?reason=Reason used\" -d @jsonParam -d \"reason=Reason ignored\"\n```\n\n##### Request parameters\n\nIn some cases, when you have little, simple data to update, JSON can feel bloated. In such cases, you can use\nrequest parameters. You will need to pass one parameter for each data you want to change.\n\nParameters follow the following schema:\n\n```\nkey=value\n```\n\nYou can pass parameters by two means:\n\n* As query parameters: At the end of your url, put a **?** then your first parameter and then a **&** before next parameters. In that case, parameters need to be https://en.wikipedia.org/wiki/Percent-encoding[URL encoded]\n\n```bash\n# Update the Rule 'id' with a new name, disabled, and setting it one directive\ncurl -X POST -H \"X-API-Token: yourToken\" https://rudder.example.com/rudder/api/rules/latest/{id}?\"displayName=my new name\"&\"enabled=false\"&\"directives=aDirectiveId\"\n```\n\n* As request data: You can pass those parameters in the request data, they won't figure in the URL, making it lighter to read, You can pass a file that contains data.\n\n```bash\n# Update the Rule 'id' with a new name, disabled, and setting it one directive (in file directive-info.json)\ncurl -X POST -H \"X-API-Token: yourToken\"\nhttps://rudder.example.com/rudder/api/rules/latest/{id} -d \"displayName=my new name\" -d \"enabled=false\" -d @directive-info.json\n```\n","license":{"name":"CC-BY-SA 2.0","url":"https://spdx.org/licenses/CC-BY-SA-2.0.html"},"title":"Rudder API","version":"17","x-apisguru-categories":["developer_tools"],"x-logo":{"url":"https://www.rudder.io/wp-content/uploads/2019/11/color_logo_horizontal_dark_bg-1024x176.png"},"x-origin":[{"format":"openapi","url":"https://docs.rudder.io/api/openapi.yml","version":"3.0"}],"x-providerName":"rudder.example.local"},"externalDocs":{"description":"Learn more about Rudder.","url":"https://docs.rudder.io"},"security":[{"API-Tokens":[]}],"tags":[{"description":"Information about API endpoints and versions","name":"API Info"},{"description":"Is alive check","name":"Status"},{"description":"Access compliance data","name":"Compliance"},{"description":"Rules management","name":"Rules"},{"description":"Directives management","name":"Directives"},{"description":"Techniques management","name":"Techniques"},{"description":"Groups management","name":"Groups"},{"description":"Nodes management","name":"Nodes"},{"description":"Inventory processing service","name":"Inventories"},{"description":"Global parameters","name":"Parameters"},{"description":"Campaigns","name":"Campaigns"},{"description":"Import and export zip of policies","name":"Archives"},{"description":"Server configuration","name":"Settings"},{"description":"Internal components and administration","name":"System"},{"description":"**Requires that the `changes-validation` plugin is installed on the server.**\n\nManage change requests.","name":"🧩 Change requests"},{"description":"**Requires that the `cve` plugin is installed on the server.**\n\nManage CVE plugins data and configuration.","name":"🧩 CVE"},{"description":"**Requires that the `system update` plugin is installed on the server.**\n\nFetch System update campaigns results.","name":"🧩 System update campaigns"},{"description":"**Requires that the `datasources` plugin is installed on the server.**\n\nData sources plugin configuration.","name":"🧩 Data sources"},{"description":"**Requires that the `scale-out-relay` plugin is installed on the server.**\n\nManage relays.","name":"🧩 Scale out Relay"},{"description":"**Requires that the `user-management` plugin is installed on the server.**\n\nManage users settings and configuration file.","name":"🧩 User Management"},{"description":"**Requires that the `branding` plugin is installed on the server.**\n\nManage web interface customization.","name":"🧩 Branding"},{"description":"**Requires that the `secret-management` plugin is installed on the server.**\n\nManage secrets variables.","name":"🧩 Secret Management"}],"paths":{"/api/changeRequests":{"get":{"description":"List all change requests","operationId":"listChangeRequests","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"action":{"description":"The id of the action","enum":["listChangeRequests"],"type":"string"},"data":{"properties":{"rules":{"items":{"$ref":"#/components/schemas/change-request"},"type":"array"}},"required":["rules"],"type":"object"},"result":{"description":"Result of the request","enum":["success","error"],"type":"string"}},"required":["result","action","data"],"type":"object"}}},"description":"Change requests information"}},"summary":"List all change requests","tags":["🧩 Change requests"],"x-codeSamples":[{"lang":"curl","source":"curl --header \"X-API-Token: yourToken\" --request GET https://rudder.example.com/rudder/api/latest/changeRequests --data \"status=open\"\n"}]}},"/archives/export":{"get":{"description":"Get a ZIP archive or rules, directives, techniques and groups with optionally their dependencies","operationId":"export","parameters":[{"description":"IDs (optionally with revision, '+' need to be escaped as '%2B') of rules to include","examples":{"multipleIds":{"summary":"Example of multiple IDs, some with revisions","value":["a0573b59-e5bd-441b-9031-f307aa21a61e","4cba6eee-3a43-4e17-a608-a4941b6d984f%2B35177d0823791a374de9e16a6ab27e6466fbc8c2"]},"oneId":{"summary":"Example of a single ID","value":["a0573b59-e5bd-441b-9031-f307aa21a61e"]}},"explode":false,"in":"query","name":"rules","schema":{"items":{"type":"string"},"type":"array"},"style":"form"},{"description":"IDs (optionally with revision, '+' need to be escaped as '%2B') of directives to include","examples":{"multipleIds":{"summary":"Example of multiple IDs, some with revisions","value":["a0573b59-e5bd-441b-9031-f307aa21a61e","4cba6eee-3a43-4e17-a608-a4941b6d984f%2B35177d0823791a374de9e16a6ab27e6466fbc8c2"]},"oneId":{"summary":"Example of a single ID","value":["a0573b59-e5bd-441b-9031-f307aa21a61e"]}},"explode":false,"in":"query","name":"directives","schema":{"items":{"type":"string"},"type":"array"},"style":"form"},{"description":"IDs, ie technique name/technique version (optionally with revision, '+' need to be escaped as '%2B') of techniques to include","examples":{"multipleIds":{"summary":"Example of multiple IDs, some with revisions","value":["userManagement/6.3","fileContent/3.0%2B35177d0823791a374de9e16a6ab27e6466fbc8c2"]},"oneId":{"summary":"Example of a single ID","value":["fileContent/3.0"]}},"explode":false,"in":"query","name":"techniques","schema":{"items":{"type":"string"},"type":"array"},"style":"form"},{"description":"IDs (optionally with revision, '+' need to be escaped as '%2B') of groups to include","examples":{"multipleIds":{"summary":"Example of multiple IDs, some with revisions","value":["a0573b59-e5bd-441b-9031-f307aa21a61e","4cba6eee-3a43-4e17-a608-a4941b6d984f%2B35177d0823791a374de9e16a6ab27e6466fbc8c2"]},"oneId":{"summary":"Example of a single ID","value":["a0573b59-e5bd-441b-9031-f307aa21a61e"]}},"explode":false,"in":"query","name":"groups","schema":{"items":{"type":"string"},"type":"array"},"style":"form"},{"description":"Scope of dependencies to include in archive, where rule as directives and groups dependencies, directives have techniques dependencies, and techniques and groups don't have dependencies. 'none' means no dependencies will be include, 'all' means that the whole tree will, 'directives' and 'groups' means to include them specifically, 'techniques' means to include both directives and techniques.","examples":{"directivesAndGroups":{"summary":"Include directives and groups, but no techniques","value":["directives","groups"]},"none":{"summary":"Do not include dependencies","value":["none"]}},"explode":false,"in":"query","name":"include","schema":{"items":{"enum":["all (default)","none","directives","techniques","groups"],"type":"string"},"type":"array"},"style":"form"}],"responses":{"200":{"content":{"application/octet-stream":{"schema":{"format":"binary","type":"string"}}},"description":"A zip archive with the queried content."}},"summary":"Get a ZIP archive of the requested items and their dependencies","tags":["Archives"],"x-codeSamples":[{"lang":"curl","source":"curl --header \"X-API-Token: yourToken\" https://rudder.example.com/rudder/api/latest/archives/export?rules=8e522a3e-aa45-43cd-bf33-4e8d04a566f6&include=directives,groups"}]}},"/archives/import":{"post":{"description":"Import a ZIP archive of techniques, directives, groups and rules in a saved in a normalized format into Rudder","operationId":"import","requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"archive":{"description":"The ZIP archive file containing policies in a conventional layout and serialization format","format":"binary","type":"string"},"merge":{"description":"Optional merge algo of the import. Default `override-all` means what is in the archive is the new reality. `keep-rule-groups` will keep existing target definition for existing rules (ignore archive value).","enum":["override-all","keep-rule-groups"],"type":"string"}},"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"action":{"description":"The id of the action","enum":["import"],"type":"string"},"data":{"description":"Details about archive import process","properties":{"archiveImported":{"type":"boolean"}},"type":"object"},"result":{"description":"Result of the request","enum":["success","error"],"type":"string"}},"required":["result","action","data"],"type":"object"}}},"description":"Archive imported"}},"summary":"Import a ZIP archive of policies into Rudder","tags":["Archives"],"x-codeSamples":[{"lang":"curl","source":"curl --header \"X-API-Token: yourToken\" -X POST https://rudder.example.com/rudder/api/latest/archives/import --form \"archive=@my-archive-file.zip\" --form \"merge=keep-rule-groups\""}]}},"/branding":{"get":{"description":"Get all web interface customization parameters","operationId":"getBrandingConf","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"action":{"description":"The id of the action","enum":["getBrandingConf"],"type":"string"},"data":{"properties":{"branding":{"$ref":"#/components/schemas/branding-conf"}},"required":["branding"],"type":"object"},"result":{"description":"Result of the request","enum":["success","error"],"type":"string"}},"required":["result","action","data"],"type":"object"}}},"description":"Branding configuration"}},"summary":"Get branding configuration","tags":["🧩 Branding"],"x-codeSamples":[{"lang":"curl","source":"curl --header \"X-API-Token: yourToken\" --request GET https://rudder.example.com/rudder/api/latest/branding\n"}]},"post":{"description":"change color, logo, label etc.","operationId":"updateBRandingConf","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/branding-conf"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"action":{"description":"The id of the action","enum":["updateBRandingConf"],"type":"string"},"data":{"properties":{"branding":{"$ref":"#/components/schemas/branding-conf"}},"required":["branding"],"type":"object"},"result":{"description":"Result of the request","enum":["success","error"],"type":"string"}},"required":["result","action","data"],"type":"object"}}},"description":"Updated"}},"summary":"Update web interface customization","tags":["🧩 Branding"],"x-codeSamples":[{"lang":"curl","source":"update.json:\n\n{\n\t\"displayBar\":true,\n\t\"displayLabel\":false,\n\t\"labelText\":\"Production\",\n\t\"barColor\":{\n\t\t\"red\":1,\n\t\t\"blue\":1,\n\t\t\"green\":1,\n\t\t\"alpha\":1\n\t},\n\t\"labelColor\":{\n\t\t\"red\":0,\n\t\t\"blue\":0,\n\t\t\"green\":0,\n\t\t\"alpha\":1\n\t},\n\t\"wideLogo\":{\n\t\t\"enable\":true\n\t},\n\t\"smallLogo\":{\n\t\t\"enable\":true\n\t},\n\t\"displayBarLogin\":true,\n\t\"displayMotd\":true,\n\t\"motd\":\"Welcome, please sign in:\"\n}\n\ncurl --header \"X-API-Token: yourToken\" --request POST https://rudder.example.com/rudder/api/latest/branding --header \"Content-type: application/json\" --data @update.json\n\n"}]}},"/branding/reload":{"post":{"description":"Reload the configuration from file","operationId":"reloadBrandingConf","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"action":{"description":"The id of the action","enum":["getBrandingConf"],"type":"string"},"data":{"properties":{"branding":{"$ref":"#/components/schemas/branding-conf"}},"required":["branding"],"type":"object"},"result":{"description":"Result of the request","enum":["success","error"],"type":"string"}},"required":["result","action","data"],"type":"object"}}},"description":"Branding configuration"}},"summary":"Reload branding file","tags":["🧩 Branding"],"x-codeSamples":[{"lang":"curl","source":"curl --header \"X-API-Token: yourToken\" --request POST https://rudder.example.com/rudder/api/latest/branding/reload\n"}]}},"/campaigns":{"get":{"description":"Get all campaigns details","operationId":"allCampaigns","parameters":[{"$ref":"#/components/parameters/campaign-type"},{"$ref":"#/components/parameters/campaign-status"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"action":{"description":"The id of the action","enum":["allCampaigns"],"type":"string"},"data":{"properties":{"campaigns":{"items":{"$ref":"#/components/schemas/campaign-details"},"type":"array"}},"required":["campaigns"],"type":"object"},"result":{"description":"Result of the request","enum":["success","error"],"type":"string"}},"required":["result","action","data"],"type":"object"}}},"description":"Campaign details result"}},"summary":"Get all campaigns details","tags":["Campaigns"],"x-codeSamples":[{"lang":"curl","source":"curl --header \"X-API-Token: yourToken\" --request GET 'https://rudder.example.com/rudder/api/latest/campaigns'\n"}]},"post":{"description":"Save a campaign details","operationId":"saveCampaign","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/campaign-details"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"action":{"description":"The id of the action","enum":["saveCampaign"],"type":"string"},"data":{"properties":{"campaigns":{"items":{"$ref":"#/components/schemas/campaign-details"},"type":"array"}},"required":["campaigns"],"type":"object"},"result":{"description":"Result of the request","enum":["success","error"],"type":"string"}},"required":["result","action","data"],"type":"object"}}},"description":"Campaign details result"}},"summary":"Save a campaign","tags":["Campaigns"],"x-codeSamples":[{"lang":"curl","source":"curl --header \"X-API-Token: yourToken\" --request POST 'https://rudder.example.com/rudder/api/latest/campaigns'\n"}]}},"/campaigns/events":{"get":{"description":"Get all campaign events","operationId":"getAllCampaignEvents","parameters":[{"$ref":"#/components/parameters/campaign-type"},{"$ref":"#/components/parameters/campaign-event-status"},{"$ref":"#/components/parameters/campaign-id"},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/offset"},{"$ref":"#/components/parameters/before"},{"$ref":"#/components/parameters/after"},{"$ref":"#/components/parameters/order"},{"$ref":"#/components/parameters/asc"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"action":{"description":"The id of the action","enum":["getCampaignEvent"],"type":"string"},"data":{"properties":{"campaignEvents":{"items":{"$ref":"#/components/schemas/campaign-event-details"},"type":"array"}},"required":["campaignEvents"],"type":"object"},"result":{"description":"Result of the request","enum":["success","error"],"type":"string"}},"required":["result","action","data"],"type":"object"}}},"description":"Campaign event details result"}},"summary":"Get all campaign events","tags":["Campaigns"],"x-codeSamples":[{"lang":"curl","source":"curl --header \"X-API-Token: yourToken\" --request GET 'https://rudder.example.com/rudder/api/latest/campaigns/0076a379-f32d-4732-9e91-33ab219d8fde/events'\n"}]}},"/campaigns/events/{id}":{"delete":{"description":"Delete a campaign event details","operationId":"deleteCampaignEvent","parameters":[{"$ref":"#/components/parameters/campaign-event-id-path"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"action":{"description":"The id of the action","enum":["deleteCampaignEvent"],"type":"string"},"data":{"properties":{"campaignEvents":{"items":{"$ref":"#/components/schemas/campaign-event-details"},"type":"array"}},"required":["campaignEvents"],"type":"object"},"result":{"description":"Result of the request","enum":["success","error"],"type":"string"}},"required":["result","action","data"],"type":"object"}}},"description":"Campaign event details result"}},"summary":"Delete a campaign event details","tags":["Campaigns"],"x-codeSamples":[{"lang":"curl","source":"curl --header \"X-API-Token: yourToken\" --request DELETE 'https://rudder.example.com/rudder/api/latest/campaigns/events/0076a379-f32d-4732-9e91-33ab219d8fde'\n"}]},"get":{"description":"Get a campaign event details","operationId":"getCampaignEvent","parameters":[{"$ref":"#/components/parameters/campaign-event-id-path"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"action":{"description":"The id of the action","enum":["getCampaignEvent"],"type":"string"},"data":{"properties":{"campaignEvents":{"items":{"$ref":"#/components/schemas/campaign-event-details"},"type":"array"}},"required":["campaignEvents"],"type":"object"},"result":{"description":"Result of the request","enum":["success","error"],"type":"string"}},"required":["result","action","data"],"type":"object"}}},"description":"Campaign details result"}},"summary":"Get a campaign event details","tags":["Campaigns"],"x-codeSamples":[{"lang":"curl","source":"curl --header \"X-API-Token: yourToken\" --request GET 'https://rudder.example.com/rudder/api/latest/campaigns/events/0076a379-f32d-4732-9e91-33ab219d8fde'\n"}]},"post":{"description":"Update an existing event","operationId":"saveCampaignEvent","parameters":[{"$ref":"#/components/parameters/campaign-event-id-path"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"action":{"description":"The id of the action","enum":["saveCampaignEvent"],"type":"string"},"data":{"properties":{"campaignEvents":{"items":{"$ref":"#/components/schemas/campaign-event-details"},"type":"array"}},"required":["campaignEvents"],"type":"object"},"result":{"description":"Result of the request","enum":["success","error"],"type":"string"}},"required":["result","action","data"],"type":"object"}}},"description":"Campaign event details result"}},"summary":"Update an existing event","tags":["Campaigns"],"x-codeSamples":[{"lang":"curl","source":"curl --header \"X-API-Token: yourToken\" --request POST 'https://rudder.example.com/rudder/api/latest/campaigns/events/0076a379-f32d-4732-9e91-33ab219d8fde'\n"}]}},"/campaigns/{id}":{"delete":{"description":"Delete a campaign","operationId":"deleteCampaign","parameters":[{"$ref":"#/components/parameters/campaign-id-path"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"action":{"description":"The id of the action","enum":["deleteCampaign"],"type":"string"},"data":{"properties":{"campaigns":{"items":{"$ref":"#/components/schemas/campaign-details"},"type":"array"}},"required":["campaigns"],"type":"object"},"result":{"description":"Result of the request","enum":["success","error"],"type":"string"}},"required":["result","action","data"],"type":"object"}}},"description":"Campaign details result"}},"summary":"Delete a campaign","tags":["Campaigns"],"x-codeSamples":[{"lang":"curl","source":"curl --header \"X-API-Token: yourToken\" --request DELETE 'https://rudder.example.com/rudder/api/latest/campaigns/0076a379-f32d-4732-9e91-33ab219d8fde'\n"}]},"get":{"description":"Get a campaign details","operationId":"getCampaign","parameters":[{"$ref":"#/components/parameters/campaign-id-path"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"action":{"description":"The id of the action","enum":["getCampaign"],"type":"string"},"data":{"properties":{"campaigns":{"items":{"$ref":"#/components/schemas/campaign-details"},"type":"array"}},"required":["campaigns"],"type":"object"},"result":{"description":"Result of the request","enum":["success","error"],"type":"string"}},"required":["result","action","data"],"type":"object"}}},"description":"Campaign details result"}},"summary":"Get a campaign details","tags":["Campaigns"],"x-codeSamples":[{"lang":"curl","source":"curl --header \"X-API-Token: yourToken\" --request GET 'https://rudder.example.com/rudder/api/latest/campaigns/0076a379-f32d-4732-9e91-33ab219d8fde'\n"}]}},"/campaigns/{id}/events":{"get":{"description":"Get campaign events for a campaign","operationId":"getEventsCampaign","parameters":[{"$ref":"#/components/parameters/campaign-id-path"},{"$ref":"#/components/parameters/campaign-type"},{"$ref":"#/components/parameters/campaign-event-status"},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/offset"},{"$ref":"#/components/parameters/before"},{"$ref":"#/components/parameters/after"},{"$ref":"#/components/parameters/order"},{"$ref":"#/components/parameters/asc"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"action":{"description":"The id of the action","enum":["getEventsCampaign"],"type":"string"},"data":{"properties":{"campaignEvents":{"items":{"$ref":"#/components/schemas/campaign-event-details"},"type":"array"}},"required":["campaignEvents"],"type":"object"},"result":{"description":"Result of the request","enum":["success","error"],"type":"string"}},"required":["result","action","data"],"type":"object"}}},"description":"Campaign details result"}},"summary":"Get campaign events for a campaign","tags":["Campaigns"],"x-codeSamples":[{"lang":"curl","source":"curl --header \"X-API-Token: yourToken\" --request POST 'https://rudder.example.com/rudder/api/latest/campaigns/0076a379-f32d-4732-9e91-33ab219d8fde/events'\n"}]}},"/campaigns/{id}/schedule":{"post":{"description":"Schedule a campaign event for a campaign","operationId":"scheduleCampaign","parameters":[{"$ref":"#/components/parameters/campaign-id-path"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"action":{"description":"The id of the action","enum":["scheduleCampaign"],"type":"string"},"data":{"properties":{"campaignEvents":{"items":{"$ref":"#/components/schemas/campaign-event-details"},"type":"array"}},"required":["campaignEvents"],"type":"object"},"result":{"description":"Result of the request","enum":["success","error"],"type":"string"}},"required":["result","action","data"],"type":"object"}}},"description":"Campaign events details result"}},"summary":"Schedule a campaign event for a campaign","tags":["Campaigns"],"x-codeSamples":[{"lang":"curl","source":"curl --header \"X-API-Token: yourToken\" --request POST 'https://rudder.example.com/rudder/api/latest/campaigns/0076a379-f32d-4732-9e91-33ab219d8fde/schedule'\n"}]}},"/changeRequests/{changeRequestId}":{"delete":{"description":"Refuse a change request","operationId":"declineChangeRequest","parameters":[{"$ref":"#/components/parameters/change-request-id"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"action":{"description":"The id of the action","enum":["declineChangeRequest"],"type":"string"},"data":{"properties":{"rules":{"items":{"$ref":"#/components/schemas/change-request"},"type":"array"}},"required":["rules"],"type":"object"},"result":{"description":"Result of the request","enum":["success","error"],"type":"string"}},"required":["result","action","data"],"type":"object"}}},"description":"Change requests information"}},"summary":"Decline a request details","tags":["🧩 Change requests"],"x-codeSamples":[{"lang":"curl","source":"curl --header \"X-API-Token: yourToken\" --request DELETE https://rudder.example.com/rudder/api/latest/changeRequests/43"}]},"get":{"description":"Get a change request details","operationId":"changeRequestDetails","parameters":[{"$ref":"#/components/parameters/change-request-id"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"action":{"description":"The id of the action","enum":["changeRequestDetails"],"type":"string"},"data":{"properties":{"rules":{"items":{"$ref":"#/components/schemas/change-request"},"type":"array"}},"required":["rules"],"type":"object"},"result":{"description":"Result of the request","enum":["success","error"],"type":"string"}},"required":["result","action","data"],"type":"object"}}},"description":"Change requests information"}},"summary":"Get a change request details","tags":["🧩 Change requests"],"x-codeSamples":[{"lang":"curl","source":"curl --header \"X-API-Token: yourToken\" --request GET https://rudder.example.com/rudder/api/latest/changeRequests --data \"status=open\"\n"}]},"post":{"description":"Update a change request","operationId":"updateChangeRequest","parameters":[{"$ref":"#/components/parameters/change-request-id"}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"description":{"description":"Change request description","type":"string"},"name":{"description":"Change request name","type":"string"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"action":{"description":"The id of the action","enum":["updateChangeRequest"],"type":"string"},"data":{"properties":{"rules":{"items":{"$ref":"#/components/schemas/change-request"},"type":"array"}},"required":["rules"],"type":"object"},"result":{"description":"Result of the request","enum":["success","error"],"type":"string"}},"required":["result","action","data"],"type":"object"}}},"description":"Change requests information"}},"summary":"Update a request details","tags":["🧩 Change requests"],"x-codeSamples":[{"lang":"curl","source":"curl --header \"X-API-Token: yourToken\" --request POST https://rudder.example.com/rudder/api/latest/changeRequests/42 --data \"name=new Name of change request\" -d \"description=add a new description\""}]}},"/changeRequests/{changeRequestId}/accept":{"post":{"description":"Accept a change request","operationId":"acceptChangeRequest","parameters":[{"$ref":"#/components/parameters/change-request-id"}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"status":{"description":"New status of the change request","enum":["pending deployment","deployed"],"example":"deployed","type":"string"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"action":{"description":"The id of the action","enum":["acceptChangeRequest"],"type":"string"},"data":{"properties":{"rules":{"items":{"$ref":"#/components/schemas/change-request"},"type":"array"}},"required":["rules"],"type":"object"},"result":{"description":"Result of the request","enum":["success","error"],"type":"string"}},"required":["result","action","data"],"type":"object"}}},"description":"Change requests information"}},"summary":"Accept a request details","tags":["🧩 Change requests"],"x-codeSamples":[{"lang":"curl","source":"curl --header \"X-API-Token: yourToken\" --request GET https://rudder.example.com/rudder/api/latest/changeRequests --data \"status=open\""}]}},"/compliance":{"get":{"description":"Get current global compliance of a Rudder server","operationId":"getGlobalCompliance","parameters":[{"$ref":"#/components/parameters/compliance-percent-precision"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"action":{"description":"The id of the action","enum":["getGlobalCompliance"],"type":"string"},"data":{"properties":{"globalCompliance":{"properties":{"compliance":{"description":"Global compliance level (`-1` when no policies are defined)","example":57,"format":"integer","type":"number"},"complianceDetails":{"properties":{"error":{"example":1.32,"format":"float","type":"number"},"noReport":{"example":36.18,"format":"float","type":"number"},"successAlreadyOK":{"example":48.68,"format":"float","type":"number"},"successNotApplicable":{"example":5.92,"format":"float","type":"number"},"successRepaired":{"example":2.63,"format":"float","type":"number"},"unexpectedMissingComponent":{"example":2.63,"format":"float","type":"number"},"unexpectedUnknownComponent":{"example":2.63,"format":"float","type":"number"}},"type":"object"}},"required":["compliance"],"type":"object"}},"required":["globalCompliance"],"type":"object"},"result":{"description":"Result of the request","enum":["success","error"],"example":"success","type":"string"}},"required":["result","action","data"],"type":"object"}}},"description":"Success"}},"summary":"Global compliance","tags":["Compliance"],"x-codeSamples":[{"lang":"curl","source":"curl --header \"X-API-Token: yourToken\" --request GET 'https://rudder.example.com/rudder/api/latest/compliance?prettify=true'"}]}},"/compliance/directives":{"get":{"description":"Get current compliance of all the nodes of a Rudder server","operationId":"getDirectivesCompliance","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"action":{"description":"The id of the action","enum":["getDirectiveComplianceId"],"type":"string"},"data":{"properties":{"directivesCompliance":{"properties":{"compliance":{"description":"Directive compliance level","example":83.34,"format":"float","type":"number"},"complianceDetails":{"properties":{"error":{"example":1.32,"format":"float","type":"number"},"noReport":{"example":7.45,"format":"float","type":"number"},"successAlreadyOK":{"example":66.68,"format":"float","type":"number"},"successNotApplicable":{"example":16.66,"format":"float","type":"number"},"successRepaired":{"example":2.63,"format":"float","type":"number"},"unexpectedMissingComponent":{"example":2.63,"format":"float","type":"number"},"unexpectedUnknownComponent":{"example":2.63,"format":"float","type":"number"}},"type":"object"},"id":{"description":"id of the directive","example":"9a1773c9-0889-40b6-be89-f6504443ac1b","format":"uuid","type":"string"},"mode":{"enum":["full-compliance","changes-only","reports-disabled"],"type":"string"},"name":{"description":"Name of the directive","example":"test directive","type":"string"},"nodes":{"$ref":"#/components/schemas/directive-node-compliance"},"rules":{"$ref":"#/components/schemas/directive-rule-compliance"}},"required":["id","name","mode","compliance","complianceDetails","rules","nodes"],"type":"object"}},"required":["directivesCompliance"],"type":"object"},"result":{"description":"Result of the request","enum":["success","error"],"example":"success","type":"string"}},"required":["result","action","data"],"type":"object"}}},"description":"Success"}},"summary":"Compliance details for all directives","tags":["Compliance"],"x-codeSamples":[{"lang":"curl","source":"curl --header \"X-API-Token: yourToken\" --request GET 'https://rudder.example.com/rudder/api/latest/compliance/directives'"}]}},"/compliance/directives/{directiveId}":{"get":{"description":"Get current compliance of a directive of a Rudder server","operationId":"getDirectiveComplianceId","parameters":[{"description":"format of export","examples":{"oneId":{"summary":"CSV format for the export","value":["csv"]}},"explode":false,"in":"query","name":"format","schema":{"type":"string"},"style":"form"},{"$ref":"#/components/parameters/directive-id"}],"responses":{"200":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/compliance-directive-id"},{"$ref":"#/components/schemas/compliance-directive-id-csv"}]}}},"description":"Success"}},"summary":"Compliance details by directive","tags":["Compliance"],"x-codeSamples":[{"lang":"curl","source":"curl --header \"X-API-Token: yourToken\" --request GET 'https://rudder.example.com/rudder/api/latest/compliance/directives/704afe7b-1a65-4d2e-b4c9-54f4f548c316'"}]}},"/compliance/nodes":{"get":{"description":"Get current compliance of all the nodes of a Rudder server","operationId":"getNodesCompliance","parameters":[{"$ref":"#/components/parameters/compliance-level"},{"$ref":"#/components/parameters/compliance-percent-precision"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"action":{"description":"The id of the action","enum":["getNodesCompliance"],"type":"string"},"data":{"properties":{"nodes":{"items":{"properties":{"compliance":{"description":"Rule compliance level","example":57.43,"format":"float","type":"number"},"complianceDetails":{"properties":{"error":{"example":1.32,"format":"float","type":"number"},"noReport":{"example":36.18,"format":"float","type":"number"},"successAlreadyOK":{"example":48.68,"format":"float","type":"number"},"successNotApplicable":{"example":5.92,"format":"float","type":"number"},"successRepaired":{"example":2.63,"format":"float","type":"number"},"unexpectedMissingComponent":{"example":2.63,"format":"float","type":"number"},"unexpectedUnknownComponent":{"example":2.63,"format":"float","type":"number"}},"type":"object"},"id":{"description":"id of the node","example":"f37f4928-fcb5-4acf-a422-d40f123a9670","format":"uuid","type":"string"},"mode":{"enum":["full-compliance","changes-only","reports-disabled"],"type":"string"}},"required":["id","mode","compliance","complianceDetails"],"type":"object"},"type":"array"}},"required":["nodes"],"type":"object"},"result":{"description":"Result of the request","enum":["success","error"],"example":"success","type":"string"}},"required":["result","action","data"],"type":"object"}}},"description":"Success"}},"summary":"Compliance details for all nodes","tags":["Compliance"],"x-codeSamples":[{"lang":"curl","source":"# To get the compliance information of a specific node\ncurl --header \"X-API-Token: yourToken\" --request GET 'https://rudder.example.com/rudder/api/compliance/nodes?level=2'\n\n# To get the list of nodes which have a compliance <100 for a given directive (c5881268-5612-48f2-8ef4-0ab8387fccd6) \ncurl -k -H \"X-API-Token: yourToken\" -X GET \"https://rudder.example.com/rudder/api/latest/compliance/nodes?level=3\" \\\n| jq '[.data.nodes[] \n | {\n \"nodeid\":.id, \n \"dirs\": [.rules[].directives[]] \n | map(select(.id == \"c5881268-5612-48f2-8ef4-0ab8387fccd6\" and .compliance < 100)) \n }\n ] \n| map(select(.dirs | length != 0)) \n| [.[] |\n {\"nodeid\":.nodeid, \"comp\":.dirs[0].complianceDetails}\n ]'\n\n"}]}},"/compliance/nodes/{nodeId}":{"get":{"description":"Get current compliance of a node of a Rudder server","operationId":"getNodeCompliance","parameters":[{"$ref":"#/components/parameters/compliance-level"},{"$ref":"#/components/parameters/compliance-percent-precision"},{"$ref":"#/components/parameters/node-id"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"action":{"description":"The id of the action","enum":["getNodeCompliance"],"type":"string"},"data":{"properties":{"nodes":{"items":{"properties":{"compliance":{"description":"Rule compliance level","example":57.43,"format":"float","type":"number"},"complianceDetails":{"properties":{"error":{"example":1.32,"format":"float","type":"number"},"noReport":{"example":36.18,"format":"float","type":"number"},"successAlreadyOK":{"example":48.68,"format":"float","type":"number"},"successNotApplicable":{"example":5.92,"format":"float","type":"number"},"successRepaired":{"example":2.63,"format":"float","type":"number"},"unexpectedMissingComponent":{"example":2.63,"format":"float","type":"number"},"unexpectedUnknownComponent":{"example":2.63,"format":"float","type":"number"}},"type":"object"},"id":{"description":"id of the node","example":"f37f4928-fcb5-4acf-a422-d40f123a9670","format":"uuid","type":"string"},"mode":{"enum":["full-compliance","changes-only","reports-disabled"],"type":"string"}},"required":["id","mode","compliance","complianceDetails"],"type":"object"},"type":"array"}},"required":["nodes"],"type":"object"},"result":{"description":"Result of the request","enum":["success","error"],"example":"success","type":"string"}},"required":["result","action","data"],"type":"object"}}},"description":"Success"}},"summary":"Compliance details by node","tags":["Compliance"],"x-codeSamples":[{"lang":"curl","source":"curl --header \"X-API-Token: yourToken\" --request GET 'https://rudder.example.com/rudder/api/compliance/nodes/root?level=1'"}]}},"/compliance/rules":{"get":{"description":"Get current compliance of all the rules of a Rudder server","operationId":"getRulesCompliance","parameters":[{"$ref":"#/components/parameters/compliance-level"},{"$ref":"#/components/parameters/compliance-percent-precision"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"action":{"description":"The id of the action","enum":["getRulesCompliance"],"type":"string"},"data":{"properties":{"rules":{"items":{"properties":{"compliance":{"description":"Rule compliance level","example":57.43,"format":"float","type":"number"},"complianceDetails":{"properties":{"error":{"example":1.32,"format":"float","type":"number"},"noReport":{"example":36.18,"format":"float","type":"number"},"successAlreadyOK":{"example":48.68,"format":"float","type":"number"},"successNotApplicable":{"example":5.92,"format":"float","type":"number"},"successRepaired":{"example":2.63,"format":"float","type":"number"},"unexpectedMissingComponent":{"example":2.63,"format":"float","type":"number"},"unexpectedUnknownComponent":{"example":2.63,"format":"float","type":"number"}},"type":"object"},"id":{"description":"id of the rule","example":"f37f4928-fcb5-4acf-a422-d40f123a9670","format":"uuid","type":"string"},"mode":{"enum":["full-compliance","changes-only","reports-disabled"],"type":"string"}},"required":["id","mode","compliance","complianceDetails"],"type":"object"},"type":"array"}},"required":["rules"],"type":"object"},"result":{"description":"Result of the request","enum":["success","error"],"example":"success","type":"string"}},"required":["result","action","data"],"type":"object"}}},"description":"Success"}},"summary":"Compliance details for all rules","tags":["Compliance"],"x-codeSamples":[{"lang":"curl","source":"curl --header \"X-API-Token: yourToken\" --request GET 'https://rudder.example.com/rudder/api/latest/compliance/rules?level=2'"}]}},"/compliance/rules/{ruleId}":{"get":{"description":"Get current compliance of a rule of a Rudder server","operationId":"getRuleCompliance","parameters":[{"$ref":"#/components/parameters/compliance-level"},{"$ref":"#/components/parameters/compliance-percent-precision"},{"$ref":"#/components/parameters/rule-id"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"action":{"description":"The id of the action","enum":["getRuleCompliance"],"type":"string"},"data":{"properties":{"rules":{"items":{"properties":{"compliance":{"description":"Rule compliance level","example":57.43,"format":"float","type":"number"},"complianceDetails":{"properties":{"error":{"example":1.32,"format":"float","type":"number"},"noReport":{"example":36.18,"format":"float","type":"number"},"successAlreadyOK":{"example":48.68,"format":"float","type":"number"},"successNotApplicable":{"example":5.92,"format":"float","type":"number"},"successRepaired":{"example":2.63,"format":"float","type":"number"},"unexpectedMissingComponent":{"example":2.63,"format":"float","type":"number"},"unexpectedUnknownComponent":{"example":2.63,"format":"float","type":"number"}},"type":"object"},"id":{"description":"id of the rule","example":"f37f4928-fcb5-4acf-a422-d40f123a9670","format":"uuid","type":"string"},"mode":{"enum":["full-compliance","changes-only","reports-disabled"],"type":"string"}},"required":["id","mode","compliance","complianceDetails"],"type":"object"},"type":"array"}}