From f0950bc000f05de30428d516c7810703b37d1595 Mon Sep 17 00:00:00 2001 From: Jonas Alves Date: Tue, 25 Mar 2025 17:11:29 +0000 Subject: [PATCH 1/2] Added missing documentation of the console API --- docusaurus.config.js | 2 +- nodeapi-spec.yaml | 3495 ----------------- openapi_console/components/parameters.yaml | 20 + openapi_console/openapi.yaml | 194 + .../paths/access_control_policies.yaml | 257 ++ openapi_console/paths/api_keys.yaml | 263 ++ openapi_console/paths/applications.yaml | 252 ++ openapi_console/paths/configs.yaml | 167 + openapi_console/paths/cors_origins.yaml | 410 ++ openapi_console/paths/environments.yaml | 240 ++ openapi_console/paths/events.yaml | 552 +++ .../paths/experiment_custom_sections.yaml | 397 ++ openapi_console/paths/experiment_tags.yaml | 228 ++ openapi_console/paths/experiments.yaml | 1355 +++++++ openapi_console/paths/export_configs.yaml | 573 +++ openapi_console/paths/files.yaml | 63 + openapi_console/paths/goal_tags.yaml | 228 ++ openapi_console/paths/goals.yaml | 485 +++ openapi_console/paths/insights.yaml | 382 ++ openapi_console/paths/metric_tags.yaml | 228 ++ openapi_console/paths/metrics.yaml | 508 +++ .../paths/permission_categories.yaml | 41 + openapi_console/paths/permissions.yaml | 439 +++ .../paths/permissions_and_roles.yaml | 450 +++ openapi_console/paths/roles.yaml | 307 ++ openapi_console/paths/segments.yaml | 269 ++ openapi_console/paths/storage_configs.yaml | 180 + openapi_console/paths/unit_types.yaml | 258 ++ openapi_console/paths/users_and_teams.yaml | 680 ++++ openapi_console/paths/webhooks.yaml | 443 +++ 30 files changed, 9870 insertions(+), 3496 deletions(-) delete mode 100644 nodeapi-spec.yaml create mode 100644 openapi_console/components/parameters.yaml create mode 100644 openapi_console/openapi.yaml create mode 100644 openapi_console/paths/access_control_policies.yaml create mode 100644 openapi_console/paths/api_keys.yaml create mode 100644 openapi_console/paths/applications.yaml create mode 100644 openapi_console/paths/configs.yaml create mode 100644 openapi_console/paths/cors_origins.yaml create mode 100644 openapi_console/paths/environments.yaml create mode 100644 openapi_console/paths/events.yaml create mode 100644 openapi_console/paths/experiment_custom_sections.yaml create mode 100644 openapi_console/paths/experiment_tags.yaml create mode 100644 openapi_console/paths/experiments.yaml create mode 100644 openapi_console/paths/export_configs.yaml create mode 100644 openapi_console/paths/files.yaml create mode 100644 openapi_console/paths/goal_tags.yaml create mode 100644 openapi_console/paths/goals.yaml create mode 100644 openapi_console/paths/insights.yaml create mode 100644 openapi_console/paths/metric_tags.yaml create mode 100644 openapi_console/paths/metrics.yaml create mode 100644 openapi_console/paths/permission_categories.yaml create mode 100644 openapi_console/paths/permissions.yaml create mode 100644 openapi_console/paths/permissions_and_roles.yaml create mode 100644 openapi_console/paths/roles.yaml create mode 100644 openapi_console/paths/segments.yaml create mode 100644 openapi_console/paths/storage_configs.yaml create mode 100644 openapi_console/paths/unit_types.yaml create mode 100644 openapi_console/paths/users_and_teams.yaml create mode 100644 openapi_console/paths/webhooks.yaml diff --git a/docusaurus.config.js b/docusaurus.config.js index d364600d..832312d0 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -92,7 +92,7 @@ const config = { }, }, nodeapi: { - specPath: "nodeapi-spec.yaml", + specPath: "openapi_console/openapi.yaml", outputDir: "docs/Web-Console-API", // Output directory for generated .mdx docs sidebarOptions: { sidebarCollapsible: false, diff --git a/nodeapi-spec.yaml b/nodeapi-spec.yaml deleted file mode 100644 index 557ea8a4..00000000 --- a/nodeapi-spec.yaml +++ /dev/null @@ -1,3495 +0,0 @@ -openapi: 3.0.0 -info: - title: ABsmartly Web Console API - version: 1.0.0 - description: An OpenAPI Specification that describes the ABsmartly API for working with your experiments programmatically. - contact: - name: API Support - email: api@absmartly.com - license: - name: Proprietary -externalDocs: - description: Find out more about ABsmartly - url: "https://www.absmartly.com" -servers: - - url: https://sandbox.absmartly.com/v1 -security: - - UserApiKey: [] - -paths: - /experiments: - get: - summary: Experiments LIST - description: "**Required Permissions**: `Experiment List` or `Experiment Admin`" - parameters: - - name: search - in: query - schema: - type: string - example: "call_to_action" - - name: sort - in: query - description: The object key to sort the results by. - schema: - type: string - example: name - - name: sort_asc - in: query - schema: - type: boolean - example: true - - name: page - in: query - schema: - type: integer - example: 1 - - name: items - in: query - schema: - type: integer - example: 5 - - name: iterations_of - in: query - required: false - description: The `id` of the experiment that you want to get the iterations of. - schema: - type: integer - - name: owners - in: query - required: false - description: An array of `user` ids to sort results by. - schema: - type: array - items: - type: integer - - name: teams - in: query - required: false - description: Array of `team` ids to sort results by. - schema: - type: array - items: - type: integer - - name: tags - in: query - required: false - description: An array of `tag` ids to sort results by. - schema: - type: array - items: - type: integer - - name: applications - in: query - required: false - description: An array of `application` ids to sort results by. - schema: - type: array - items: - type: integer - - name: unit_types - in: query - required: false - description: An array of `unit_type` ids to sort results by. - schema: - type: array - items: - type: integer - - name: previews - in: query - required: false - description: A boolean value which deliminates whether you want all experiment data or just a few specific statistics - schema: - enum: [0, 1] - - name: impact - in: query - required: false - description: A tuple value which allows you to specify a `from` and a `to` range of impacts to filter by. **This must be used with a preview query of `1`** - schema: - type: array - minItems: 2 - maxItems: 2 - items: - type: number - - name: confidence - in: query - required: false - description: A tuple value which allows you to specify a `from` and a `to` range of confidences to filter by. **This must be used with a preview query of `1`** - schema: - type: array - minItems: 2 - maxItems: 2 - items: - type: number - - name: significance - in: query - required: false - description: An array of significances allowing you to filter by positive, negative or unsignificant experiments. **This must be used with a preview query of `1`** - schema: - type: array - items: - enum: [insignificant, positive, negative] - - name: sample_ratio_mismatch - in: query - required: false - description: A boolean value which allows you to filter for experiments with a `Sample Ratio Mismatch` alert. **This must be used with a preview query of `1`** - schema: - type: boolean - - name: cleanup_needed - in: query - required: false - description: A boolean value which allows you to filter for experiments with a `Code Cleanup Needed` alert. **This must be used with a preview query of `1`** - schema: - type: boolean - - name: audience_mismatch - in: query - required: false - description: A boolean value which allows you to filter for experiments with a `Target Audience Mismatch` alert. **This must be used with a preview query of `1`** - schema: - type: boolean - - name: sample_size_reached - in: query - required: false - description: A boolean value which allows you to filter for experiments with a `Sample Size Reached` alert. **This must be used with a preview query of `1`** - schema: - type: boolean - - name: iterations - in: query - required: false - description: - schema: - enum: [0, 1] - - name: sort_asc - in: query - required: false - description: A boolean value which allows you to reverse the order of the experiment list - schema: - type: boolean - - name: items - in: query - required: false - description: An integer value which allows you to limit the number of experiments that are returned per page. - schema: - type: integer - - name: page - in: query - required: false - description: An integer value which represents what page of the experiments list to return - schema: - type: integer - responses: - "200": - description: An array of all experiment objects. - content: - application/json: - schema: - type: array - items: - $ref: "#/components/schemas/Experiment" - - /experiments/{experimentId}: - get: - summary: Experiment GET - description: "**Required Permissions**: `Experiment Get` or `Experiment Admin`" - parameters: - - name: experimentId - in: path - required: true - description: The `id` of the experiment which you want data from. - schema: - type: integer - format: int64 - minimum: 1 - responses: - "200": - description: A JSON Object with experiment data. - content: - application/json: - schema: - type: object - properties: - experiment: - $ref: "#/components/schemas/Experiment" - - /experiments/{experimentId}/start: - put: - summary: Experiment START - description: "**Required Permissions**: `Experiment Start` or `Experiment Admin`" - parameters: - - name: experimentId - in: path - required: true - description: The `id` of the experiment which you want to start. - schema: - type: integer - format: int64 - minimum: 1 - requestBody: - description: The action to take on the experiment and a comment to go along with it. - required: true - content: - application/json: - schema: - type: object - properties: - action: - type: string - format: start - example: start - note: - type: string - example: "Starting experiment to test new call to action" - responses: - "200": - description: A JSON Object with experiment data, the experiment note and an array of errors. - content: - application/json: - schema: - type: object - properties: - errors: - type: array - items: - type: string - experiment: - $ref: "#/components/schemas/Experiment" - experiment_note: - $ref: "#/components/schemas/ExperimentNote" - ok: - type: boolean - - /experiments/{experimentId}/stop: - put: - summary: Experiment STOP - description: "**Required Permissions**: `Experiment Stop` or `Experiment Admin`" - parameters: - - name: experimentId - in: path - required: true - description: The `id` of the experiment which you want to stop. - schema: - type: integer - format: int64 - minimum: 1 - requestBody: - description: The action to take on the experiment and a comment to go along with it. - required: true - content: - application/json: - schema: - type: object - properties: - action: - type: string - format: stop - example: stop - note: - type: string - example: "Stopping experiment as no significant results were found" - responses: - "200": - description: A JSON Object with experiment data, the experiment note and an array of errors. - content: - application/json: - schema: - type: object - properties: - errors: - type: array - items: - type: string - experiment: - $ref: "#/components/schemas/Experiment" - experiment_note: - $ref: "#/components/schemas/ExperimentNote" - ok: - type: boolean - - /experiments/{experimentId}/full_on: - put: - summary: Experiment FULL ON - description: "**Required Permissions**: `Experiment Full On` or `Experiment Admin`" - parameters: - - name: experimentId - in: path - required: true - description: The `id` of the experiment which you want to put full on. - schema: - type: integer - format: int64 - minimum: 1 - requestBody: - description: The full on variant and a report of why this experiment is being put full on. - required: true - content: - application/json: - schema: - type: object - properties: - full_on_variant: - type: integer - format: 1 | 2 | 3 - example: 1 - note: - type: string - example: "Putting variant 1 full on as we saw significant increase in conversions" - responses: - "200": - description: A JSON Object with experiment data, the experiment note and an array of errors. - content: - application/json: - schema: - type: object - properties: - errors: - type: array - items: - type: string - experiment: - $ref: "#/components/schemas/Experiment" - experiment_note: - $ref: "#/components/schemas/ExperimentNote" - ok: - type: boolean - - /experiments/{experimentId}/archive: - put: - summary: Experiment ARCHIVE - description: "**Required Permissions**: `Experiment Archive` or `Experiment Admin`" - parameters: - - name: experimentId - in: path - required: true - description: The `id` of the experiment which you want to archive. - schema: - type: integer - format: int64 - minimum: 1 - requestBody: - description: The action to take on the experiment, the experiment id and a comment to go along with the action. - required: true - content: - application/json: - schema: - type: object - properties: - archive: - type: boolean - example: true - id: - description: The `id` of the experiment which you want to archive. - type: integer - format: int64 - minimum: 1 - example: 13 - note: - description: The reason why you are archiving this experiment. - type: string - example: "Archiving experiment as it is no longer needed" - responses: - "200": - description: A JSON Object with experiment data, the experiment note and an array of errors. - content: - application/json: - schema: - type: object - properties: - errors: - type: array - items: - type: string - experiment: - $ref: "#/components/schemas/Experiment" - experiment_note: - $ref: "#/components/schemas/ExperimentNote" - ok: - type: boolean - - /experiments/{experimentId}/participants/history: - post: - summary: Experiment Participants History DATA - description: "**Required Permissions**: `Experiment Get` or `Experiment Admin`" - parameters: - - name: experimentId - in: path - required: true - description: The `id` of the experiment that you want the history of. - schema: - type: integer - format: int64 - minimum: 1 - requestBody: - description: The parameters to filter the history by. - required: true - content: - application/json: - schema: - type: object - properties: - filters: - type: object - properties: - segments: - type: array - items: - type: object - properties: - segment_id: - type: integer - format: int64 - minimum: 1 - example: 1 - operator: - type: string - enum: [in, not_in] - example: "not_in" - values: - type: array - items: - type: string - example: "absmartly-javascript-sdk" - period: - type: string - enum: [1h, 1d, 1w, 1M] - example: "1d" - tz_offset: - type: integer - example: 0 - responses: - "200": - description: | - A JSON Object with participants history. The object has three properties, `columnNames`, `columnTypes` and `rows`. - `columnNames` is an array of strings which identifies which columns are which in the `rows[][]`. - `columnTypes` is an array of strings which identifies the types of data in the `rows[][]`. - `rows` is an array of arrays which contain the data of the experiment variants over your selected period. - The column names are defined as the following: - - `date` - The date of the row's data in seconds since epoch. - - `variant` - The variant that this row describes. (0, 1, 2 or 3). - - `first_exposure_at` - The date of the first exposure of this variant in the current time period in milliseconds since epoch. - - `last_exposure_at` - The date of the last exposure of this variant in the current time period in milliseconds since epoch. - - `unit_count` - The number of units that were exposed to this variant in the current time period. - - `cum_unit_count` - The cumulative number of units that were exposed to this variant at the end of the current time period. - - :::caution - The columns may come in a different order than the one listed above. It's important to use the `columnNames` array to identify the index of the column you want to use. - ::: - content: - application/json: - schema: - type: object - properties: - columnNames: - type: array - items: - type: string - columnTypes: - type: array - items: - type: string - rows: - type: array - items: - type: array - items: - type: number - - /experiments/{experimentId}/metrics/main/history: - post: - summary: Experiment Main Metrics History DATA - description: "**Required Permissions**: `Experiment Get` or `Experiment Admin`" - parameters: - - name: experimentId - in: path - required: true - description: The `id` of the experiment that you want the history of. - schema: - type: integer - format: int64 - minimum: 1 - requestBody: - description: The parameters to filter the history by. - required: false - content: - application/json: - schema: - type: object - properties: - filters: - type: object - properties: - segments: - type: array - items: - type: object - properties: - segment_id: - type: integer - format: int64 - minimum: 1 - example: 1 - operator: - type: string - enum: [in, not_in] - example: "not_in" - values: - type: array - items: - type: string - example: "absmartly-javascript-sdk" - period: - type: string - enum: [1h, 1d, 1w, 1M] - example: "1d" - tz_offset: - type: integer - example: 0 - responses: - "200": - description: | - A JSON Object with main metrics history per period. The object has three properties, `columnNames`, `columnTypes` and `rows`. - `columnNames` is an array of strings which identifies which columns are which in the `rows[][]`. - `columnTypes` is an array of strings which identifies the types of data in the `rows[][]`. - `rows` is an array of arrays which contain the data of the experiment variants over your selected period. - The column names are defined as the following: - - ### **Regular Columns:** - - - `date` - The date of the row's data in seconds since epoch. - - `variant` - The variant that this row describes. (0, 1, 2 or 3). - - `first_exposure_at` - The date of the first exposure of this variant in the current time period in milliseconds since epoch. - - `last_exposure_at` - The date of the last exposure of this variant in the current time period in milliseconds since epoch. - - `unit_count` - The number of units that were exposed to this variant in the current time period. - - `cum_unit_count` - The cumulative number of units that were exposed to this variant at the end of the current time period. - - ### **Dynamic Columns:** - - - `metric_${metric_id}` - The value of the metric with the id of `${metric_id}` in the current time period. - - `metric_${metric_id}_mean` - The mean value of the metric with the id of `${metric_id}` in the current time period. - - `metric_${metric_id}_var` - The variance of the metric with the id of `${metric_id}` in the current time period. - - `metric_${metric_id}_pvalue` - The p-value of the metric with the id of `${metric_id}` in the current time period. - - `metric_${metric_id}_impact` - The impact of the metric with the id of `${metric_id}` in the current time period. - - `metric_${metric_id}_impact_ci_lower` - The lower bound of the confidence interval of the impact of the metric with the id of `${metric_id}` in the current time period. - - `metric_${metric_id}_impact_ci_upper` - The upper bound of the confidence interval of the impact of the metric with the id of `${metric_id}` in the current time period. - - :::caution - The columns may come in a different order than the one listed above. It's important to use the `columnNames` array to identify the index of the column you want to use. - ::: - content: - application/json: - schema: - type: object - properties: - columnNames: - type: array - items: - type: string - columnTypes: - type: array - items: - type: string - rows: - type: array - items: - type: array - items: - type: number - - /experiments/{experimentId}/metrics/main: - post: - summary: Experiment Main Metrics DATA - description: "**Required Permissions**: `Experiment Get` or `Experiment Admin`" - parameters: - - name: experimentId - in: path - required: true - description: The `id` of the experiment that you want the main metrics of. - schema: - type: integer - format: int64 - minimum: 1 - requestBody: - description: The parameters to filter the main metrics by. If no filtering is required then `filters` can be an empty object - required: true - content: - application/json: - schema: - type: object - properties: - filters: - type: object - properties: - segments: - type: array - items: - type: object - properties: - segment_id: - type: integer - format: int64 - minimum: 1 - example: 1 - operator: - type: string - enum: [in, not_in] - example: "not_in" - values: - type: array - items: - type: string - example: "absmartly-javascript-sdk" - responses: - "200": - description: | - A JSON Object with the current values of the experiment's main metrics. The object has three properties, - `columnNames`, `columnTypes` and `rows`. `columnNames` is an array of strings which identifies which - columns are which in the `rows[][]`. `columnTypes` is an array of strings which identifies the types of - data in the `rows[][]`. `rows` is an array of arrays which contain the current main metric data for each of - the experiment's variants. The column names are defined as the following: - - ### **Regular Columns:** - - - `variant` - The variant that this row describes. (0, 1, 2 or 3). - - `first_exposure_at` - The date of the first exposure of this variant in milliseconds since epoch. - - `last_exposure_at` - The date of the last exposure of this variant in milliseconds since epoch. - - `unit_count` - The number of units that have been exposed to this variant. - - ### **Dynamic Columns:** - - - `metric_${metric_id}` - The current value of the metric with the id of `${metric_id}`. - - `metric_${metric_id}_mean` - The mean value of the metric with the id of `${metric_id}`. - - `metric_${metric_id}_var` - The variance of the metric with the id of `${metric_id}`. - - `metric_${metric_id}_pvalue` - The p-value of the metric with the id of `${metric_id}`. - - `metric_${metric_id}_impact` - The current impact of the metric with the id of `${metric_id}`. - - `metric_${metric_id}_impact_ci_lower` - The lower bound of the confidence interval of the impact of the metric with the id of `${metric_id}`. - - `metric_${metric_id}_impact_ci_upper` - The upper bound of the confidence interval of the impact of the metric with the id of `${metric_id}`. - - :::caution - The columns may come in a different order than the one listed above. It's important to use the `columnNames` array to identify the index of the column you want to use. - ::: - content: - application/json: - schema: - type: object - properties: - columnNames: - type: array - items: - type: string - columnTypes: - type: array - items: - type: string - rows: - type: array - items: - type: array - items: - type: number - - /experiments/{experimentId}/activity: - get: - summary: Experiment Activity GET - description: "**Required Permissions**: `Experiment Get` or `Experiment Admin`" - parameters: - - name: experimentId - in: path - required: true - schema: - type: integer - - name: offset - in: query - required: false - schema: - type: integer - responses: - "200": - description: A JSON Object containing a particular experiment's activity. - content: - application/json: - schema: - type: object - properties: - experiment_notes: - type: array - items: - $ref: "#/components/schemas/ExperimentNote" - offset: - type: integer - post: - summary: Experiment Comment CREATE - description: "**Required Permissions**: `Experiment Get` or `Experiment Admin`" - parameters: - - name: experimentId - in: path - required: true - schema: - type: integer - format: int64 - minimum: 1 - requestBody: - description: The comment to be inserted in the experiment activity tab. - required: true - content: - application/json: - schema: - type: object - properties: - id: - description: The `id` of the experiment where the comment will be created. - type: integer - format: int64 - minimum: 1 - example: 13 - note: - description: The comment text. - type: string - example: "Text to be inserted" - responses: - "200": - description: A JSON Object containing a particular experiment's activity. - content: - application/json: - schema: - type: object - properties: - experiment_note: - $ref: "#/components/schemas/ExperimentNote" - ok: - type: boolean - errors: - type: array - items: - type: string - - /experiments/{experimentId}/activity/{commentId}/reply: - post: - summary: Experiment Comment Reply CREATE - description: "**Required Permissions**: `Experiment Get` or `Experiment Admin`" - parameters: - - name: experimentId - in: path - required: true - schema: - type: integer - format: int64 - minimum: 1 - - name: commentId - in: path - required: true - description: The `id` of the comment where the reply will be created. - schema: - type: integer - format: int64 - minimum: 1 - requestBody: - description: The reply to be inserted in the comment. - required: true - content: - application/json: - schema: - type: object - properties: - id: - description: The `id` of the comment where the reply will be created. - type: integer - format: int64 - minimum: 1 - example: 13 - note: - description: The reply text. - type: string - example: "Text to be replied" - responses: - "200": - description: A JSON Object containing a particular experiment's activity. - content: - application/json: - schema: - type: object - properties: - experiment_note: - $ref: "#/components/schemas/ExperimentNote" - ok: - type: boolean - errors: - type: array - items: - type: string - /api_keys: - get: - summary: API Keys LIST - description: "**Required Permissions**: `ApiKey List` or `ApiKey Admin`" - parameters: - - name: sort - in: query - description: The object key to sort the results by. - schema: - type: string - example: name - - name: sort_asc - in: query - schema: - type: boolean - example: true - - name: page - in: query - schema: - type: integer - example: 1 - - name: items - in: query - schema: - type: integer - example: 5 - responses: - "200": - description: A JSON Object with an array of all created API keys. - content: - application/json: - schema: - type: object - properties: - items: - type: integer - page: - type: integer - minimum: 1 - total: - type: integer - api_keys: - type: array - items: - $ref: "#/components/schemas/ApiKey" - - /api_keys/{apiKeyId}: - get: - summary: API Key GET - description: "**Required Permissions**: `ApiKey Get` or `ApiKey Admin`" - parameters: - - name: apiKeyId - in: path - required: true - schema: - type: integer - description: The id of the API Key that you wish to get data from. - responses: - "200": - description: A JSON Object a particular API key's data. - content: - application/json: - schema: - type: object - properties: - api_key: - $ref: "#/components/schemas/ApiKey" - - /applications: - get: - summary: Applications LIST - description: "**Required Permissions**: `Application List` or `Application Admin`" - parameters: - - name: sort - in: query - description: The object key to sort the results by. - schema: - type: string - example: name - - name: sort_asc - in: query - schema: - type: boolean - example: true - - name: page - in: query - schema: - type: integer - example: 1 - - name: items - in: query - schema: - type: integer - example: 5 - responses: - "200": - description: A JSON Object with an array of all applications that have been created. - content: - application/json: - schema: - type: object - properties: - items: - type: integer - page: - type: integer - minimum: 1 - total: - type: integer - applications: - type: array - items: - $ref: "#/components/schemas/Application" - - /applications/{applicationId}: - get: - summary: Application GET - description: "**Required Permissions**: `Application Get` or `Application Admin`" - parameters: - - name: applicationId - in: path - required: true - schema: - type: integer - description: The id of the Application that you wish to get data from. - responses: - "200": - description: A JSON Object an application's data. - content: - application/json: - schema: - type: object - properties: - application: - $ref: "#/components/schemas/Application" - - /cors: - get: - summary: CORS Allowed Origins LIST - description: "**Required Permissions**: `CorsAllowedOrigin List` or `CorsAllowedOrigin Admin`" - parameters: - - name: sort - in: query - description: The object key to sort the results by. - schema: - type: string - example: name - - name: sort_asc - in: query - schema: - type: boolean - example: true - - name: page - in: query - schema: - type: integer - example: 1 - - name: items - in: query - schema: - type: integer - example: 5 - responses: - "200": - description: A JSON Object containing an array of all CORS Allowed Origins. - content: - application/json: - schema: - type: object - properties: - items: - type: integer - page: - type: integer - minimum: 1 - total: - type: integer - cors_allowed_origins: - type: array - items: - $ref: "#/components/schemas/CORS" - - /cors/{corsId}: - get: - summary: CORS Allowed Origin GET - description: "**Required Permissions**: `CorsAllowedOrigin Get` or `CorsAllowedOrigin Admin`" - parameters: - - name: applicationId - in: path - required: true - schema: - type: integer - description: The id of the CORS Allowed Origin that you wish to get data from. - responses: - "200": - description: A JSON Object containing a single CORS Allowed Origin's data. - content: - application/json: - schema: - type: object - properties: - cors_allowed_origin: - $ref: "#/components/schemas/CORS" - - /environments: - get: - description: "**Required Permissions**: `Environment List` or `Environment Admin`" - summary: Environments LIST - parameters: - - name: sort - in: query - description: The object key to sort the results by. - schema: - type: string - example: name - - name: sort_asc - in: query - schema: - type: boolean - example: true - - name: page - in: query - schema: - type: integer - example: 1 - - name: items - in: query - schema: - type: integer - example: 5 - responses: - "200": - description: A JSON Object containing an array of all created environments. - content: - application/json: - schema: - type: object - properties: - items: - type: integer - page: - type: integer - minimum: 1 - total: - type: integer - environments: - type: array - items: - $ref: "#/components/schemas/Environment" - - /environments/{environmentId}: - get: - summary: Environment GET - description: "**Required Permissions**: `Environment Get` or `Environment Admin`" - parameters: - - name: environmentId - in: path - required: true - schema: - type: integer - description: The id of the Environment that you wish to get data from. - responses: - "200": - description: A JSON Object containing a single environment's data. - content: - application/json: - schema: - type: object - properties: - environment: - $ref: "#/components/schemas/Environment" - - /experiment_annotations: - get: - summary: Experiment Annotations LIST - description: "**Required Permissions**: `Annotation List` or `Annotation Admin`" - parameters: - - name: sort - in: query - description: The object key to sort the results by. - schema: - type: string - example: name - - name: sort_asc - in: query - schema: - type: boolean - example: true - - name: page - in: query - schema: - type: integer - example: 1 - - name: items - in: query - schema: - type: integer - example: 5 - - name: experiment_id - in: query - required: false - schema: - type: integer - description: Filter experiment annotations by `experiment_id` - responses: - "200": - description: A JSON Object containing an array of all experiment annotations. - content: - application/json: - schema: - type: object - properties: - items: - type: integer - page: - type: integer - minimum: 1 - total: - type: integer - experiment_annotations: - type: array - items: - $ref: "#/components/schemas/ExperimentAnnotation" - - /experiment_annotations/{experimentAnnotationId}: - get: - summary: Experiment Annotation GET - description: "**Required Permissions**: `Annotation Get` or `Annotation Admin`" - parameters: - - name: experimentAnnotationId - in: path - required: true - schema: - type: integer - description: The id of the Experiment Annotation that you wish to get data from. - responses: - "200": - description: A JSON Object containing an experiment annotation's data. - content: - application/json: - schema: - type: object - properties: - experiment_annotation: - $ref: "#/components/schemas/ExperimentAnnotation" - - /experiment_tags: - get: - summary: Experiment Tags LIST - description: "**Required Permissions**: `Experiment List` or `Experiment Admin`" - parameters: - - name: sort - in: query - description: The object key to sort the results by. - schema: - type: string - example: name - - name: sort_asc - in: query - schema: - type: boolean - example: true - - name: page - in: query - schema: - type: integer - example: 1 - - name: items - in: query - schema: - type: integer - example: 5 - responses: - "200": - description: A JSON Object containing an array of all experiment tags. - content: - application/json: - schema: - type: object - properties: - items: - type: integer - page: - type: integer - minimum: 1 - total: - type: integer - experiment_tags: - type: array - items: - $ref: "#/components/schemas/ExperimentTag" - - /experiment_tags/{experimentTagId}: - get: - summary: Experiment Tag GET - description: "**Required Permissions**: `Experiment Get` or `Experiment Admin`" - parameters: - - name: experimentTagId - in: path - required: true - schema: - type: integer - description: The id of the Experiment Tag that you wish to get data from. - responses: - "200": - description: A JSON Object containing an experiment tag's data. - content: - application/json: - schema: - type: object - properties: - experiment_tag: - $ref: "#/components/schemas/ExperimentTag" - - /goal_tags: - get: - summary: Goal Tags LIST - description: "**Required Permissions**: `Goal List` or `Goal Admin`" - parameters: - - name: sort - in: query - description: The object key to sort the results by. - schema: - type: string - example: name - - name: sort_asc - in: query - schema: - type: boolean - example: true - - name: page - in: query - schema: - type: integer - example: 1 - - name: items - in: query - schema: - type: integer - example: 5 - responses: - "200": - description: A JSON Object containing an array of all goal tags. - content: - application/json: - schema: - type: object - properties: - items: - type: integer - page: - type: integer - minimum: 1 - total: - type: integer - goal_tags: - type: array - items: - $ref: "#/components/schemas/GoalTag" - - /goal_tags/{goalTagId}: - get: - summary: Goal Tag GET - description: "**Required Permissions**: `Goal Get` or `Goal Admin`" - parameters: - - name: goalTagId - in: path - required: true - schema: - type: integer - description: The id of the Goal Tag that you wish to get data from. - responses: - "200": - description: A JSON Object containing a goal tag's data. - content: - application/json: - schema: - type: object - properties: - goal_tag: - $ref: "#/components/schemas/GoalTag" - - /goals: - get: - summary: Goals LIST - description: "**Required Permissions**: `Goal List` or `Goal Admin`" - parameters: - - name: sort - in: query - description: The object key to sort the results by. - schema: - type: string - example: name - - name: sort_asc - in: query - schema: - type: boolean - example: true - - name: page - in: query - schema: - type: integer - example: 1 - - name: items - in: query - schema: - type: integer - example: 5 - responses: - "200": - description: A JSON Object containing an array of all goals. - content: - application/json: - schema: - type: object - properties: - items: - type: integer - page: - type: integer - minimum: 1 - total: - type: integer - goals: - type: array - items: - $ref: "#/components/schemas/Goal" - - /goals/{goalId}: - get: - summary: Goal GET - description: "**Required Permissions**: `Goal Get` or `Goal Admin`" - parameters: - - name: goalId - in: path - required: true - schema: - type: integer - description: The id of the Goal that you wish to get data from. - responses: - "200": - description: A JSON Object containing a goal's data. - content: - application/json: - schema: - type: object - properties: - goal: - $ref: "#/components/schemas/Goal" - - /metric_tags: - get: - summary: Metric Tags LIST - description: "**Required Permissions**: `Metric List` or `Metric Admin`" - parameters: - - name: sort - in: query - description: The object key to sort the results by. - schema: - type: string - example: name - - name: sort_asc - in: query - schema: - type: boolean - example: true - - name: page - in: query - schema: - type: integer - example: 1 - - name: items - in: query - schema: - type: integer - example: 5 - responses: - "200": - description: A JSON Object containing an array of all metrics tags. - content: - application/json: - schema: - type: object - properties: - items: - type: integer - page: - type: integer - minimum: 1 - total: - type: integer - metric_tags: - type: array - items: - $ref: "#/components/schemas/MetricTag" - - /metric_tags/{metricTagId}: - get: - summary: Metric Tag GET - description: "**Required Permissions**: `Metric Get` or `Metric Admin`" - parameters: - - name: metricTagId - in: path - required: true - schema: - type: integer - description: The id of the Metric Tag that you wish to get data from. - responses: - "200": - description: A JSON Object containing a metric tag's data. - content: - application/json: - schema: - type: object - properties: - metric_tag: - $ref: "#/components/schemas/MetricTag" - - /metrics: - get: - summary: Metrics LIST - description: "**Required Permissions**: `Metric List` or `Metric Admin`" - parameters: - - name: sort - in: query - description: The object key to sort the results by. - schema: - type: string - example: name - - name: sort_asc - in: query - schema: - type: boolean - example: true - - name: page - in: query - schema: - type: integer - example: 1 - - name: items - in: query - schema: - type: integer - example: 5 - - name: owners - in: query - schema: - type: string - pattern: ^,+ - required: false - description: A list of owner_ids for filtering, separated by commas. - example: "1,2,3" - - name: teams - in: query - schema: - type: string - pattern: ^,+ - required: false - description: A list of team_ids for filtering, separated by commas. - example: "1,2,3" - responses: - "200": - description: A JSON Object containing an array of all metrics. - content: - application/json: - schema: - type: object - properties: - items: - type: integer - example: 1 - page: - type: integer - minimum: 1 - total: - type: integer - example: 1 - metrics: - type: array - items: - $ref: "#/components/schemas/Metric" - - /metrics/{metricId}: - get: - summary: Metric GET - description: "**Required Permissions**: `Metric Get` or `Metric Admin`" - parameters: - - name: metricId - in: path - required: true - schema: - type: integer - description: The id of the metric that you wish to get data from. - responses: - "200": - description: A JSON Object containing a metric's data. - content: - application/json: - schema: - type: object - properties: - metric: - $ref: "#/components/schemas/Metric" - - /permission_categories: - get: - summary: Permission Categories LIST - parameters: - - name: sort - in: query - description: The object key to sort the results by. - schema: - type: string - example: name - - name: sort_asc - in: query - schema: - type: boolean - example: true - - name: page - in: query - schema: - type: integer - example: 1 - - name: items - in: query - schema: - type: integer - example: 5 - responses: - "200": - description: A JSON Object containing an array of all permission categories. - content: - application/json: - schema: - type: object - properties: - permission_categories: - type: array - items: - $ref: "#/components/schemas/PermissionCategories" - - /permissions: - get: - summary: Permissions LIST - parameters: - - name: sort - in: query - description: The object key to sort the results by. - schema: - type: string - example: name - - name: sort_asc - in: query - schema: - type: boolean - example: true - - name: page - in: query - schema: - type: integer - example: 1 - - name: items - in: query - schema: - type: integer - example: 5 - responses: - "200": - description: A JSON Object containing an array of all permissions. - content: - application/json: - schema: - type: object - properties: - permissions: - type: array - items: - $ref: "#/components/schemas/Permission" - - /roles: - get: - summary: Roles LIST - description: "**Required Permissions**: `Role List` or `Role Admin`" - parameters: - - name: sort - in: query - description: The object key to sort the results by. - schema: - type: string - example: name - - name: sort_asc - in: query - schema: - type: boolean - example: true - - name: page - in: query - schema: - type: integer - example: 1 - - name: items - in: query - schema: - type: integer - example: 5 - responses: - "200": - description: A JSON Object containing an array of all roles. - content: - application/json: - schema: - type: object - properties: - items: - type: integer - page: - type: integer - minimum: 1 - total: - type: integer - roles: - type: array - items: - $ref: "#/components/schemas/Role" - - /roles/{roleId}: - get: - summary: Role GET - description: "**Required Permissions**: `Role Get` or `Role Admin`" - parameters: - - name: roleId - in: path - required: true - schema: - type: integer - description: The id of the Role that you wish to get data from. - responses: - "200": - description: A JSON Object containing a role's data. - content: - application/json: - schema: - type: object - properties: - role: - $ref: "#/components/schemas/Role" - - /segments: - get: - summary: Segments LIST - description: "**Required Permissions**: `Segment List` or `Segment Admin`" - parameters: - - name: sort - in: query - description: The object key to sort the results by. - schema: - type: string - example: name - - name: sort_asc - in: query - schema: - type: boolean - example: true - - name: page - in: query - schema: - type: integer - example: 1 - - name: items - in: query - schema: - type: integer - example: 5 - responses: - "200": - description: A JSON Object containing an array of all segments. - content: - application/json: - schema: - type: object - properties: - items: - type: integer - page: - type: integer - minimum: 1 - total: - type: integer - segments: - type: array - items: - $ref: "#/components/schemas/Segment" - - /segments/{segmentId}: - get: - summary: Segment GET - description: "**Required Permissions**: `Segment Get` or `Segment Admin`" - parameters: - - name: segmentId - in: path - required: true - schema: - type: integer - description: The id of the Segment that you wish to get data from. - responses: - "200": - description: A JSON Object containing a segment's data. - content: - application/json: - schema: - type: object - properties: - segment: - $ref: "#/components/schemas/Segment" - - /teams: - get: - summary: Teams LIST - description: "**Required Permissions**: `Team List` or `Team Admin`" - parameters: - - name: sort - in: query - description: The object key to sort the results by. - schema: - type: string - example: name - - name: sort_asc - in: query - schema: - type: boolean - example: true - - name: page - in: query - schema: - type: integer - example: 1 - - name: items - in: query - schema: - type: integer - example: 5 - responses: - "200": - description: A JSON Object containing an array of all teams. - content: - application/json: - schema: - type: object - properties: - items: - type: integer - page: - type: integer - minimum: 1 - total: - type: integer - teams: - type: array - items: - $ref: "#/components/schemas/Team" - - /teams/{teamId}: - get: - summary: Team GET - description: "**Required Permissions**: `Team Get` or `Team Admin`" - parameters: - - name: teamId - in: path - required: true - schema: - type: integer - description: The id of the Team that you wish to get data from. - responses: - "200": - description: A JSON Object containing a team's data. - content: - application/json: - schema: - type: object - properties: - team: - $ref: "#/components/schemas/Team" - - /unit_types: - get: - summary: Units LIST - description: "**Required Permissions**: `UnitType List` or `UnitType Admin`" - parameters: - - name: sort - in: query - description: The object key to sort the results by. - schema: - type: string - example: name - - name: sort_asc - in: query - schema: - type: boolean - example: true - - name: page - in: query - schema: - type: integer - example: 1 - - name: items - in: query - schema: - type: integer - example: 5 - responses: - "200": - description: A JSON Object containing an array of all units. - content: - application/json: - schema: - type: object - properties: - items: - type: integer - page: - type: integer - minimum: 1 - total: - type: integer - unit_types: - type: array - items: - $ref: "#/components/schemas/UnitType" - - /unit_types/{unitTypeId}: - get: - summary: Unit GET - description: "**Required Permissions**: `UnitType Get` or `UnitType Admin`" - parameters: - - name: unitTypeId - in: path - required: true - schema: - type: integer - description: The id of the Unit that you wish to get data from. - responses: - "200": - description: A JSON Object containing a unit's data. - content: - application/json: - schema: - type: object - properties: - unit_type: - $ref: "#/components/schemas/UnitType" - - /users: - get: - summary: Users LIST - description: "**Required Permissions**: `User List` or `User Admin`" - parameters: - - name: sort - in: query - description: The object key to sort the results by. - schema: - type: string - example: name - - name: sort_asc - in: query - schema: - type: boolean - example: true - - name: page - in: query - schema: - type: integer - example: 1 - - name: items - in: query - schema: - type: integer - example: 5 - responses: - "200": - description: A JSON Object containing an array of all users. - content: - application/json: - schema: - type: object - properties: - items: - type: integer - page: - type: integer - minimum: 1 - total: - type: integer - users: - type: array - items: - $ref: "#/components/schemas/User" - - /users/{userId}: - get: - summary: User GET - description: "**Required Permissions**: `User Get` or `User Admin`" - parameters: - - name: userId - in: path - required: true - schema: - type: integer - description: The id of the User that you wish to get data from. - responses: - "200": - description: A JSON Object containing a user's data. - content: - application/json: - schema: - type: object - properties: - user: - $ref: "#/components/schemas/User" - - /users/{userId}/api_keys: - get: - summary: User API keys GET - description: "**Required Permissions**: `User Get` or `User Admin`" - parameters: - - name: userId - in: path - required: true - schema: - type: integer - description: The id of the User that you wish to get the API Keys of. - responses: - "200": - description: A JSON Object containing an array of all API keys that are linked to a user. - content: - application/json: - schema: - type: object - properties: - items: - type: integer - page: - type: integer - minimum: 1 - total: - type: integer - user_api_keys: - type: array - items: - $ref: "#/components/schemas/ApiKey" - - /webhook_events: - get: - summary: Webhook Events LIST - description: "**Required Permissions**: `Webhook List` or `Webhook Admin`" - parameters: - - name: sort - in: query - description: The object key to sort the results by. - schema: - type: string - example: name - - name: sort_asc - in: query - schema: - type: boolean - example: true - - name: page - in: query - schema: - type: integer - example: 1 - - name: items - in: query - schema: - type: integer - example: 5 - responses: - "200": - description: A JSON Object containing an array of all webhook events. - content: - application/json: - schema: - type: object - properties: - items: - type: integer - page: - type: integer - minimum: 1 - total: - type: integer - webhook_events: - type: array - items: - $ref: "#/components/schemas/WebhookEvent" - - /webhooks: - get: - summary: Webhooks LIST - description: "**Required Permissions**: `Webhook List` or `Webhook Admin`" - parameters: - - name: sort - in: query - description: The object key to sort the results by. - schema: - type: string - example: name - - name: sort_asc - in: query - schema: - type: boolean - example: true - - name: page - in: query - schema: - type: integer - example: 1 - - name: items - in: query - schema: - type: integer - example: 5 - responses: - "200": - description: A JSON Object containing an array of all webhooks. - content: - application/json: - schema: - type: object - properties: - items: - type: integer - page: - type: integer - minimum: 1 - total: - type: integer - webhooks: - type: array - items: - $ref: "#/components/schemas/Webhook" - - /webhooks/{webhookId}: - get: - summary: Webhook GET - description: "**Required Permissions**: `Webhook Get` or `Webhook Admin`" - parameters: - - name: webhookId - in: path - required: true - schema: - type: integer - description: The id of the Webhook that you wish to get data from. - responses: - "200": - description: A JSON Object containing a webhook's data. - content: - application/json: - schema: - type: object - properties: - webhook: - $ref: "#/components/schemas/Webhook" - -components: - securitySchemes: - UserApiKey: - type: apiKey - in: header - description: A User API Key for API authorization. **Must be in the format "Api-Key your_user_api_key"** - name: Authorization - scheme: ^Api-Key\s\S+ - schemas: - Experiment: - type: object - properties: - id: - type: integer - example: 1 - name: - type: string - example: test_experiment - iteration: - type: integer - minimum: 1 - state: - type: string - example: running - development_at: - type: string - format: date-time - nullable: true - start_at: - type: string - format: date-time - nullable: true - stop_at: - type: string - format: date-time - nullable: true - example: null - full_on_at: - nullable: true - type: string - format: date-time - full_on_variant: - nullable: true - type: integer - minimum: 0 - maximum: 3 - last_seen_in_code_at: - type: string - format: date-time - nullable: true - nr_variants: - type: integer - maximum: 3 - minimum: 1 - example: 3 - percentages: - type: string - pattern: '\d{2}\/\d{2}\/\d{2}' - example: 34/33/33 - nullable: true - percentage_of_traffic: - type: integer - example: 100 - seed: - type: string - format: bigint - traffic_seed: - type: string - format: bigint - created_at: - type: string - format: date-time - created_by: - $ref: "#/components/schemas/User" - created_by_user_id: - type: integer - minimum: 1 - updated_at: - type: string - format: date-time - nullable: true - updated_by: - $ref: "#/components/schemas/User" - updated_by_user_id: - type: integer - minimum: 1 - nullable: true - description: - type: string - example: This experiment's description - unit_type: - $ref: "#/components/schemas/UnitType" - unit_type_id: - type: integer - example: 1 - primary_metric: - $ref: "#/components/schemas/Metric" - primary_metric_id: - type: integer - example: 20 - audience: - type: string - pattern: '\{"filter":{and:\[]}}' - audience_strict: - type: boolean - example: false - hypothesis: - type: string - prediction: - type: string - action_points: - type: string - implementation_details: - type: string - other: - type: string - minimum_detectable_effect: - type: integer - example: 10 - nullable: true - archived: - type: boolean - example: false - applications: - type: array - items: - $ref: "#/components/schemas/ExperimentApplication" - variants: - type: array - items: - $ref: "#/components/schemas/ExperimentVariant" - secondary_metrics: - type: array - items: - $ref: "#/components/schemas/ExperimentSecondaryMetric" - previews: - type: array - items: - $ref: "#/components/schemas/ExperimentPreview" - preview_variants: - type: array - items: - $ref: "#/components/schemas/ExperimentVariantPreview" - teams: - type: array - items: - $ref: "#/components/schemas/ExperimentTeam" - owners: - type: array - items: - $ref: "#/components/schemas/ExperimentOwner" - experiment_tags: - type: array - items: - $ref: "#/components/schemas/ExperimentExperimentTag" - notes: - type: array - items: - $ref: "#/components/schemas/ExperimentNote" - new_experiment_notes: - type: array - items: - $ref: "#/components/schemas/ExperimentNote" - favorited_users: - type: array - items: - $ref: "#/components/schemas/UserFavoriteExperiment" - alerts: - type: array - items: - $ref: "#/components/schemas/ExperimentAlert" - sample_size: - nullable: true - $ref: "#/components/schemas/ExperimentSampleSize" - variant_screnshots: - type: array - items: - $ref: "#/components/schemas/ExperimentVariantScreenshot" - - ExperimentVariantScreenshot: - type: object - properties: - experiment_id: - type: integer - example: 1 - variant: - type: integer - example: 2 - screenshot_file_upload_id: - type: integer - example: 14 - label: - type: string - example: Variant C's second iteration - experiment: - $ref: "#/components/schemas/Experiment" - file_upload: - $ref: "#/components/schemas/FileUpload" - - FileUsage: - type: object - properties: - id: - type: integer - name: - type: string - cropped: - type: boolean - example: false - resize_on_demand: - type: boolean - example: false - file_uploads: - type: array - items: - $ref: "#/components/schemas/FileUpload" - - FileUpload: - type: object - properties: - id: - type: integer - file_usage: - $ref: "#/components/schemas/FileUsage" - file_usage_id: - type: integer - width: - type: integer - example: 1080 - height: - type: integer - example: 720 - file_size: - type: integer - file_name: - type: string - example: avatar_john_doe.png - content_type: - type: string - example: image/png - base_url: - type: string - format: url - crop_left: - type: number - format: float - crop_top: - type: number - format: float - crop_width: - type: number - format: float - crop_height: - type: number - format: float - created_at: - type: string - format: date-time - created_by: - $ref: "#/components/schemas/User" - created_by_user_id: - type: integer - avatar_users: - type: array - items: - $ref: "#/components/schemas/User" - variant_screenshots: - type: array - items: - $ref: "#/components/schemas/ExperimentVariantScreenshot" - - ExperimentTag: - type: object - properties: - id: - type: integer - tag: - type: string - example: stack:backend - created_at: - type: string - format: date-time - created_by: - $ref: "#/components/schemas/User" - created_by_user_id: - type: integer - updated_at: - nullable: true - type: string - format: date-time - updated_by: - nullable: true - $ref: "#/components/schemas/User" - updated_by_user_id: - nullable: true - type: integer - experiments: - type: array - items: - $ref: "#/components/schemas/ExperimentExperimentTag" - - Team: - type: object - properties: - id: - type: integer - external_id: - nullable: true - type: integer - name: - type: string - example: "Marketing" - created_at: - type: string - format: date-time - created_by: - $ref: "#/components/schemas/User" - created_by_user_id: - type: integer - updated_at: - type: string - format: date-time - nullable: true - updated_by: - nullable: true - $ref: "#/components/schemas/User" - updated_by_user_id: - type: integer - nullable: true - users: - type: array - items: - $ref: "#/components/schemas/UserTeam" - experiments: - type: array - items: - $ref: "#/components/schemas/ExperimentTeam" - goals: - type: array - items: - $ref: "#/components/schemas/GoalTeam" - metrics: - type: array - items: - $ref: "#/components/schemas/MetricTeam" - - UserTeam: - type: object - properties: - user_id: - type: integer - user: - $ref: "#/components/schemas/User" - team_id: - type: integer - team: - $ref: "#/components/schemas/Team" - - GoalTeam: - type: object - properties: - goal_id: - type: integer - goal: - $ref: "#/components/schemas/Goal" - team_id: - type: integer - team: - $ref: "#/components/schemas/Team" - - MetricTeam: - type: object - properties: - metric_id: - type: integer - metric: - $ref: "#/components/schemas/Metric" - team_id: - type: integer - team: - $ref: "#/components/schemas/Team" - - Goal: - type: object - properties: - id: - type: integer - name: - type: string - example: purchase - description: - type: string - example: A goal for tracking how many purchases are made on any of our applications - created_at: - type: string - format: date-time - created_by: - $ref: "#/components/schemas/User" - created_by_user_id: - type: integer - updated_at: - type: string - format: date-time - nullable: true - updated_by: - nullable: true - $ref: "#/components/schemas/User" - updated_by_user_id: - type: integer - nullable: true - archived: - type: boolean - example: false - tags: - type: array - items: - $ref: "#/components/schemas/GoalGoalTag" - teams: - type: array - items: - $ref: "#/components/schemas/GoalTeam" - owners: - type: array - items: - $ref: "#/components/schemas/GoalOwner" - metrics: - type: array - items: - $ref: "#/components/schemas/Metric" - - GoalGoalTag: - type: object - properties: - goal_id: - type: integer - goal: - $ref: "#/components/schemas/Goal" - goal_tag_id: - type: integer - goal_tag: - $ref: "#/components/schemas/GoalTag" - - GoalOwner: - type: object - properties: - goal: - $ref: "#/components/schemas/Goal" - goal_id: - type: integer - user: - $ref: "#/components/schemas/User" - user_id: - type: integer - - GoalTag: - type: object - properties: - id: - type: integer - tag: - type: string - example: psychological:Trust - created_at: - type: string - format: date-time - created_by: - $ref: "#/components/schemas/User" - created_by_user_id: - type: integer - updated_at: - nullable: true - type: string - format: date-time - updated_by: - nullable: true - $ref: "#/components/schemas/User" - updated_by_user_id: - type: integer - nullable: true - goals: - type: array - items: - $ref: "#/components/schemas/GoalGoalTag" - - ExperimentSampleSize: - type: object - properties: - experiment: - $ref: "#/components/schemas/Experiment" - experiment_id: - type: integer - created_at: - type: string - format: date-time - updated_at: - type: string - format: date-time - nullable: true - required_sample_size: - type: integer - format: bigint - example: 109234 - reached_at: - type: string - format: date-time - nullable: true - example: null - reached_at_sample_size: - type: integer - format: bigint - nullable: true - example: null - - ExperimentPreview: - type: object - properties: - experiment: - $ref: "#/components/schemas/Experiment" - experiment_id: - type: integer - environment_type: - enum: [development, production] - unit_count: - type: integer - format: bigint - first_exposure_at: - nullable: true - type: string - format: date-time - last_exposure_at: - nullable: true - type: string - format: date-time - data_cutoff_at: - nullable: true - type: string - format: date-time - updated_at: - nullable: true - type: string - format: date-time - - ExperimentNote: - type: object - properties: - id: - type: integer - reply_to: - $ref: "#/components/schemas/ExperimentNote" - nullable: true - example: null - reply_to_note_id: - type: integer - nullable: true - example: null - experiment: - $ref: "#/components/schemas/Experiment" - experiment_id: - type: integer - action: - enum: - [ - create, - development, - start, - restart, - edit, - stop, - full_on, - comment, - archive, - unarchive, - ] - created_at: - type: string - format: date-time - created_by: - $ref: "#/components/schemas/User" - created_by_user_id: - type: integer - updated_at: - type: string - format: date-time - nullable: true - updated_by: - $ref: "#/components/schemas/User" - nullable: true - updated_by_user_id: - type: integer - nullable: true - note: - type: string - nullable: true - variant: - type: integer - nullable: true - new_experiment: - $ref: "#/components/schemas/Experiment" - nullable: true - new_experiment_id: - nullable: true - type: integer - reply_to_experiment_note: - type: array - items: - $ref: "#/components/schemas/ExperimentNote" - - ExperimentAlert: - type: object - properties: - id: - type: integer - experiment: - $ref: "#/components/schemas/Experiment" - experiment_id: - type: integer - type: - enum: - [ - cleanup_needed, - audience_mismatch, - sample_size_reached, - sample_ratio_mismatch, - ] - created_at: - type: string - format: date-time - updated_at: - type: string - format: date-time - nullable: true - metadata: - type: string - nullable: true - - ExperimentVariantPreview: - type: object - properties: - experiment: - $ref: "#/components/schemas/Experiment" - experiment_id: - type: integer - metric: - $ref: "#/components/schemas/Metric" - metric_id: - type: integer - environment_type: - enum: [development, production] - variant: - type: integer - maximum: 3 - unit_count: - type: integer - format: bigint - first_exposure_at: - nullable: true - type: string - format: date-time - last_exposure_at: - nullable: true - type: string - format: date-time - value: - type: number - format: decimal - mean: - type: number - format: decimal - variance: - type: number - format: decimal - pvalue: - nullable: true - type: number - format: float - impact: - nullable: true - type: number - format: float - impact_lower: - nullable: true - type: number - format: float - impact_upper: - nullable: true - type: number - format: float - - ExperimentApplication: - type: object - properties: - experiment: - $ref: "#/components/schemas/Experiment" - application: - $ref: "#/components/schemas/Application" - experiment_id: - type: integer - application_id: - type: integer - application_version: - type: integer - format: bigint - - Application: - type: object - properties: - id: - type: integer - name: - type: string - example: ios - description: - type: string - example: Our iOS app - created_at: - type: string - format: date-time - created_by: - $ref: "#/components/schemas/User" - created_by_user_id: - type: integer - updated_at: - type: string - format: date-time - nullable: true - updated_by: - $ref: "#/components/schemas/User" - nullable: true - updated_by_user_id: - nullable: true - type: integer - archived: - type: boolean - example: false - experiments: - type: array - items: - $ref: "#/components/schemas/ExperimentApplication" - - ExperimentTeam: - experiment: - $ref: "#/components/schemas/Experiment" - experiment_id: - type: integer - team: - $ref: "#/components/schemas/Team" - team_id: - type: integer - - ExperimentOwner: - experiment: - $ref: "#/components/schemas/Experiment" - experiment_id: - type: integer - user: - $ref: "#/components/schemas/User" - user_id: - type: integer - - ExperimentExperimentTag: - experiment: - $ref: "#/components/schemas/Experiment" - experiment_id: - type: integer - experiment_tag: - $ref: "#/components/schemas/ExperimentTag" - experiment_tag_id: - type: integer - - User: - type: object - properties: - archived: - type: boolean - example: false - avatar: - type: object - nullable: true - avatar_file_upload_url: - type: string - example: /cropUrl/100x100/1.png - created_at: - type: string - format: date-time - created_by_user_id: - type: integer - minimum: 1 - department: - type: string - example: Marketing - email: - type: string - format: email - - UserFavoriteExperiment: - type: object - properties: - user: - $ref: "#/components/schemas/User" - user_id: - type: integer - experiment: - $ref: "#/components/schemas/Experiment" - experiment_id: - type: integer - created_at: - type: string - format: date-time - - UnitType: - type: object - properties: - id: - type: integer - name: - type: string - example: user_id - description: - type: string - example: The ids of our users - created_at: - type: string - format: date-time - created_by_user_id: - type: integer - updated_at: - nullable: true - type: string - format: date-time - updated_by_user_id: - nullable: true - type: integer - created_by: - $ref: "#/components/schemas/User" - archived: - type: boolean - example: false - - Metric: - type: object - properties: - id: - type: integer - goal_id: - type: integer - example: 70 - name: - type: string - example: Time to Book - description: - type: string - example: The amount of time before a booking has been made - type: - type: string - example: "goal_time_to_achievement" - effect: - type: string - enum: [positive, negative, unknown] - archived: - type: boolean - example: false - format_str: - type: string - example: "{}s" - scale: - type: integer - example: 1 - precision: - type: number - example: 0 - value_source_property: - type: string - example: "" - property_filter: - type: string - example: "" - created_at: - type: string - format: date-time - created_by_user_id: - type: integer - example: 1 - updated_at: - nullable: true - type: string - format: date-time - updated_by_user_id: - nullable: true - type: integer - goal: - $ref: "#/components/schemas/Goal" - tags: - type: array - items: - $ref: "#/components/schemas/MetricTag" - owners: - type: array - items: - $ref: "#/components/schemas/MetricOwner" - teams: - type: array - items: - $ref: "#/components/schemas/MetricTeam" - - MetricOwner: - type: object - properties: - metric_id: - type: integer - user_id: - type: integer - user: - $ref: "#/components/schemas/User" - - ExperimentVariant: - type: object - properties: - config: - type: string - example: "" - experiment_id: - type: integer - example: 1 - name: - type: string - example: Red Button - variant: - type: integer - minimum: 0 - maximum: 3 - - ExperimentSecondaryMetric: - type: object - properties: - experiment: - $ref: "#/components/schemas/Experiment" - experiment_id: - type: integer - metric: - $ref: "#/components/schemas/Metric" - metric_id: - type: integer - - ExperimentWritable: - type: object - properties: - name: - type: string - example: experiment_name - iteration: - type: integer - minimum: 1 - state: - enum: [created, development, running, stopped] - nr_variants: - type: integer - example: 1 - percentages: - type: string - example: 34/33/33 - percentage_of_traffic: - type: integer - example: 100 - description: - type: string - example: An experiment into whether changing our cta_button to red will effect our monthly revenue - unit_type: - $ref: "#/components/schemas/ExperimentWritableUnitType" - owners: - type: array - items: - $ref: "#/components/schemas/ExperimentWritableOwner" - teams: - type: array - items: - $ref: "#/components/schemas/ExperimentWritableTeam" - experiment_tags: - type: array - items: - $ref: "#/components/schemas/ExperimentWritableTag" - hypothesis: - type: string - prediction: - type: string - action_points: - type: string - audience: - type: string - audience_strict: - type: boolean - example: true - implementation_details: - type: string - other: - type: string - applications: - type: array - items: - $ref: "#/components/schemas/ExperimentWritableApplication" - primary_metric: - $ref: "#/components/schemas/ExperimentWritableMetric" - secondary_metrics: - type: array - items: - $ref: "#/components/schemas/ExperimentWritableMetric" - variants: - type: array - items: - $ref: "#/components/schemas/ExperimentVariant" - variant_screenshots: - type: array - items: - $ref: "#/components/schemas/ExperimentVariantScreenshotWritable" - minimum_detectable_effect: - nullable: true - type: string - - ExperimentWritableUnitType: - type: object - properties: - unit_type_id: - type: integer - - ExperimentWritableOwner: - type: object - properties: - user_id: - type: integer - - ExperimentWritableTeam: - type: object - properties: - team_id: - type: integer - - ExperimentWritableTag: - type: object - properties: - experiment_tag_id: - type: integer - - ExperimentWritableApplication: - type: object - properties: - application_id: - type: integer - application_version: - type: string - - ExperimentWritableMetric: - type: object - properties: - metric_id: - type: integer - - ExperimentVariantScreenshotWritable: - type: object - properties: - variant: - type: integer - label: - type: string - file_upload: - $ref: "#/components/schemas/FileUploadWritable" - - FileUploadWritable: - type: object - properties: - data: - type: string - content_type: - type: string - example: image/png - file_name: - type: string - example: headshot.png - file_size: - type: integer - width: - type: integer - example: 500 - height: - type: integer - example: 500 - crop_left: - type: integer - crop_top: - type: integer - crop_width: - type: integer - crop_height: - type: integer - temp_url: - nullable: true - type: string - format: url - - ApiKey: - type: object - properties: - id: - type: integer - name: - type: string - example: All CRUD API Key - description: - type: string - example: An API key with all permissions - key: - type: string - format: uuid - permissions: - type: string - pattern: "create,edit,delete,read" - used_at: - nullable: true - type: string - format: date-time - created_at: - type: string - format: date-time - created_by_user_id: - type: integer - updated_at: - nullable: true - type: string - format: date-time - updated_by_user_id: - nullable: true - type: integer - created_by: - $ref: "#/components/schemas/User" - - CORS: - type: object - properties: - id: - type: integer - type: - enum: [regex, specific] - example: specific - origin: - type: string - format: url - description: - type: string - example: Our homepage - created_at: - type: string - format: date-time - created_by_user_id: - type: integer - updated_at: - nullable: true - type: string - format: date-time - updated_by_user_id: - nullable: true - type: integer - created_by: - $ref: "#/components/schemas/User" - - Environment: - type: object - properties: - id: - type: integer - name: - type: string - example: Sandbox - description: - type: string - example: Our sandbox environment. - type: - enum: [development, production] - archived: - type: boolean - example: false - created_at: - type: string - format: date-time - created_by_user_id: - type: integer - updated_at: - nullable: true - type: string - format: date-time - updated_by_user_id: - nullable: true - type: integer - created_by: - $ref: "#/components/schemas/User" - updated_by: - nullable: true - $ref: "#/components/schemas/User" - - ExperimentAnnotation: - type: object - properties: - id: - type: integer - timestamp: - type: string - format: date-time - description: - type: string - example: This was just after a successful marketing campaign - color: - type: string - pattern: ^#[A-Fa-f0-9]{6} - example: "#CFC8FF" - type: - enum: [local, global] - experiment_id: - type: integer - created_at: - type: string - format: date-time - created_by_user_id: - type: integer - updated_at: - nullable: true - type: string - format: date-time - updated_by_user_id: - nullable: true - type: integer - created_by: - $ref: "#/components/schemas/User" - updated_by: - nullable: true - $ref: "#/components/schemas/User" - - MetricTag: - type: object - properties: - id: - type: integer - tag: - type: string - example: location:Header - created_at: - type: string - format: date-time - created_by_user_id: - type: integer - updated_at: - nullable: true - type: string - format: date-time - updated_by_user_id: - nullable: true - type: integer - - PermissionCategories: - type: object - properties: - id: - type: integer - name: - type: string - permissions: - type: array - items: - $ref: "#/components/schemas/Permission" - - Permission: - type: object - properties: - id: - type: integer - name: - type: string - description: - type: string - category_id: - type: integer - - Role: - type: object - properties: - id: - type: integer - name: - type: string - example: Admin - description: - type: string - example: A role with all permissions except user CRUD - created_at: - type: string - format: date-time - created_by_user_id: - type: integer - updated_at: - nullable: true - type: string - format: date-time - updated_by_user_id: - nullable: true - type: integer - deletable: - type: boolean - default_user_role: - type: boolean - example: false - full_admin_role: - type: boolean - example: false - permissions: - type: array - items: - type: object - properties: - permission_id: - type: integer - role_id: - type: integer - permission: - $ref: "#/components/schemas/Permission" - created_by: - $ref: "#/components/schemas/User" - - Segment: - type: object - properties: - id: - type: integer - name: - type: string - example: Language - description: - type: string - example: The user's language - value_source_attribute: - type: string - example: language - created_at: - type: string - format: date-time - created_by_user_id: - type: integer - updated_at: - nullable: true - type: string - format: date-time - updated_by_user_id: - nullable: true - type: integer - created_by: - $ref: "#/components/schemas/User" - - WebhookEvent: - type: object - properties: - id: - type: integer - name: - type: string - example: ExperimentCreated - description: - type: string - example: Event generated when an experiment draft is created. - - Webhook: - type: object - properties: - id: - type: integer - name: - type: string - example: Slack - description: - type: string - example: Our connection between experiments and Slack - url: - type: string - format: url - enabled: - type: boolean - example: true - ordered: - type: boolean - example: false - max_retries: - type: integer - example: 10 - created_at: - type: string - format: date-time - created_by_user_id: - type: integer - updated_at: - nullable: true - type: string - format: date-time - updated_by_user_id: - nullable: true - type: integer - created_by: - $ref: "#/components/schemas/User" - events: - type: array - items: - type: object - properties: - webhook_id: - type: integer - webhook_event_id: - type: integer - enabled: - type: boolean - event: - $ref: "#/components/schemas/WebhookEvent" diff --git a/openapi_console/components/parameters.yaml b/openapi_console/components/parameters.yaml new file mode 100644 index 00000000..1abb69a2 --- /dev/null +++ b/openapi_console/components/parameters.yaml @@ -0,0 +1,20 @@ +components: + parameters: + Pagination: + - name: sort + in: query + schema: + type: string + example: "created_at" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 diff --git a/openapi_console/openapi.yaml b/openapi_console/openapi.yaml new file mode 100644 index 00000000..34ad79f7 --- /dev/null +++ b/openapi_console/openapi.yaml @@ -0,0 +1,194 @@ +openapi: 3.0.0 +info: + title: ABsmartly Web Console API + version: 1.0.0 + description: An OpenAPI Specification that describes the ABsmartly API for working with your experiments programmatically. + contact: + name: API Support + email: api@absmartly.com + license: + name: Proprietary +externalDocs: + description: Find out more about ABsmartly + url: "https://www.absmartly.com" +servers: + - url: https://sandbox.absmartly.com/v1 +security: + - UserApiKey: [] + +# Path references +paths: + # Experiments + /experiments: + $ref: "./paths/experiments.yaml#/experiments" + /experiments/{experimentId}: + $ref: "./paths/experiments.yaml#/experiments_by_id" + /experiments/{experimentId}/participants/history: + $ref: "./paths/experiments.yaml#/experiments_participants_history" + /experiments/{experimentId}/metrics/main/history: + $ref: "./paths/experiments.yaml#/experiments_metrics_main_history" + /experiments/{experimentId}/metrics/main: + $ref: "./paths/experiments.yaml#/experiments_metrics_main" + /experiments/{experimentId}/activity: + $ref: "./paths/experiments.yaml#/experiments_activity" + /experiments/{experimentId}/activity/{commentId}/reply: + $ref: "./paths/experiments.yaml#/experiments_activity_reply" + /experiment_annotations: + $ref: "./paths/experiments.yaml#/experiment_annotations" + /experiment_annotations/{experimentAnnotationId}: + $ref: "./paths/experiments.yaml#/experiment_annotations_by_id" + /experiment_tags: + $ref: "./paths/experiments.yaml#/experiment_tags" + /experiment_tags/{experimentTagId}: + $ref: "./paths/experiments.yaml#/experiment_tags_by_id" + /experiments/{experimentId}/tags/{experimentTagId}: + $ref: "./paths/experiments.yaml#/experiment_tags_by_id" + /experiments/{experimentId}/annotations: + $ref: "./paths/experiments.yaml#/experiment_annotations" + /experiments/{experimentId}/annotations/{annotationId}: + $ref: "./paths/experiments.yaml#/experiment_annotations_by_id" + /experiment_recommended_actions/{id}/dismiss: + $ref: "./paths/experiments.yaml#/experiment_recommended_actions_dismiss" + + # API Keys + /api_keys: + $ref: "./paths/api_keys.yaml#/api_keys" + /api_keys/{apiKeyId}: + $ref: "./paths/api_keys.yaml#/api_keys_by_id" + + # Applications + /applications: + $ref: "./paths/applications.yaml#/applications" + /applications/{applicationId}: + $ref: "./paths/applications.yaml#/applications_by_id" + + # CORS Origins + /cors_origins: + $ref: "./paths/cors_origins.yaml#/cors_origins" + /cors_origins/{corsOriginId}: + $ref: "./paths/cors_origins.yaml#/cors_origins_by_id" + + # Environments + /environments: + $ref: "./paths/environments.yaml#/environments" + /environments/{environmentId}: + $ref: "./paths/environments.yaml#/environments_by_id" + + # Goals + /goals: + $ref: "./paths/goals.yaml#/goals" + /goals/{goalId}: + $ref: "./paths/goals.yaml#/goals_by_id" + /goal_tags: + $ref: "./paths/goals.yaml#/goal_tags" + /goal_tags/{goalTagId}: + $ref: "./paths/goals.yaml#/goal_tags_by_id" + + # Metrics + /metrics: + $ref: "./paths/metrics.yaml#/metrics" + /metrics/{metricId}: + $ref: "./paths/metrics.yaml#/metrics_by_id" + /metric_tags: + $ref: "./paths/metrics.yaml#/metric_tags" + /metric_tags/{metricTagId}: + $ref: "./paths/metrics.yaml#/metric_tags_by_id" + + # Permissions and Roles + /permission_categories: + $ref: "./paths/permissions_and_roles.yaml#/permission_categories" + /permissions: + $ref: "./paths/permissions_and_roles.yaml#/permissions" + /roles: + $ref: "./paths/permissions_and_roles.yaml#/roles" + /roles/{roleId}: + $ref: "./paths/permissions_and_roles.yaml#/roles_by_id" + + # Segments + /segments: + $ref: "./paths/segments.yaml#/segments" + /segments/{segmentId}: + $ref: "./paths/segments.yaml#/segments_by_id" + + # Users and Teams + /teams: + $ref: "./paths/users_and_teams.yaml#/teams" + /teams/{teamId}: + $ref: "./paths/users_and_teams.yaml#/teams_by_id" + /users: + $ref: "./paths/users_and_teams.yaml#/users" + /users/{userId}: + $ref: "./paths/users_and_teams.yaml#/users_by_id" + /users/{userId}/api_keys: + $ref: "./paths/users_and_teams.yaml#/users_api_keys" + + # Unit Types + /unit_types: + $ref: "./paths/unit_types.yaml#/unit_types" + /unit_types/{unitTypeId}: + $ref: "./paths/unit_types.yaml#/unit_types_by_id" + + # Webhooks + /webhook_events: + $ref: "./paths/webhooks.yaml#/webhook_events" + /webhooks: + $ref: "./paths/webhooks.yaml#/webhooks" + /webhooks/{webhookId}: + $ref: "./paths/webhooks.yaml#/webhooks_by_id" + + # Files + /files/{usage}/{id}/{action}/{filename}: + $ref: "./paths/files.yaml#/files_usage_id_action_filename" + + # Insights + /insights: + $ref: "./paths/insights.yaml#/insights" + /insights/velocity/widgets: + $ref: "./paths/insights.yaml#/insightsvelocitywidgets" + /insights/velocity/history: + $ref: "./paths/insights.yaml#/insightsvelocityhistory" + /insights/decisions/widgets: + $ref: "./paths/insights.yaml#/insightsdecisionswidgets" + /insights/decisions/history: + $ref: "./paths/insights.yaml#/insightsdecisionshistory" + + # Export Configs + /export_configs: + $ref: "./paths/export_configs.yaml#/export_configs" + /export_configs/{id}: + $ref: "./paths/export_configs.yaml#/export_configs_by_id" + /export_configs/{id}/export_histories: + $ref: "./paths/export_configs.yaml#/export_configs_id_export_histories" + /export_configs/{id}/export_histories/{history_id}: + $ref: "./paths/export_configs.yaml#/export_configs_id_export_histories_by_history_id" + + # Storage Configs + /storage_configs: + $ref: "./paths/storage_configs.yaml#/storage_configs" + /storage_configs/{id}: + $ref: "./paths/storage_configs.yaml#/storage_configs_by_id" + /storage_configs/test: + $ref: "./paths/storage_configs.yaml#/storage_configs_test" + + # Configs + /configs: + $ref: "./paths/configs.yaml#/configs" + /configs/{id}: + $ref: "./paths/configs.yaml#/configs_by_id" + + # Experiment Custom Sections + /experiment_custom_sections: + $ref: "./paths/experiment_custom_sections.yaml#/experiment_custom_sections" + /experiment_custom_sections/{id}: + $ref: "./paths/experiment_custom_sections.yaml#/experiment_custom_sections_by_id" + /experiment_custom_sections/order: + $ref: "./paths/experiment_custom_sections.yaml#/experiment_custom_sections_order" + +# Components reference +components: + schemas: {} + securitySchemes: + bearerAuth: + type: http + scheme: bearer + bearerFormat: JWT diff --git a/openapi_console/paths/access_control_policies.yaml b/openapi_console/paths/access_control_policies.yaml new file mode 100644 index 00000000..0b28bccc --- /dev/null +++ b/openapi_console/paths/access_control_policies.yaml @@ -0,0 +1,257 @@ +access_control_policies: + get: + summary: Access Control Policies [LIST] + description: "**Required Permissions**: `Admin`" + parameters: + - name: sort + in: query + schema: + type: string + example: "created_at" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + tags: + - Access Control Policies + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/AccessControlPolicy" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + post: + summary: Access Control Policy [CREATE] + description: "**Required Permissions**: `Admin`" + tags: + - Access Control Policies + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: "Name of the access control policy" + example: "Deny Experiment Creation" + effect: + type: string + description: "Effect of the policy (allow/deny)" + enum: ["allow", "deny"] + example: "deny" + condition: + type: string + description: "Condition expression for the policy" + example: "context.user.role !== 'admin'" + description: + type: string + description: "Description of the policy" + example: "Prevents non-admin users from creating experiments" + category_id: + type: integer + description: "ID of the permission category" + example: 1 + required: + - name + - effect + - category_id + responses: + "201": + description: Created + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + example: true + access_control_policy: + $ref: "#/components/schemas/AccessControlPolicy" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + +access_control_policies_by_id: + get: + summary: Access Control Policy [GET] + description: "**Required Permissions**: `Admin`" + parameters: + - name: policyId + in: path + required: true + schema: + type: integer + tags: + - Access Control Policies + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + access_control_policy: + $ref: "#/components/schemas/AccessControlPolicy" + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Access Control Policy not found + put: + summary: Access Control Policy [UPDATE] + description: "**Required Permissions**: `Admin`" + parameters: + - name: policyId + in: path + required: true + schema: + type: integer + tags: + - Access Control Policies + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: "Name of the access control policy" + example: "Deny Experiment Creation" + effect: + type: string + description: "Effect of the policy (allow/deny)" + enum: ["allow", "deny"] + example: "deny" + condition: + type: string + description: "Condition expression for the policy" + example: "context.user.role !== 'admin'" + description: + type: string + description: "Description of the policy" + example: "Prevents non-admin users from creating experiments" + category_id: + type: integer + description: "ID of the permission category" + example: 1 + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + example: true + access_control_policy: + $ref: "#/components/schemas/AccessControlPolicy" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Access Control Policy not found + delete: + summary: Access Control Policy [DELETE] + description: "**Required Permissions**: `Admin`" + parameters: + - name: policyId + in: path + required: true + schema: + type: integer + tags: + - Access Control Policies + responses: + "204": + description: No Content + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Access Control Policy not found + +# Components +components: + schemas: + AccessControlPolicy: + type: object + description: "Represents an access control policy for permissions" + properties: + id: + type: integer + description: "Unique identifier for the access control policy" + example: 1 + name: + type: string + description: "Name of the access control policy" + example: "Deny Experiment Creation" + effect: + type: string + description: "Effect of the policy (allow/deny)" + enum: ["allow", "deny"] + example: "deny" + condition: + type: string + description: "Condition expression for the policy" + example: "context.user.role !== 'admin'" + description: + type: string + description: "Description of the policy" + example: "Prevents non-admin users from creating experiments" + category_id: + type: integer + description: "ID of the permission category" + example: 1 + required: + - id + - name + - effect + - category_id diff --git a/openapi_console/paths/api_keys.yaml b/openapi_console/paths/api_keys.yaml new file mode 100644 index 00000000..833d88c1 --- /dev/null +++ b/openapi_console/paths/api_keys.yaml @@ -0,0 +1,263 @@ +api_keys: + get: + summary: API Key [LIST] + description: "**Required Permissions**: `ApiKey List` or `ApiKey Admin`" + parameters: + - name: sort + in: query + schema: + type: string + example: "created_at" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/ApiKey" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + post: + summary: API Key [CREATE] + description: "**Required Permissions**: `ApiKey Create` or `ApiKey Admin`" + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + api_key: + type: object + properties: + name: + type: string + example: "My API Key" + application_id: + type: integer + example: 1 + environment_id: + type: integer + example: 1 + role_id: + type: integer + example: 1 + required: + - name + - application_id + - environment_id + - role_id + required: + - api_key + responses: + "201": + description: Created + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + api_key: + $ref: "#/components/schemas/ApiKey" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + +api_keys_by_id: + get: + summary: API Key [GET] + description: "**Required Permissions**: `ApiKey Get` or `ApiKey Admin`" + parameters: + - name: apiKeyId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + api_key: + $ref: "#/components/schemas/ApiKey" + put: + summary: API Key [UPDATE] + description: "**Required Permissions**: `ApiKey Edit` or `ApiKey Admin`" + parameters: + - name: apiKeyId + in: path + required: true + schema: + type: integer + description: The id of the API Key that you wish to update. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + api_key: + type: object + properties: + name: + type: string + example: "My Updated API Key" + application_id: + type: integer + example: 1 + environment_id: + type: integer + example: 1 + role_id: + type: integer + example: 1 + required: + - api_key + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + api_key: + $ref: "#/components/schemas/ApiKey" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: API Key not found + delete: + summary: API Key [DELETE] + description: "**Required Permissions**: `ApiKey Delete` or `ApiKey Admin`" + parameters: + - name: apiKeyId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: API Key not found + +# Components +components: + schemas: + ApiKey: + type: object + properties: + id: + type: integer + description: "Unique identifier for the API key" + example: 1 + name: + type: string + description: "Name of the API key" + example: "Production API Key" + key: + type: string + description: "The actual API key value (only shown once upon creation)" + example: "sk_test_abc123def456" + application_id: + type: integer + description: "ID of the application this API key is associated with" + example: 1 + environment_id: + type: integer + description: "ID of the environment this API key is associated with" + example: 2 + role_id: + type: integer + description: "ID of the role that defines permissions for this API key" + example: 3 + user_id: + type: integer + description: "ID of the user who created this API key" + example: 101 + last_used_at: + type: string + format: date-time + description: "When the API key was last used" + example: "2023-02-15T10:30:00Z" + created_at: + type: string + format: date-time + description: "When the API key was created" + example: "2023-01-01T00:00:00Z" + updated_at: + type: string + format: date-time + description: "When the API key was last updated" + example: "2023-01-02T00:00:00Z" + required: + - id + - name + - application_id + - environment_id + - role_id diff --git a/openapi_console/paths/applications.yaml b/openapi_console/paths/applications.yaml new file mode 100644 index 00000000..1720f3bd --- /dev/null +++ b/openapi_console/paths/applications.yaml @@ -0,0 +1,252 @@ +applications: + get: + summary: Application [LIST] + description: "**Required Permissions**: `Application List` or `Application Admin`" + parameters: + - name: sort + in: query + schema: + type: string + example: "created_at" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/Application" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + post: + summary: Application [CREATE] + description: "**Required Permissions**: `Application Create` or `Application Admin`" + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + application: + type: object + properties: + name: + type: string + example: "My Application" + full_name: + type: string + example: "My Application Full Name" + description: + type: string + example: "Description of my application" + required: + - name + - full_name + required: + - application + responses: + "201": + description: Created + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + application: + $ref: "#/components/schemas/Application" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + +applications_by_id: + get: + summary: Application [GET] + description: "**Required Permissions**: `Application Get` or `Application Admin`" + parameters: + - name: applicationId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + application: + $ref: "#/components/schemas/Application" + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Application not found + put: + summary: Application [UPDATE] + description: "**Required Permissions**: `Application Edit` or `Application Admin`" + parameters: + - name: applicationId + in: path + required: true + schema: + type: integer + description: The id of the Application that you wish to update. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + application: + type: object + properties: + name: + type: string + example: "Updated Application Name" + full_name: + type: string + example: "Updated Application Full Name" + description: + type: string + example: "Updated description of my application" + required: + - application + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + application: + $ref: "#/components/schemas/Application" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Application not found + delete: + summary: Application [DELETE] + description: "**Required Permissions**: `Application Delete` or `Application Admin`" + parameters: + - name: applicationId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Application not found + +components: + schemas: + Application: + type: object + description: "Represents an application for which experiments can be run" + properties: + id: + type: integer + description: "Unique identifier for the application" + example: 1 + name: + type: string + description: "Short name of the application, used in code. Max length 64 characters." + example: "website" + maxLength: 64 + full_name: + type: string + description: "Full name of the application. Max length 256 characters." + example: "Company Website" + maxLength: 256 + description: + type: string + description: "Detailed description of the application. Max length 8192 characters." + example: "The main marketing website for the company" + maxLength: 8192 + created_at: + type: string + format: date-time + description: "When the application was created" + example: "2023-01-01T00:00:00Z" + updated_at: + type: string + format: date-time + description: "When the application was last updated" + example: "2023-01-02T00:00:00Z" + required: + - id + - name + - full_name + example: + id: 1 + name: "website" + full_name: "Company Website" + description: "The main marketing website for the company" + created_at: "2023-01-01T00:00:00Z" + updated_at: "2023-01-02T00:00:00Z" diff --git a/openapi_console/paths/configs.yaml b/openapi_console/paths/configs.yaml new file mode 100644 index 00000000..b0a4bb32 --- /dev/null +++ b/openapi_console/paths/configs.yaml @@ -0,0 +1,167 @@ +configs: + get: + summary: Configs [LIST] + description: "**Required Permissions**: `Config List` or `Config Admin`" + parameters: + - name: sort + in: query + schema: + type: string + example: "name" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + tags: + - Configs + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/Config" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + +configs_by_id: + parameters: + - name: id + in: path + required: true + schema: + type: integer + description: "Unique identifier for the configuration" + get: + summary: Configs [GET] + description: "**Required Permissions**: `Config List` or `Config Admin`" + tags: + - Configs + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/Config" + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Not Found + + put: + summary: Configs [UPDATE] + description: "**Required Permissions**: `Config Update` or `Config Admin`" + tags: + - Configs + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + value: + type: string + description: "Configuration value" + example: "true" + required: + - value + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/Config" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Not Found + +# Components +components: + schemas: + Config: + type: object + description: "System configuration setting" + properties: + id: + type: integer + description: "Unique identifier for the config" + example: 1 + name: + type: string + description: "Configuration name/key" + example: "experiment_form_default_required_alpha" + value: + type: string + description: "Configuration value" + example: "0.05" + default_value: + type: string + description: "Default value if no override is set" + example: "0.05" + display_name: + type: string + description: "Human-readable display name for the config" + example: "Default Required Alpha" + description: + type: string + description: "Description of the config" + example: "The default required alpha (significance level) for experiments" + created_at: + type: string + format: date-time + description: "Timestamp when the config was created" + created_by_user_id: + type: integer + description: "ID of the user who created the config" + updated_at: + type: string + format: date-time + description: "Timestamp when the config was last updated" + updated_by_user_id: + type: integer + description: "ID of the user who last updated the config" + required: + - id + - name + - default_value diff --git a/openapi_console/paths/cors_origins.yaml b/openapi_console/paths/cors_origins.yaml new file mode 100644 index 00000000..81e9f0cc --- /dev/null +++ b/openapi_console/paths/cors_origins.yaml @@ -0,0 +1,410 @@ +openapi: 3.0.3 +info: + title: ABSmartly API + version: 0.1.0 +paths: + /applications/{application_id}/cors-origins: + get: + summary: CORS Allowed Origins [LIST] + description: "**Required Permissions**: `Application View` or `Application Edit` or `Application Admin`" + operationId: listCorsAllowedOrigins + parameters: + - name: application_id + in: path + description: Application ID + required: true + schema: + type: integer + format: int64 + - $ref: "../components/parameters.yaml#/components/parameters/Pagination" + - name: sort + in: query + description: Sort specification + required: false + schema: + type: string + default: id.asc + - name: filter + in: query + description: Filter specification + required: false + schema: + type: string + tags: + - CORS Allowed Origins + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/CorsAllowedOrigin" + metadata: + type: object + properties: + count: + type: integer + description: Number of items + limit: + type: integer + description: Pagination limit + offset: + type: integer + description: Pagination offset + "401": + description: Unauthorized + "403": + description: Forbidden + post: + summary: CORS Allowed Origin [CREATE] + description: "**Required Permissions**: `Application Edit` or `Application Admin`" + operationId: createCorsAllowedOrigin + parameters: + - name: application_id + in: path + description: Application ID + required: true + schema: + type: integer + format: int64 + tags: + - CORS Allowed Origins + requestBody: + content: + application/json: + schema: + type: object + properties: + origin: + type: string + description: "Origin URL" + example: "https://example.com" + required: + - origin + responses: + "201": + description: Created + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + example: true + cors_allowed_origin: + $ref: "#/components/schemas/CorsAllowedOrigin" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + /applications/{application_id}/cors-origins/{cors_origin_id}: + get: + summary: CORS Allowed Origin [GET] + description: "**Required Permissions**: `Application View` or `Application Edit` or `Application Admin`" + operationId: getCorsAllowedOrigin + parameters: + - name: application_id + in: path + description: Application ID + required: true + schema: + type: integer + format: int64 + - name: cors_origin_id + in: path + description: CORS Allowed Origin ID + required: true + schema: + type: integer + format: int64 + tags: + - CORS Allowed Origins + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + cors_allowed_origin: + $ref: "#/components/schemas/CorsAllowedOrigin" + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: CORS Allowed Origin not found + delete: + summary: CORS Allowed Origin [DELETE] + description: "**Required Permissions**: `Application Edit` or `Application Admin`" + operationId: deleteCorsAllowedOrigin + parameters: + - name: application_id + in: path + description: Application ID + required: true + schema: + type: integer + format: int64 + - name: cors_origin_id + in: path + description: CORS Allowed Origin ID + required: true + schema: + type: integer + format: int64 + tags: + - CORS Allowed Origins + responses: + "204": + description: No Content + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: CORS Allowed Origin not found + +# Define standalone paths for the main OpenAPI file to reference +cors_origins: + get: + summary: CORS Origins [LIST] + description: "**Required Permissions**: `Application View` or `Application Admin`" + operationId: listCorsOrigins + parameters: + - name: sort + in: query + schema: + type: string + example: "created_at" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + tags: + - CORS Origins + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/CorsAllowedOrigin" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + post: + summary: CORS Origin [CREATE] + description: "**Required Permissions**: `Application Edit` or `Application Admin`" + operationId: createCorsOrigin + tags: + - CORS Origins + requestBody: + content: + application/json: + schema: + type: object + properties: + origin: + type: string + description: "Origin URL" + example: "https://example.com" + application_id: + type: integer + description: "ID of the application this CORS rule belongs to" + example: 1 + required: + - origin + - application_id + responses: + "201": + description: Created + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + example: true + cors_allowed_origin: + $ref: "#/components/schemas/CorsAllowedOrigin" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + +cors_origins_by_id: + get: + summary: CORS Origin [GET] + description: "**Required Permissions**: `Application View` or `Application Admin`" + operationId: getCorsOrigin + parameters: + - name: corsOriginId + in: path + required: true + schema: + type: integer + tags: + - CORS Origins + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + cors_allowed_origin: + $ref: "#/components/schemas/CorsAllowedOrigin" + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: CORS Origin not found + put: + summary: CORS Origin [UPDATE] + description: "**Required Permissions**: `Application Edit` or `Application Admin`" + operationId: updateCorsOrigin + parameters: + - name: corsOriginId + in: path + required: true + schema: + type: integer + tags: + - CORS Origins + requestBody: + content: + application/json: + schema: + type: object + properties: + origin: + type: string + description: "Origin URL" + example: "https://example.com" + application_id: + type: integer + description: "ID of the application this CORS rule belongs to" + example: 1 + required: + - origin + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + example: true + cors_allowed_origin: + $ref: "#/components/schemas/CorsAllowedOrigin" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: CORS Origin not found + delete: + summary: CORS Origin [DELETE] + description: "**Required Permissions**: `Application Edit` or `Application Admin`" + operationId: deleteCorsOrigin + parameters: + - name: corsOriginId + in: path + required: true + schema: + type: integer + tags: + - CORS Origins + responses: + "204": + description: No Content + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: CORS Origin not found + +# Components +components: + schemas: + CorsAllowedOrigin: + type: object + description: "Represents an allowed origin for Cross-Origin Resource Sharing (CORS)" + properties: + id: + type: integer + description: "Unique identifier for the CORS allowed origin" + example: 1 + origin: + type: string + description: "The allowed origin URL" + example: "https://example.com" + application_id: + type: integer + description: "ID of the application this CORS rule belongs to" + example: 1 + created_at: + type: string + format: date-time + description: "When the CORS rule was created" + example: "2023-01-01T00:00:00Z" + updated_at: + type: string + format: date-time + description: "When the CORS rule was last updated" + example: "2023-01-02T00:00:00Z" + required: + - id + - origin + - application_id diff --git a/openapi_console/paths/environments.yaml b/openapi_console/paths/environments.yaml new file mode 100644 index 00000000..0c05ef7d --- /dev/null +++ b/openapi_console/paths/environments.yaml @@ -0,0 +1,240 @@ +environments: + get: + summary: Environment [LIST] + description: "**Required Permissions**: `Environment List` or `Environment Admin`" + parameters: + - name: sort + in: query + schema: + type: string + example: "created_at" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/Environment" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + post: + summary: Environment [CREATE] + description: "**Required Permissions**: `Environment Create` or `Environment Admin`" + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + environment: + type: object + properties: + name: + type: string + example: "Production" + application_id: + type: integer + example: 1 + required: + - name + - application_id + required: + - environment + responses: + "201": + description: Created + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + environment: + $ref: "#/components/schemas/Environment" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + +environments_by_id: + get: + summary: Environment [GET] + description: "**Required Permissions**: `Environment Get` or `Environment Admin`" + parameters: + - name: environmentId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + environment: + $ref: "#/components/schemas/Environment" + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Environment not found + put: + summary: Environment [UPDATE] + description: "**Required Permissions**: `Environment Edit` or `Environment Admin`" + parameters: + - name: environmentId + in: path + required: true + schema: + type: integer + description: The id of the Environment that you wish to update. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + environment: + type: object + properties: + name: + type: string + example: "Updated Environment Name" + application_id: + type: integer + example: 1 + required: + - environment + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + environment: + $ref: "#/components/schemas/Environment" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Environment not found + delete: + summary: Environment [DELETE] + description: "**Required Permissions**: `Environment Delete` or `Environment Admin`" + parameters: + - name: environmentId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Environment not found + +# Components +components: + schemas: + Environment: + type: object + description: "Represents an environment (e.g., production, staging, development) for experiments" + properties: + id: + type: integer + description: "Unique identifier for the environment" + example: 1 + name: + type: string + description: "Name of the environment. Max length 64 characters." + example: "production" + maxLength: 64 + application_id: + type: integer + description: "ID of the application this environment belongs to" + example: 1 + created_at: + type: string + format: date-time + description: "When the environment was created" + example: "2023-01-01T00:00:00Z" + updated_at: + type: string + format: date-time + description: "When the environment was last updated" + example: "2023-01-02T00:00:00Z" + required: + - id + - name + - application_id + example: + id: 1 + name: "production" + application_id: 1 + created_at: "2023-01-01T00:00:00Z" + updated_at: "2023-01-02T00:00:00Z" diff --git a/openapi_console/paths/events.yaml b/openapi_console/paths/events.yaml new file mode 100644 index 00000000..0fadc144 --- /dev/null +++ b/openapi_console/paths/events.yaml @@ -0,0 +1,552 @@ +events: + post: + summary: Events [LIST] + description: "**Required Permissions**: `List`" + tags: + - Events + requestBody: + content: + application/json: + schema: + type: object + properties: + filters: + type: object + properties: + from: + type: integer + description: "Start timestamp in milliseconds" + example: 1646715275000 + to: + type: integer + description: "End timestamp in milliseconds" + example: 1647320075000 + effective_exposures: + type: boolean + description: "Whether to include only effective exposures" + example: true + applications: + type: array + description: "Filter by application IDs" + items: + type: integer + example: [1, 2] + unit_types: + type: array + description: "Filter by unit type IDs" + items: + type: integer + example: [1] + event_types: + type: array + description: "Filter by event types" + items: + type: string + example: ["exposure", "goal"] + unit_uids: + type: array + description: "Filter by unit UIDs" + items: + type: string + example: ["user123", "user456"] + environment_types: + type: array + description: "Filter by environment types" + items: + type: string + example: ["production", "staging"] + event_names: + type: array + description: "Filter by event names" + items: + type: string + example: ["click", "purchase"] + unit_hex: + type: boolean + description: "Whether to return unit IDs as hex" + example: true + take: + type: integer + description: "Number of events to return" + example: 100 + skip: + type: integer + description: "Number of events to skip" + example: 0 + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + events: + type: array + items: + $ref: "#/components/schemas/Event" + metadata: + type: object + properties: + total: + type: integer + count: + type: integer + required: + - events + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + +events_history: + post: + summary: Events History [LIST] + description: "**Required Permissions**: `List`" + tags: + - Events + requestBody: + content: + application/json: + schema: + type: object + properties: + filters: + type: object + properties: + from: + type: integer + description: "Start timestamp in milliseconds" + example: 1646715275000 + to: + type: integer + description: "End timestamp in milliseconds" + example: 1647320075000 + effective_exposures: + type: boolean + description: "Whether to include only effective exposures" + example: true + applications: + type: array + description: "Filter by application IDs" + items: + type: integer + example: [1, 2] + unit_types: + type: array + description: "Filter by unit type IDs" + items: + type: integer + example: [1] + event_types: + type: array + description: "Filter by event types" + items: + type: string + example: ["exposure", "goal"] + unit_uids: + type: array + description: "Filter by unit UIDs" + items: + type: string + example: ["user123", "user456"] + environment_types: + type: array + description: "Filter by environment types" + items: + type: string + example: ["production", "staging"] + event_names: + type: array + description: "Filter by event names" + items: + type: string + example: ["click", "purchase"] + period: + type: string + description: "Time period for the history intervals" + example: "day" + tz_offset: + type: integer + description: "Timezone offset in minutes" + example: 0 + skip: + type: integer + description: "Number of periods to skip" + example: 0 + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + history: + type: array + items: + type: object + properties: + time: + type: integer + description: "Timestamp for the period" + count: + type: integer + description: "Number of events in the period" + metadata: + type: object + properties: + total: + type: integer + count: + type: integer + required: + - history + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + +events_unit_data: + post: + summary: Get Unit Data + description: "**Required Permissions**: `List`" + tags: + - Events + requestBody: + content: + application/json: + schema: + type: object + properties: + units: + type: array + description: "List of units to get data for" + items: + type: object + properties: + type: + type: string + description: "Unit type name" + example: "user" + uid: + type: string + description: "Unit ID" + example: "user123" + required: + - type + - uid + required: + - units + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + units: + type: array + items: + $ref: "#/components/schemas/UnitData" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + delete: + summary: Delete Unit Data + description: "**Required Permissions**: `Delete`" + tags: + - Events + requestBody: + content: + application/json: + schema: + type: object + properties: + units: + type: array + description: "List of units to delete data for" + items: + type: object + properties: + type: + type: string + description: "Unit type name" + example: "user" + uid: + type: string + description: "Unit ID" + example: "user123" + required: + - type + - uid + required: + - units + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + example: true + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + +events_json_values: + post: + summary: Get JSON Values from Events + description: "**Required Permissions**: `GetJsonData`" + tags: + - Events + requestBody: + content: + application/json: + schema: + type: object + properties: + event_type: + type: string + description: "Type of event to query" + enum: ["exposure", "goal"] + example: "exposure" + path: + type: string + description: "JSON path to extract" + example: "$.properties.browser" + from: + type: integer + description: "Start timestamp in milliseconds" + example: 1646715275000 + to: + type: integer + description: "End timestamp in milliseconds" + example: 1647320075000 + experiment_id: + type: integer + description: "Filter by experiment ID (for exposure events)" + example: 1 + goal_id: + type: integer + description: "Filter by goal ID (for goal events)" + example: 1 + required: + - event_type + - path + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + values: + type: array + items: + type: object + properties: + value: + type: object + description: "Extracted JSON value" + count: + type: integer + description: "Frequency of this value" + metadata: + type: object + properties: + total: + type: integer + count: + type: integer + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Not Found + +events_json_layouts: + post: + summary: Get JSON Layouts + description: "**Required Permissions**: `GetJsonData`" + tags: + - Events + requestBody: + content: + application/json: + schema: + type: object + properties: + source: + type: string + description: "Source of JSON data" + enum: ["unit_attribute", "unit_goal_property"] + example: "unit_attribute" + phase: + type: string + description: "Processing phase" + enum: ["before_enrichment", "after_enrichment"] + example: "after_enrichment" + prefix: + type: string + description: "JSON path prefix" + example: "" + source_id: + type: integer + description: "Source ID (goal ID, etc.)" + example: 1 + from: + type: integer + description: "Start timestamp in milliseconds" + example: 1646715275000 + to: + type: integer + description: "End timestamp in milliseconds" + example: 1647320075000 + required: + - source + - phase + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + layouts: + type: array + items: + type: object + properties: + path: + type: string + description: "JSON path" + type: + type: string + description: "Value type" + count: + type: integer + description: "Frequency of this path" + metadata: + type: object + properties: + total: + type: integer + count: + type: integer + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + +# Components +components: + schemas: + Event: + type: object + description: "Represents an event in the system" + properties: + id: + type: string + description: "Event ID" + example: "1234567890abcdef" + timestamp: + type: integer + description: "When the event occurred (milliseconds since epoch)" + example: 1646715275000 + type: + type: string + description: "Event type" + enum: ["exposure", "goal"] + example: "exposure" + name: + type: string + description: "Event name" + example: "purchase" + unit_type: + type: string + description: "Unit type name" + example: "user" + unit_uid: + type: string + description: "Unit ID" + example: "user123" + properties: + type: object + description: "Event properties" + example: { "amount": 99.99, "product_id": "p123" } + metadata: + type: object + description: "Event metadata" + example: { "browser": "Chrome", "device": "mobile" } + UnitData: + type: object + description: "Data associated with a unit" + properties: + unit_type: + type: string + description: "Unit type name" + example: "user" + unit_uid: + type: string + description: "Unit ID" + example: "user123" + attributes: + type: object + description: "Unit attributes" + example: { "country": "US", "age": 30 } + exposures: + type: array + description: "Experiment exposures for this unit" + items: + type: object + properties: + experiment_id: + type: integer + description: "Experiment ID" + example: 1 + variant_id: + type: integer + description: "Variant ID" + example: 2 + timestamp: + type: integer + description: "When the exposure occurred" + example: 1646715275000 + goals: + type: array + description: "Goal completions for this unit" + items: + type: object + properties: + goal_id: + type: integer + description: "Goal ID" + example: 1 + value: + type: number + description: "Goal value" + example: 99.99 + timestamp: + type: integer + description: "When the goal was achieved" + example: 1646715275000 diff --git a/openapi_console/paths/experiment_custom_sections.yaml b/openapi_console/paths/experiment_custom_sections.yaml new file mode 100644 index 00000000..4b898e0c --- /dev/null +++ b/openapi_console/paths/experiment_custom_sections.yaml @@ -0,0 +1,397 @@ +experiment_custom_sections: + get: + summary: Experiment Custom Sections [LIST] + description: "**Required Permissions**: `ExperimentCustomSection List` or `ExperimentCustomSection Admin`" + parameters: + - name: type + in: query + schema: + type: string + enum: [test] + description: "Filter by experiment type" + example: "test" + - name: archived + in: query + schema: + type: boolean + description: "Include archived sections" + example: false + - name: sort + in: query + schema: + type: string + example: "title" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + tags: + - Experiment Custom Sections + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/ExperimentCustomSection" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + + post: + summary: Experiment Custom Sections [CREATE] + description: "**Required Permissions**: `ExperimentCustomSection Create` or `ExperimentCustomSection Admin`" + tags: + - Experiment Custom Sections + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + title: + type: string + description: "Title of the custom section" + example: "Deployment Plan" + description: + type: string + description: "Description of the custom section" + example: "Deployment plans for the experiment" + type: + type: string + enum: [test] + description: "Experiment type" + example: "test" + required: + - title + - description + - type + responses: + "201": + description: Created + content: + application/json: + schema: + $ref: "#/components/schemas/ExperimentCustomSection" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + +experiment_custom_sections_by_id: + parameters: + - name: id + in: path + required: true + schema: + type: integer + description: "Unique identifier for the experiment custom section" + get: + summary: Experiment Custom Sections [GET] + description: "**Required Permissions**: `ExperimentCustomSection List` or `ExperimentCustomSection Admin`" + tags: + - Experiment Custom Sections + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/ExperimentCustomSection" + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Not Found + + put: + summary: Experiment Custom Sections [UPDATE] + description: "**Required Permissions**: `ExperimentCustomSection Update` or `ExperimentCustomSection Admin`" + tags: + - Experiment Custom Sections + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + title: + type: string + description: "Title of the custom section" + example: "Deployment Plan" + description: + type: string + description: "Description of the custom section" + example: "Deployment plans for the experiment" + type: + type: string + enum: [test] + description: "Experiment type" + example: "test" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/ExperimentCustomSection" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Not Found + + delete: + summary: Experiment Custom Sections [ARCHIVE] + description: "**Required Permissions**: `ExperimentCustomSection Archive` or `ExperimentCustomSection Admin`" + tags: + - Experiment Custom Sections + responses: + "204": + description: No Content + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Not Found + +experiment_custom_sections_order: + put: + summary: Experiment Custom Sections [REORDER] + description: "**Required Permissions**: `ExperimentCustomSection Update` or `ExperimentCustomSection Admin`" + tags: + - Experiment Custom Sections + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + experiment_custom_sections: + type: array + items: + type: object + properties: + id: + type: integer + description: "ID of the custom section" + example: 1 + order_index: + type: integer + description: "New order index" + example: 1 + experiment_custom_section_fields: + type: array + items: + type: object + properties: + id: + type: integer + description: "ID of the custom section field" + example: 1 + order_index: + type: integer + description: "New order index" + example: 1 + required: + - experiment_custom_sections + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + description: "Indicates if the operation was successful" + experiment_custom_sections: + type: array + items: + $ref: "#/components/schemas/ExperimentCustomSection" + experiment_custom_section_fields: + type: array + items: + $ref: "#/components/schemas/ExperimentCustomSectionField" + errors: + type: array + items: + type: string + required: + - ok + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + +# Components +components: + schemas: + ExperimentCustomSection: + type: object + description: "Custom section for experiment forms" + properties: + id: + type: integer + description: "Unique identifier for the custom section" + example: 1 + title: + type: string + description: "Title of the custom section" + example: "Deployment Plan" + description: + type: string + description: "Description of the custom section" + example: "Deployment plans for the experiment" + order_index: + type: integer + description: "Order position of the section" + example: 1 + type: + type: string + enum: [test] + description: "Experiment type" + example: "test" + archived: + type: boolean + description: "Whether the section is archived" + example: false + created_at: + type: string + format: date-time + description: "Timestamp when the section was created" + created_by_user_id: + type: integer + description: "ID of the user who created the section" + updated_at: + type: string + format: date-time + description: "Timestamp when the section was last updated" + updated_by_user_id: + type: integer + description: "ID of the user who last updated the section" + custom_section_fields: + type: array + items: + $ref: "#/components/schemas/ExperimentCustomSectionField" + description: "Fields in this custom section" + required: + - id + - title + - description + - order_index + - type + - archived + - created_at + - created_by_user_id + + ExperimentCustomSectionField: + type: object + description: "Field in a custom section for experiment forms" + properties: + id: + type: integer + description: "Unique identifier for the field" + example: 1 + name: + type: string + description: "Name of the field" + example: "rollback_plan" + title: + type: string + description: "Display title of the field" + example: "Rollback Plan" + description: + type: string + description: "Description of the field" + example: "Describe how to rollback in case of issues" + type: + type: string + enum: [text, string, json, boolean, number] + description: "Data type of the field" + example: "text" + required: + type: boolean + description: "Whether the field is required" + example: true + order_index: + type: integer + description: "Order position of the field" + example: 1 + section_id: + type: integer + description: "ID of the parent section" + example: 1 + archived: + type: boolean + description: "Whether the field is archived" + example: false + created_at: + type: string + format: date-time + description: "Timestamp when the field was created" + created_by_user_id: + type: integer + description: "ID of the user who created the field" + updated_at: + type: string + format: date-time + description: "Timestamp when the field was last updated" + updated_by_user_id: + type: integer + description: "ID of the user who last updated the field" + required: + - id + - name + - title + - description + - type + - required + - order_index + - section_id + - archived + - created_at + - created_by_user_id diff --git a/openapi_console/paths/experiment_tags.yaml b/openapi_console/paths/experiment_tags.yaml new file mode 100644 index 00000000..b011506d --- /dev/null +++ b/openapi_console/paths/experiment_tags.yaml @@ -0,0 +1,228 @@ +experiment_tags: + get: + summary: Experiment Tags [LIST] + description: "**Required Permissions**: `Experiment List` or `Experiment Admin`" + parameters: + - name: sort + in: query + schema: + type: string + example: "tag" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + tags: + - Experiment Tags + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/ExperimentTag" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + post: + summary: Experiment Tag [CREATE] + description: "**Required Permissions**: `Experiment Create` or `Experiment Admin`" + tags: + - Experiment Tags + requestBody: + content: + application/json: + schema: + type: object + properties: + tag: + type: string + description: "Tag name" + example: "production" + required: + - tag + responses: + "201": + description: Created + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + example: true + experiment_tag: + $ref: "#/components/schemas/ExperimentTag" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + +experiment_tags_by_id: + get: + summary: Experiment Tag [GET] + description: "**Required Permissions**: `Experiment Get` or `Experiment Admin`" + parameters: + - name: tagId + in: path + required: true + schema: + type: integer + tags: + - Experiment Tags + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + experiment_tag: + $ref: "#/components/schemas/ExperimentTag" + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Experiment Tag not found + put: + summary: Experiment Tag [UPDATE] + description: "**Required Permissions**: `Experiment Edit` or `Experiment Admin`" + parameters: + - name: tagId + in: path + required: true + schema: + type: integer + tags: + - Experiment Tags + requestBody: + content: + application/json: + schema: + type: object + properties: + tag: + type: string + description: "Tag name" + example: "production-v2" + required: + - tag + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + example: true + experiment_tag: + $ref: "#/components/schemas/ExperimentTag" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Experiment Tag not found + delete: + summary: Experiment Tag [DELETE] + description: "**Required Permissions**: `Experiment Archive` or `Experiment Admin`" + parameters: + - name: tagId + in: path + required: true + schema: + type: integer + tags: + - Experiment Tags + responses: + "204": + description: No Content + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Experiment Tag not found + +# Components +components: + schemas: + ExperimentTag: + type: object + description: "Represents a tag for experiments" + properties: + id: + type: integer + description: "Unique identifier for the experiment tag" + example: 1 + tag: + type: string + description: "Tag name" + example: "production" + created_at: + type: string + format: date-time + description: "When the tag was created" + example: "2023-01-01T00:00:00Z" + created_by_user_id: + type: integer + description: "ID of the user who created the tag" + example: 1 + created_by: + $ref: "#/components/schemas/User" + updated_at: + type: string + format: date-time + description: "When the tag was last updated" + example: "2023-01-02T00:00:00Z" + updated_by_user_id: + type: integer + description: "ID of the user who last updated the tag" + example: 1 + updated_by: + $ref: "#/components/schemas/User" + required: + - id + - tag + - created_at + - created_by_user_id diff --git a/openapi_console/paths/experiments.yaml b/openapi_console/paths/experiments.yaml new file mode 100644 index 00000000..52189784 --- /dev/null +++ b/openapi_console/paths/experiments.yaml @@ -0,0 +1,1355 @@ +experiments: + get: + summary: Experiment [LIST] + description: "**Required Permissions**: `Experiment List` or `Experiment Admin`" + parameters: + - name: search + in: query + schema: + type: string + example: "call_to_action" + - name: sort + in: query + schema: + type: string + example: "created_at" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + - name: status + in: query + schema: + type: string + enum: + - all + - archived + - active + - draft + - stopped + - development + default: all + example: all + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/Experiment" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + + post: + summary: Experiment [CREATE] + description: "**Required Permissions**: `Experiment Create` or `Experiment Admin`" + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + experiment: + type: object + properties: + name: + type: string + example: "Button color test" + team_id: + type: integer + example: 1 + variants: + type: array + items: + type: string + example: ["Control", "Purple", "Blue", "Pink"] + percentages: + type: array + items: + type: number + example: [25, 25, 25, 25] + type: + type: string + enum: + - sequential + - random + example: random + description: "Sequential means new users are assigned to the variant with the lowest assignment count. Random means each user has a random chance of being assigned to each variant." + application_id: + type: integer + description: The ID of the application that this experiment is for. Must be an application ID that exists in your account. + example: 1 + unit_type_id: + type: integer + description: The ID of the unit type that this experiment uses. Must be a unit type ID that exists in your account. + example: 1 + min_sample_size: + type: integer + example: 10000 + goal_tags: + type: array + items: + type: integer + example: [1, 2, 3] + metric_tags: + type: array + items: + type: integer + example: [1, 2, 3] + experiment_tags: + type: array + items: + type: integer + example: [1, 2, 3] + note: + type: string + example: "Let's test which button color performs better." + custom_code: + type: string + example: "// custom code goes here" + environment_id: + type: integer + description: The ID of the environment that this experiment is for. Must be an environment ID that exists in your account. + example: 1 + required: + - name + - team_id + - variants + - percentages + - application_id + - unit_type_id + - environment_id + required: + - experiment + responses: + "201": + description: Created + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + experiment: + $ref: "#/components/schemas/Experiment" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + +experiments_by_id: + get: + summary: Experiment [GET] + description: "**Required Permissions**: `Experiment Get` or `Experiment Admin`" + parameters: + - name: experimentId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + experiment: + $ref: "#/components/schemas/Experiment" + experiment_note: + $ref: "#/components/schemas/ExperimentAnnotation" + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Experiment not found + put: + summary: Experiment [UPDATE] + description: "**Required Permissions**: `Experiment Edit` or `Experiment Admin`" + parameters: + - name: experimentId + in: path + required: true + schema: + type: integer + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + experiment: + type: object + properties: + name: + type: string + team_id: + type: integer + goal_tags: + type: array + items: + type: integer + metric_tags: + type: array + items: + type: integer + experiment_tags: + type: array + items: + type: integer + note: + type: string + custom_code: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + experiment: + $ref: "#/components/schemas/Experiment" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Experiment not found + +experiments_start: + post: + summary: Experiment [START] + description: "**Required Permissions**: `Experiment Edit` or `Experiment Admin`" + parameters: + - name: experimentId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + experiment: + $ref: "#/components/schemas/Experiment" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Experiment not found + +experiments_stop: + post: + summary: Experiment [STOP] + description: "**Required Permissions**: `Experiment Edit` or `Experiment Admin`" + parameters: + - name: experimentId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + experiment: + $ref: "#/components/schemas/Experiment" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Experiment not found + +experiments_development: + post: + summary: Experiment [DEVELOPMENT] + description: "**Required Permissions**: `Experiment Edit` or `Experiment Admin`" + parameters: + - name: experimentId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + experiment: + $ref: "#/components/schemas/Experiment" + experiment_note: + $ref: "#/components/schemas/ExperimentAnnotation" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Experiment not found + +experiments_full_on: + post: + summary: Experiment [FULL ON] + description: "**Required Permissions**: `Experiment Edit` or `Experiment Admin`" + parameters: + - name: experimentId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + experiment: + $ref: "#/components/schemas/Experiment" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Experiment not found + +experiments_archive: + post: + summary: Experiment [ARCHIVE] + description: "**Required Permissions**: `Experiment Edit` or `Experiment Admin`" + parameters: + - name: experimentId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + experiment: + $ref: "#/components/schemas/Experiment" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Experiment not found + +experiments_participants_history: + post: + summary: Experiment-Participants-History [GET] + description: "**Required Permissions**: `Experiment Get` or `Experiment Admin`" + parameters: + - name: experimentId + in: path + required: true + schema: + type: integer + description: The `id` of the experiment that you want the participant history of. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + time_period: + type: string + enum: + - day + - week + - month + - quarter + - year + - all_time + description: "The time period to group the data by." + default: day + date_range: + type: array + items: + type: string + format: date + minItems: 2 + maxItems: 2 + description: "The date range to filter the data by. This should be an array with two dates, the start and end date (inclusive). Dates should be specified in the format 'YYYY-MM-DD'. If not specified, API returns all data." + example: ["2022-01-01", "2022-12-31"] + responses: + "200": + description: | + The response will contain a `columnNames` array that describes what each column represents. The `rows` array contains the values for each column. The data is represented as a matrix, where each row has values for each column. + + ### **Column Names:** + + - `date` - The date of the row's data in seconds since epoch. + - `variant` - The variant that this row describes. (0, 1, 2 or 3). + - `first_exposure_at` - The date of the first exposure of this variant in the current time period in milliseconds since epoch. + - `last_exposure_at` - The date of the last exposure of this variant in the current time period in milliseconds since epoch. + - `unit_count` - The number of units that were exposed to this variant in the current time period. + - `cum_unit_count` - The cumulative number of units that were exposed to this variant at the end of the current time period. + + :::caution + The columns may come in a different order than the one listed above. It's important to use the `columnNames` array to identify the index of the column you want to use. + ::: + content: + application/json: + schema: + type: object + properties: + columnNames: + type: array + items: + type: string + example: ["date", "variant", "first_exposure_at", "last_exposure_at", "unit_count", "cum_unit_count"] + columnTypes: + type: array + items: + type: string + example: ["date", "string", "date", "date", "number", "number"] + rows: + type: array + items: + type: array + example: [ + ["2025-03-15", "Control", "2025-03-15T08:00:00Z", "2025-03-15T23:59:59Z", 5280, 5280], + ["2025-03-15", "Variant A", "2025-03-15T08:00:00Z", "2025-03-15T23:59:59Z", 5310, 5310], + ["2025-03-16", "Control", "2025-03-16T00:00:00Z", "2025-03-16T23:59:59Z", 4890, 10170], + ["2025-03-16", "Variant A", "2025-03-16T00:00:00Z", "2025-03-16T23:59:59Z", 4920, 10230] + ] + +experiments_metrics_main_history: + post: + summary: Experiment-Main-Metrics-History [DATA] + description: "**Required Permissions**: `Experiment Get` or `Experiment Admin`" + parameters: + - name: experimentId + in: path + required: true + description: The `id` of the experiment that you want the history of. + schema: + type: integer + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + time_period: + type: string + enum: + - day + - week + - month + - quarter + - year + - all_time + description: "The time period to group the data by." + default: day + date_range: + type: array + items: + type: string + format: date + minItems: 2 + maxItems: 2 + description: "The date range to filter the data by. This should be an array with two dates, the start and end date (inclusive). Dates should be specified in the format 'YYYY-MM-DD'. If not specified, API returns all data." + example: ["2022-01-01", "2022-12-31"] + responses: + "200": + description: | + The response will contain a `columnNames` array that describes what each column represents. The `rows` array contains the values for each column. The data is represented as a matrix, where each row has values for each column. + + ### **Column Names:** + + - `date` - The date of the row's data in seconds since epoch. + - `variant` - The variant that this row describes. (0, 1, 2 or 3). + - `first_exposure_at` - The date of the first exposure of this variant in the current time period in milliseconds since epoch. + - `last_exposure_at` - The date of the last exposure of this variant in the current time period in milliseconds since epoch. + - `unit_count` - The number of units that were exposed to this variant in the current time period. + - `cum_unit_count` - The number of units that were exposed to this variant across all time periods. + + ### **Dynamic Columns:** + + - `metric_${metric_id}` - The value of the metric with the id of `${metric_id}` in the current time period. + - `metric_${metric_id}_mean` - The mean value of the metric with the id of `${metric_id}` in the current time period. + - `metric_${metric_id}_var` - The variance of the metric with the id of `${metric_id}` in the current time period. + - `metric_${metric_id}_pvalue` - The p-value of the metric with the id of `${metric_id}` in the current time period. + - `metric_${metric_id}_impact` - The impact of the metric with the id of `${metric_id}` in the current time period. + - `metric_${metric_id}_impact_ci_lower` - The lower bound of the confidence interval of the impact of the metric with the id of `${metric_id}` in the current time period. + - `metric_${metric_id}_impact_ci_upper` - The upper bound of the confidence interval of the impact of the metric with the id of `${metric_id}` in the current time period. + + :::caution + The columns may come in a different order than the one listed above. It's important to use the `columnNames` array to identify the index of the column you want to use. + ::: + content: + application/json: + schema: + type: object + properties: + columnNames: + type: array + items: + type: string + example: ["date", "variant", "first_exposure_at", "last_exposure_at", "unit_count", "cum_unit_count", "metric_1", "metric_1_mean", "metric_1_var", "metric_1_pvalue", "metric_1_impact", "metric_1_impact_ci_lower", "metric_1_impact_ci_upper"] + columnTypes: + type: array + items: + type: string + example: ["date", "string", "date", "date", "number", "number", "number", "number", "number", "number", "number", "number", "number"] + rows: + type: array + items: + type: array + example: [ + ["2025-03-15", "Control", "2025-03-15T08:00:00Z", "2025-03-15T23:59:59Z", 5280, 5280, 423, 0.0801, 0.00034, 1.0, 0, 0, 0], + ["2025-03-15", "Variant A", "2025-03-15T08:00:00Z", "2025-03-15T23:59:59Z", 5310, 5310, 456, 0.0859, 0.00033, 0.027, 7.24, 0.82, 13.65], + ["2025-03-16", "Control", "2025-03-16T00:00:00Z", "2025-03-16T23:59:59Z", 4890, 10170, 401, 0.0820, 0.00037, 1.0, 0, 0, 0], + ["2025-03-16", "Variant A", "2025-03-16T00:00:00Z", "2025-03-16T23:59:59Z", 4920, 10230, 442, 0.0898, 0.00036, 0.019, 9.51, 1.57, 17.45] + ] + +experiments_metrics_main: + post: + summary: Experiment-Main-Metrics [DATA] + description: "**Required Permissions**: `Experiment Get` or `Experiment Admin`" + parameters: + - name: experimentId + in: path + required: true + description: The `id` of the experiment to get the metrics for. + schema: + type: integer + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + date_range: + type: array + items: + type: string + format: date + minItems: 2 + maxItems: 2 + description: "The date range to filter the data by. This should be an array with two dates, the start and end date (inclusive). Dates should be specified in the format 'YYYY-MM-DD'. If not specified, API returns all data." + example: ["2022-01-01", "2022-12-31"] + responses: + "200": + description: | + The response will contain a `columnNames` array that describes what each column represents. The `rows` array contains the values for each column. The data is represented as a matrix, where each row has values for each column. + + ### **Column Names:** + + - `variant` - The variant that this row describes. (0, 1, 2 or 3). + - `first_exposure_at` - The date of the first exposure of this variant in milliseconds since epoch. + - `last_exposure_at` - The date of the last exposure of this variant in milliseconds since epoch. + - `unit_count` - The number of units that have been exposed to this variant. + + ### **Dynamic Columns:** + + - `metric_${metric_id}` - The current value of the metric with the id of `${metric_id}`. + - `metric_${metric_id}_mean` - The mean value of the metric with the id of `${metric_id}`. + - `metric_${metric_id}_var` - The variance of the metric with the id of `${metric_id}`. + - `metric_${metric_id}_pvalue` - The p-value of the metric with the id of `${metric_id}`. + - `metric_${metric_id}_impact` - The current impact of the metric with the id of `${metric_id}`. + - `metric_${metric_id}_impact_ci_lower` - The lower bound of the confidence interval of the impact of the metric with the id of `${metric_id}`. + - `metric_${metric_id}_impact_ci_upper` - The upper bound of the confidence interval of the impact of the metric with the id of `${metric_id}`. + + :::caution + The columns may come in a different order than the one listed above. It's important to use the `columnNames` array to identify the index of the column you want to use. + ::: + content: + application/json: + schema: + type: object + properties: + columnNames: + type: array + items: + type: string + example: ["variant", "first_exposure_at", "last_exposure_at", "unit_count", "metric_1", "metric_1_mean", "metric_1_var", "metric_1_pvalue", "metric_1_impact", "metric_1_impact_ci_lower", "metric_1_impact_ci_upper"] + columnTypes: + type: array + items: + type: string + example: ["string", "date", "date", "number", "number", "number", "number", "number", "number", "number", "number"] + rows: + type: array + items: + type: array + example: [ + ["Control", "2025-03-15T08:00:00Z", "2025-03-16T23:59:59Z", 10170, 824, 0.0810, 0.00035, 1.0, 0, 0, 0], + ["Variant A", "2025-03-15T08:00:00Z", "2025-03-16T23:59:59Z", 10230, 898, 0.0878, 0.00035, 0.021, 8.40, 1.25, 15.55] + ] + +experiments_activity: + get: + summary: Experiment-Activity [GET] + description: "**Required Permissions**: `Experiment Get` or `Experiment Admin`" + parameters: + - name: experimentId + in: path + required: true + schema: + type: integer + - name: offset + in: query + required: false + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/Activity" + metadata: + type: object + properties: + offset: + type: integer + post: + summary: Experiment-Comment [CREATE] + description: "**Required Permissions**: `Experiment Get` or `Experiment Admin`" + parameters: + - name: experimentId + in: path + required: true + schema: + type: integer + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + comment: + type: object + properties: + text: + type: string + example: "I think we should run this experiment for at least 2 weeks." + responses: + "201": + description: Created + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + comment: + $ref: "#/components/schemas/Comment" + +experiments_activity_reply: + post: + summary: Experiment-Comment-Reply [CREATE] + description: "**Required Permissions**: `Experiment Get` or `Experiment Admin`" + parameters: + - name: experimentId + in: path + required: true + schema: + type: integer + - name: commentId + in: path + required: true + schema: + type: integer + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + comment: + type: object + properties: + text: + type: string + example: "I agree, I'll make sure we run it for at least 2 weeks." + responses: + "201": + description: Created + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + comment: + $ref: "#/components/schemas/Comment" + +experiment_annotations: + get: + summary: Experiment-Annotation [LIST] + description: "**Required Permissions**: `Annotation List` or `Annotation Admin`" + parameters: + - name: sort + in: query + schema: + type: string + example: "created_at" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/ExperimentAnnotation" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + +experiment_annotations_by_id: + get: + summary: Experiment-Annotation [GET] + description: "**Required Permissions**: `Annotation Get` or `Annotation Admin`" + parameters: + - name: experimentAnnotationId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + experiment_annotation: + $ref: "#/components/schemas/ExperimentAnnotation" + +experiment_recommended_actions_dismiss: + put: + summary: Experiment Recommended Action [DISMISS] + description: "**Required Permissions**: `Experiment Edit` or `Experiment Admin`" + parameters: + - name: id + in: path + required: true + schema: + type: integer + description: "ID of the experiment" + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + note: + type: string + description: "Reason for dismissing the recommended action" + example: "This action is not relevant for our use case" + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + action: + $ref: "#/components/schemas/ExperimentRecommendedAction" + note: + $ref: "#/components/schemas/ExperimentNote" + errors: + type: array + items: + type: string + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Not Found + +experiment_tags: + get: + summary: Experiment-Tag [LIST] + description: "**Required Permissions**: `Experiment List` or `Experiment Admin`" + parameters: + - name: sort + in: query + schema: + type: string + example: "created_at" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/ExperimentTag" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + +experiment_tags_by_id: + get: + summary: Experiment-Tag [GET] + description: "**Required Permissions**: `Experiment Get` or `Experiment Admin`" + parameters: + - name: experimentTagId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + experiment_tag: + $ref: "#/components/schemas/ExperimentTag" + +components: + schemas: + Experiment: + type: object + description: "Represents an experiment with variants, metrics, and configuration for running tests or implementing features" + properties: + id: + type: integer + description: "Unique identifier for the experiment (auto-generated)" + example: 1 + name: + type: string + description: "Name of the experiment, used in code. REQUIRED. Max length 256 characters." + example: test_experiment + maxLength: 256 + iteration: + type: integer + description: "Iteration number for this experiment. Auto-generated, starts at 1 and increments for each iteration." + minimum: 1 + state: + type: string + description: "Current state of the experiment. REQUIRED. States like 'created', 'development', 'running', etc. Note that 'archived' is a separate boolean field, not a state." + example: running + enum: ["created", "development", "running", "stopped", "feature_on", "feature_off", "scheduled"] + full_name: + type: string + description: "Full, descriptive name of the experiment. REQUIRED. Max length 256 characters." + example: "New Homepage Design Test" + maxLength: 256 + description: + type: string + description: "Detailed description of the experiment and what it's testing. Max length 8192 characters." + example: "Testing different button colors to improve conversion rate" + maxLength: 8192 + start_time: + type: string + format: date-time + description: "When the experiment was started (or scheduled to start if in 'scheduled' state)" + example: "2023-01-01T00:00:00Z" + end_time: + type: string + format: date-time + description: "When the experiment was ended (or scheduled to end if in 'scheduled' state)" + example: "2023-01-31T23:59:59Z" + archived: + type: boolean + description: "Whether the experiment is archived. Archived experiments are hidden from regular views." + example: false + percentages: + type: string + description: "String representation of the traffic split percentages for each variant, separated by slashes. E.g., '50/50' for 50% control and 50% treatment." + example: "50/50" + exposure: + type: integer + description: "Traffic exposure percentage (0-100). Controls what percentage of users are included in the experiment." + example: 100 + minimum: 0 + maximum: 100 + segment_id: + type: integer + description: "ID of the segment to target with this experiment, if segmentation is used. NULL means no segmentation." + example: 1 + schedule_job_id: + type: string + description: "ID of the scheduling job for scheduled experiments. NULL for non-scheduled experiments." + example: "job_123456" + created_at: + type: string + format: date-time + description: "When the experiment was created. Auto-generated." + example: "2022-12-15T14:30:00Z" + updated_at: + type: string + format: date-time + description: "When the experiment was last updated. Auto-generated." + example: "2023-01-02T10:15:00Z" + applications: + type: array + items: + $ref: "#/components/schemas/ExperimentApplication" + variants: + type: array + items: + $ref: "#/components/schemas/ExperimentVariant" + metrics: + type: array + items: + $ref: "#/components/schemas/ExperimentMetric" + tags: + type: array + items: + $ref: "#/components/schemas/ExperimentTag" + required: + - id + - name + - full_name + - state + - variants + example: + id: 123 + name: "new_homepage_design" + state: "running" + percentages: "34/33/33" + full_name: "New Homepage Design Test" + exposure: 100 + created_at: "2023-01-01T00:00:00Z" + updated_at: "2023-01-02T00:00:00Z" + + ExperimentVariant: + type: object + properties: + id: + type: integer + description: "Unique identifier for the variant (auto-generated)" + example: 1 + name: + type: string + description: "Name of the variant, used in code. REQUIRED. Max length 64 characters." + example: "control" + maxLength: 64 + full_name: + type: string + description: "Full, descriptive name of the variant. Max length 256 characters." + example: "Control Group" + maxLength: 256 + experiment_id: + type: integer + description: "ID of the experiment this variant belongs to" + example: 123 + is_control: + type: boolean + description: "Whether this is the control variant" + example: true + allocation: + type: integer + description: "Allocation percentage for this variant (0-100)" + example: 50 + minimum: 0 + maximum: 100 + required: + - id + - name + - experiment_id + + ExperimentApplication: + type: object + properties: + experiment_id: + type: integer + description: "ID of the experiment" + example: 123 + application_id: + type: integer + description: "ID of the application" + example: 1 + environment_id: + type: integer + description: "ID of the environment" + example: 1 + required: + - experiment_id + - application_id + - environment_id + + ExperimentMetric: + type: object + properties: + experiment_id: + type: integer + description: "ID of the experiment" + example: 123 + metric_id: + type: integer + description: "ID of the metric" + example: 456 + is_primary: + type: boolean + description: "Whether this is a primary metric for the experiment" + example: true + required: + - experiment_id + - metric_id + + ExperimentTag: + type: object + properties: + id: + type: integer + description: "Unique identifier for the experiment tag" + example: 1 + name: + type: string + description: "Name of the tag" + example: "frontend" + color: + type: string + description: "Color code for the tag" + example: "#FF5733" + required: + - id + - name + + ExperimentAnnotation: + type: object + properties: + id: + type: integer + description: "Unique identifier for the annotation" + example: 1 + experiment_id: + type: integer + description: "ID of the experiment this annotation belongs to" + example: 123 + timestamp: + type: string + format: date-time + description: "When the annotated event occurred" + example: "2023-01-15T14:30:00Z" + title: + type: string + description: "Title of the annotation" + example: "Changed button color" + description: + type: string + description: "Detailed description of the annotation" + example: "Changed the button color from blue to green" + created_at: + type: string + format: date-time + description: "When the annotation was created" + example: "2023-01-15T14:35:00Z" + created_by: + type: integer + description: "ID of the user who created the annotation" + example: 101 + required: + - id + - experiment_id + - timestamp + - title + + ExperimentRecommendedAction: + type: object + properties: + id: + type: integer + description: "Unique identifier for the recommended action" + example: 1 + experiment_id: + type: integer + description: "ID of the experiment this recommended action belongs to" + example: 123 + action: + type: string + description: "The recommended action" + example: "Increase sample size" + created_at: + type: string + format: date-time + description: "When the recommended action was created" + example: "2023-01-15T14:30:00Z" + required: + - id + - experiment_id + - action + + ExperimentNote: + type: object + properties: + id: + type: integer + description: "Unique identifier for the note" + example: 1 + experiment_id: + type: integer + description: "ID of the experiment this note belongs to" + example: 123 + note: + type: string + description: "The note" + example: "This action is not relevant for our use case" + created_at: + type: string + format: date-time + description: "When the note was created" + example: "2023-01-15T14:35:00Z" + required: + - id + - experiment_id + - note + + Activity: + type: object + description: "Represents an activity or comment on an experiment" + properties: + id: + type: integer + description: "Unique identifier for the activity" + example: 1 + experiment_id: + type: integer + description: "ID of the experiment this activity is for" + example: 123 + message: + type: string + description: "Content of the activity or comment" + example: "I think we should increase the sample size" + type: + type: string + description: "Type of activity (comment, state change, etc.)" + example: "comment" + enum: ["comment", "state_change", "annotation", "system"] + created_at: + type: string + format: date-time + description: "When the activity was created" + example: "2023-01-01T00:00:00Z" + created_by_user_id: + type: integer + description: "ID of the user who created this activity" + example: 456 + parent_id: + type: integer + nullable: true + description: "ID of the parent activity if this is a reply" + example: null + replies: + type: array + items: + $ref: "#/components/schemas/Activity" + description: "Replies to this activity" + required: + - id + - experiment_id + - message + - type + - created_at + - created_by_user_id + + Comment: + type: object + description: "Represents a comment on an experiment" + properties: + id: + type: integer + description: "Unique identifier for the comment" + example: 1 + experiment_id: + type: integer + description: "ID of the experiment this comment is for" + example: 123 + message: + type: string + description: "Content of the comment" + example: "This experiment is showing great conversion results" + created_at: + type: string + format: date-time + description: "When the comment was created" + example: "2023-01-01T00:00:00Z" + created_by_user_id: + type: integer + description: "ID of the user who created this comment" + example: 456 + parent_id: + type: integer + nullable: true + description: "ID of the parent comment if this is a reply" + example: null + required: + - id + - experiment_id + - message + - created_at + - created_by_user_id diff --git a/openapi_console/paths/export_configs.yaml b/openapi_console/paths/export_configs.yaml new file mode 100644 index 00000000..08b5ff7c --- /dev/null +++ b/openapi_console/paths/export_configs.yaml @@ -0,0 +1,573 @@ +export_configs: + get: + summary: Export Configs [LIST] + description: "**Required Permissions**: `ExportConfig List` or `ExportConfig Admin`" + parameters: + - name: ids + in: query + schema: + type: string + example: "1,2,3" + description: "Comma-separated list of export config IDs" + - name: config_types + in: query + schema: + type: string + example: "SCHEDULED,MANUAL" + description: "Comma-separated list of export config types" + - name: statuses + in: query + schema: + type: string + example: "COMPLETED,FAILED" + description: "Comma-separated list of export history statuses" + - name: sort + in: query + schema: + type: string + example: "description" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + tags: + - Export Configs + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/ExportConfig" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + + post: + summary: Export Configs [CREATE] + description: "**Required Permissions**: `ExportConfig Create` or `ExportConfig Admin`" + tags: + - Export Configs + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + description: + type: string + description: "Export configuration description" + example: "Daily event export" + filters: + type: object + description: "JSON filters for the export" + target: + type: string + enum: [EVENTS, BACKUPS] + description: "Export target type" + example: "EVENTS" + export_type: + type: string + enum: [SCHEDULED, MANUAL] + description: "Export type" + example: "SCHEDULED" + cron_expression: + type: string + description: "Cron expression for scheduled exports" + example: "0 0 * * *" + storage_config: + $ref: "#/components/schemas/StorageConfigInput" + required: + - description + - filters + - target + - export_type + - storage_config + responses: + "201": + description: Created + content: + application/json: + schema: + $ref: "#/components/schemas/ExportConfig" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + +export_configs_by_id: + parameters: + - name: id + in: path + required: true + schema: + type: integer + get: + summary: Export Configs [GET] + description: "**Required Permissions**: `ExportConfig List` or `ExportConfig Admin`" + tags: + - Export Configs + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/ExportConfig" + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Not Found + + put: + summary: Export Configs [UPDATE] + description: "**Required Permissions**: `ExportConfig Update` or `ExportConfig Admin`" + tags: + - Export Configs + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + description: + type: string + description: "Export configuration description" + example: "Daily event export" + filters: + type: object + description: "JSON filters for the export" + target: + type: string + enum: [EVENTS, BACKUPS] + description: "Export target type" + example: "EVENTS" + export_type: + type: string + enum: [SCHEDULED, MANUAL] + description: "Export type" + example: "SCHEDULED" + cron_expression: + type: string + description: "Cron expression for scheduled exports" + example: "0 0 * * *" + storage_config: + $ref: "#/components/schemas/StorageConfigInput" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/ExportConfig" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Not Found + + delete: + summary: Export Configs [ARCHIVE] + description: "**Required Permissions**: `ExportConfig Archive` or `ExportConfig Admin`" + tags: + - Export Configs + responses: + "204": + description: No Content + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Not Found + +export_configs_id_export_histories: + parameters: + - name: id + in: path + required: true + schema: + type: integer + get: + summary: Export Histories [LIST] + description: "**Required Permissions**: `ExportConfig List` or `ExportConfig Admin`" + parameters: + - name: sort + in: query + schema: + type: string + example: "created_at" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + tags: + - Export Configs + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/ExportHistory" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Not Found + +export_configs_id_export_histories_by_history_id: + parameters: + - name: id + in: path + required: true + schema: + type: integer + - name: history_id + in: path + required: true + schema: + type: integer + put: + summary: Export Histories [CANCEL] + description: "**Required Permissions**: `ExportConfig Update` or `ExportConfig Admin`" + tags: + - Export Configs + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + cancelled_reason: + type: string + description: "Reason for cancellation" + example: "No longer needed" + required: + - cancelled_reason + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/ExportHistory" + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Not Found + +# Components +components: + schemas: + ExportConfig: + type: object + description: "Configuration for data exports" + properties: + id: + type: integer + description: "Unique identifier for the export config" + example: 1 + description: + type: string + description: "Export configuration description" + example: "Daily event export" + filters: + type: object + description: "JSON filters for the export" + target: + type: string + enum: [EVENTS, BACKUPS] + description: "Export target type" + example: "EVENTS" + storage_config_id: + type: integer + description: "ID of the associated storage configuration" + example: 1 + storage_config: + $ref: "#/components/schemas/StorageConfig" + export_type: + type: string + enum: [SCHEDULED, MANUAL] + description: "Export type" + example: "SCHEDULED" + cron_expression: + type: string + description: "Cron expression for scheduled exports" + example: "0 0 * * *" + created_at: + type: string + format: date-time + description: "Timestamp when the export config was created" + created_by_user_id: + type: integer + description: "ID of the user who created the export config" + updated_at: + type: string + format: date-time + description: "Timestamp when the export config was last updated" + updated_by_user_id: + type: integer + description: "ID of the user who last updated the export config" + cancelled_at: + type: string + format: date-time + description: "Timestamp when the export config was cancelled" + archived: + type: boolean + description: "Whether the export config is archived" + export_histories: + type: array + items: + $ref: "#/components/schemas/ExportHistory" + description: "List of export histories associated with this config" + required: + - id + - description + - filters + - target + - storage_config_id + - storage_config + - export_type + - created_at + - created_by_user_id + - archived + + ExportHistory: + type: object + description: "History record of an export execution" + properties: + id: + type: integer + description: "Unique identifier for the export history" + example: 1 + export_config_id: + type: integer + description: "ID of the associated export config" + example: 1 + status: + type: string + enum: [IN_PROGRESS, COMPLETED, FAILED, WAITING, RETRYING, CANCELLED] + description: "Current status of the export" + example: "COMPLETED" + file_name: + type: string + description: "Name of the exported file" + example: "events_export_2023-01-01.csv" + progress: + type: integer + description: "Export progress percentage" + example: 75 + remaining_seconds: + type: integer + format: int64 + description: "Estimated remaining time in seconds" + example: 120 + total_seconds: + type: integer + format: int64 + description: "Total estimated time in seconds" + example: 600 + exported_rows: + type: integer + format: int64 + description: "Number of rows exported so far" + example: 750000 + total_rows: + type: integer + format: int64 + description: "Total number of rows to export" + example: 1000000 + total_export_parts: + type: integer + description: "Total number of export parts" + example: 10 + current_export_part: + type: integer + description: "Current export part being processed" + example: 7 + exported_rows_part: + type: integer + format: int64 + description: "Number of rows exported in the current part" + example: 75000 + total_rows_part: + type: integer + format: int64 + description: "Total number of rows in the current part" + example: 100000 + retries: + type: integer + description: "Number of manual retries" + example: 1 + automatic_retries: + type: integer + description: "Number of automatic retries" + example: 2 + scheduled_exec_at: + type: string + format: date-time + description: "Scheduled execution time" + last_part_exec_at: + type: string + format: date-time + description: "Time when the last part was executed" + export_started_at: + type: string + format: date-time + description: "Time when the export started" + created_at: + type: string + format: date-time + description: "Timestamp when the export history was created" + created_by_user_id: + type: integer + description: "ID of the user who created the export history" + updated_at: + type: string + format: date-time + description: "Timestamp when the export history was last updated" + cancelled_at: + type: string + format: date-time + description: "Timestamp when the export was cancelled" + cancelled_by_user_id: + type: integer + description: "ID of the user who cancelled the export" + cancelled_reason: + type: string + description: "Reason for cancellation" + example: "No longer needed" + error_message: + type: string + description: "Error message if the export failed" + example: "Connection timeout to storage provider" + required: + - id + - export_config_id + - status + - created_at + - created_by_user_id + + StorageConfig: + type: object + description: "Configuration for storage providers" + properties: + id: + type: integer + description: "Unique identifier for the storage configuration" + example: 1 + provider: + type: string + description: "Storage provider name" + example: "S3" + config: + type: object + description: "Provider-specific configuration" + created_at: + type: string + format: date-time + description: "Timestamp when the storage config was created" + created_by_user_id: + type: integer + description: "ID of the user who created the storage config" + updated_at: + type: string + format: date-time + description: "Timestamp when the storage config was last updated" + updated_by_user_id: + type: integer + description: "ID of the user who last updated the storage config" + required: + - id + - provider + - config + - created_at + - created_by_user_id + + StorageConfigInput: + type: object + description: "Input for creating or updating a storage configuration" + properties: + provider: + type: string + description: "Storage provider name" + example: "S3" + config: + type: object + description: "Provider-specific configuration" + required: + - provider + - config diff --git a/openapi_console/paths/files.yaml b/openapi_console/paths/files.yaml new file mode 100644 index 00000000..449ac9b5 --- /dev/null +++ b/openapi_console/paths/files.yaml @@ -0,0 +1,63 @@ +files_usage_id_action_filename: + parameters: + - name: usage + in: path + required: true + schema: + type: string + description: "The usage type of the file" + example: "logo" + - name: id + in: path + required: true + schema: + type: string + description: "The ID of the file" + example: "123" + - name: action + in: path + required: true + schema: + type: string + enum: [crop, none] + description: "The action to perform on the file" + example: "none" + - name: filename + in: path + required: true + schema: + type: string + description: "The filename" + example: "image.jpg" + get: + summary: Files [GET] + description: "**Required Permissions**: Access to the file based on its usage type" + tags: + - Files + responses: + "200": + description: OK + content: + image/*: + schema: + type: string + format: binary + "302": + description: Found (Redirected to on-demand version) + "401": + description: Unauthorized + "404": + description: Not Found + + head: + summary: Files [HEAD] + description: "**Required Permissions**: Access to the file based on its usage type" + tags: + - Files + responses: + "200": + description: OK + "401": + description: Unauthorized + "404": + description: Not Found diff --git a/openapi_console/paths/goal_tags.yaml b/openapi_console/paths/goal_tags.yaml new file mode 100644 index 00000000..a40b736a --- /dev/null +++ b/openapi_console/paths/goal_tags.yaml @@ -0,0 +1,228 @@ +goal_tags: + get: + summary: Goal Tags [LIST] + description: "**Required Permissions**: `Goal List` or `Goal Admin`" + parameters: + - name: sort + in: query + schema: + type: string + example: "tag" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + tags: + - Goal Tags + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/GoalTag" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + post: + summary: Goal Tag [CREATE] + description: "**Required Permissions**: `Goal Create` or `Goal Admin`" + tags: + - Goal Tags + requestBody: + content: + application/json: + schema: + type: object + properties: + tag: + type: string + description: "Tag name" + example: "revenue" + required: + - tag + responses: + "201": + description: Created + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + example: true + goal_tag: + $ref: "#/components/schemas/GoalTag" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + +goal_tags_by_id: + get: + summary: Goal Tag [GET] + description: "**Required Permissions**: `Goal Get` or `Goal Admin`" + parameters: + - name: tagId + in: path + required: true + schema: + type: integer + tags: + - Goal Tags + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + goal_tag: + $ref: "#/components/schemas/GoalTag" + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Goal Tag not found + put: + summary: Goal Tag [UPDATE] + description: "**Required Permissions**: `Goal Edit` or `Goal Admin`" + parameters: + - name: tagId + in: path + required: true + schema: + type: integer + tags: + - Goal Tags + requestBody: + content: + application/json: + schema: + type: object + properties: + tag: + type: string + description: "Tag name" + example: "revenue-v2" + required: + - tag + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + example: true + goal_tag: + $ref: "#/components/schemas/GoalTag" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Goal Tag not found + delete: + summary: Goal Tag [DELETE] + description: "**Required Permissions**: `Goal Archive` or `Goal Admin`" + parameters: + - name: tagId + in: path + required: true + schema: + type: integer + tags: + - Goal Tags + responses: + "204": + description: No Content + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Goal Tag not found + +# Components +components: + schemas: + GoalTag: + type: object + description: "Represents a tag for goals" + properties: + id: + type: integer + description: "Unique identifier for the goal tag" + example: 1 + tag: + type: string + description: "Tag name" + example: "revenue" + created_at: + type: string + format: date-time + description: "When the tag was created" + example: "2023-01-01T00:00:00Z" + created_by_user_id: + type: integer + description: "ID of the user who created the tag" + example: 1 + created_by: + $ref: "#/components/schemas/User" + updated_at: + type: string + format: date-time + description: "When the tag was last updated" + example: "2023-01-02T00:00:00Z" + updated_by_user_id: + type: integer + description: "ID of the user who last updated the tag" + example: 1 + updated_by: + $ref: "#/components/schemas/User" + required: + - id + - tag + - created_at + - created_by_user_id diff --git a/openapi_console/paths/goals.yaml b/openapi_console/paths/goals.yaml new file mode 100644 index 00000000..3b01a34b --- /dev/null +++ b/openapi_console/paths/goals.yaml @@ -0,0 +1,485 @@ +goals: + get: + summary: Goal [LIST] + description: "**Required Permissions**: `Goal List` or `Goal Admin`" + parameters: + - name: sort + in: query + schema: + type: string + example: "created_at" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/Goal" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + post: + summary: Goal [CREATE] + description: "**Required Permissions**: `Goal Create` or `Goal Admin`" + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + goal: + type: object + properties: + name: + type: string + example: "Increase Conversion Rate" + application_id: + type: integer + example: 1 + metric_id: + type: integer + example: 1 + environment_id: + type: integer + example: 1 + required: + - name + - application_id + - metric_id + - environment_id + required: + - goal + responses: + "201": + description: Created + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + goal: + $ref: "#/components/schemas/Goal" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + +goals_by_id: + get: + summary: Goal [GET] + description: "**Required Permissions**: `Goal Get` or `Goal Admin`" + parameters: + - name: goalId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + goal: + $ref: "#/components/schemas/Goal" + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Goal not found + put: + summary: Goal [UPDATE] + description: "**Required Permissions**: `Goal Edit` or `Goal Admin`" + parameters: + - name: goalId + in: path + required: true + schema: + type: integer + description: The id of the Goal that you wish to update. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + goal: + type: object + properties: + name: + type: string + example: "Updated Conversion Rate Goal" + application_id: + type: integer + example: 1 + metric_id: + type: integer + example: 1 + environment_id: + type: integer + example: 1 + required: + - goal + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + goal: + $ref: "#/components/schemas/Goal" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Goal not found + delete: + summary: Goal [DELETE] + description: "**Required Permissions**: `Goal Delete` or `Goal Admin`" + parameters: + - name: goalId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Goal not found + +goal_tags: + get: + summary: Goal Tag [LIST] + description: "**Required Permissions**: `Goal Tag List` or `Goal Admin`" + parameters: + - name: sort + in: query + schema: + type: string + example: "name" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/GoalTag" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + post: + summary: Goal Tag [CREATE] + description: "**Required Permissions**: `Goal Tag Create` or `Goal Admin`" + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + goal_tag: + type: object + properties: + name: + type: string + example: "revenue" + color: + type: string + example: "#4CAF50" + required: + - name + - color + required: + - goal_tag + responses: + "201": + description: Created + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + goal_tag: + $ref: "#/components/schemas/GoalTag" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + +goal_tags_by_id: + get: + summary: Goal Tag [GET] + description: "**Required Permissions**: `Goal Tag Get` or `Goal Admin`" + parameters: + - name: goalTagId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + goal_tag: + $ref: "#/components/schemas/GoalTag" + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Goal Tag not found + put: + summary: Goal Tag [UPDATE] + description: "**Required Permissions**: `Goal Tag Edit` or `Goal Admin`" + parameters: + - name: goalTagId + in: path + required: true + schema: + type: integer + description: The id of the Goal Tag that you wish to update. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + goal_tag: + type: object + properties: + name: + type: string + example: "Updated Tag Name" + color: + type: string + example: "#2196F3" + required: + - goal_tag + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + goal_tag: + $ref: "#/components/schemas/GoalTag" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Goal Tag not found + delete: + summary: Goal Tag [DELETE] + description: "**Required Permissions**: `Goal Tag Delete` or `Goal Admin`" + parameters: + - name: goalTagId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Goal Tag not found + +# Components +components: + schemas: + Goal: + type: object + description: "Represents a business objective that experiments aim to impact" + properties: + id: + type: integer + description: "Unique identifier for the goal" + example: 1 + name: + type: string + description: "Name of the goal" + example: "Increase Conversion Rate" + application_id: + type: integer + description: "ID of the application this goal is associated with" + example: 1 + environment_id: + type: integer + description: "ID of the environment this goal is associated with" + example: 2 + metric_id: + type: integer + description: "ID of the primary metric used to measure this goal" + example: 3 + target_value: + type: number + format: float + description: "Target value for the goal metric" + example: 15.5 + created_at: + type: string + format: date-time + description: "When the goal was created" + example: "2023-01-01T00:00:00Z" + updated_at: + type: string + format: date-time + description: "When the goal was last updated" + example: "2023-01-02T00:00:00Z" + tags: + type: array + items: + $ref: "#/components/schemas/GoalTag" + required: + - id + - name + - application_id + - environment_id + - metric_id + + GoalTag: + type: object + properties: + id: + type: integer + description: "Unique identifier for the goal tag" + example: 1 + name: + type: string + description: "Name of the tag" + example: "revenue" + color: + type: string + description: "Color code for the tag" + example: "#4CAF50" + required: + - id + - name diff --git a/openapi_console/paths/insights.yaml b/openapi_console/paths/insights.yaml new file mode 100644 index 00000000..a6ad1227 --- /dev/null +++ b/openapi_console/paths/insights.yaml @@ -0,0 +1,382 @@ +insights: + get: + summary: Insights [LIST] + description: "Redirects to insightsvelocitywidgets for backward compatibility" + tags: + - Insights + responses: + "308": + description: Permanent Redirect + +insightsvelocitywidgets: + get: + summary: Velocity Insights Widgets [GET] + description: "**Required Permissions**: `ExperimentReports List` or `ExperimentReports Admin`" + tags: + - Insights + parameters: + - name: from + in: query + schema: + type: integer + description: "Start time in epoch seconds" + example: 1609459200 + - name: to + in: query + schema: + type: integer + description: "End time in epoch seconds" + example: 1640995200 + - name: aggregation + in: query + schema: + type: string + enum: [day, week, month, quarter, year] + default: month + description: "Time period aggregation" + - name: unit_type_ids + in: query + schema: + type: array + items: + type: integer + description: "Filter by unit type IDs" + - name: primary_metric_ids + in: query + schema: + type: array + items: + type: integer + description: "Filter by primary metric IDs" + - name: analysis_types + in: query + schema: + type: array + items: + type: string + description: "Filter by analysis types" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/VelocityWidgetsResponse" + "401": + description: Unauthorized + "403": + description: Forbidden + +insightsvelocityhistory: + get: + summary: Velocity Insights History [GET] + description: "**Required Permissions**: `ExperimentReports List` or `ExperimentReports Admin`" + tags: + - Insights + parameters: + - name: from + in: query + schema: + type: integer + description: "Start time in epoch seconds" + example: 1609459200 + - name: to + in: query + schema: + type: integer + description: "End time in epoch seconds" + example: 1640995200 + - name: aggregation + in: query + schema: + type: string + enum: [day, week, month, quarter, year] + default: month + description: "Time period aggregation" + - name: unit_type_ids + in: query + schema: + type: array + items: + type: integer + description: "Filter by unit type IDs" + - name: primary_metric_ids + in: query + schema: + type: array + items: + type: integer + description: "Filter by primary metric IDs" + - name: analysis_types + in: query + schema: + type: array + items: + type: string + description: "Filter by analysis types" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/VelocityHistoryResponse" + "401": + description: Unauthorized + "403": + description: Forbidden + +insightsdecisionswidgets: + get: + summary: Decisions Insights Widgets [GET] + description: "**Required Permissions**: `ExperimentReports List` or `ExperimentReports Admin`" + tags: + - Insights + parameters: + - name: from + in: query + schema: + type: integer + description: "Start time in epoch seconds" + example: 1609459200 + - name: to + in: query + schema: + type: integer + description: "End time in epoch seconds" + example: 1640995200 + - name: aggregation + in: query + schema: + type: string + enum: [day, week, month, quarter, year] + default: month + description: "Time period aggregation" + - name: unit_type_ids + in: query + schema: + type: array + items: + type: integer + description: "Filter by unit type IDs" + - name: primary_metric_ids + in: query + schema: + type: array + items: + type: integer + description: "Filter by primary metric IDs" + - name: analysis_types + in: query + schema: + type: array + items: + type: string + description: "Filter by analysis types" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/DecisionsWidgetsResponse" + "401": + description: Unauthorized + "403": + description: Forbidden + +insightsdecisionshistory: + get: + summary: Decisions Insights History [GET] + description: "**Required Permissions**: `ExperimentReports List` or `ExperimentReports Admin`" + tags: + - Insights + parameters: + - name: from + in: query + schema: + type: integer + description: "Start time in epoch seconds" + example: 1609459200 + - name: to + in: query + schema: + type: integer + description: "End time in epoch seconds" + example: 1640995200 + - name: aggregation + in: query + schema: + type: string + enum: [day, week, month, quarter, year] + default: month + description: "Time period aggregation" + - name: unit_type_ids + in: query + schema: + type: array + items: + type: integer + description: "Filter by unit type IDs" + - name: primary_metric_ids + in: query + schema: + type: array + items: + type: integer + description: "Filter by primary metric IDs" + - name: analysis_types + in: query + schema: + type: array + items: + type: string + description: "Filter by analysis types" + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/DecisionsHistoryResponse" + "401": + description: Unauthorized + "403": + description: Forbidden + +# Components +components: + schemas: + VelocityWidgetsResponse: + type: object + description: "Velocity widgets summary data" + properties: + total_started: + type: integer + description: "Total number of experiments started in the period" + example: 15 + total_running: + type: integer + description: "Total number of experiments running in the period" + example: 10 + completed_insignificant: + type: integer + description: "Number of experiments completed with insignificant results" + example: 3 + completed_positive: + type: integer + description: "Number of experiments completed with positive results" + example: 5 + completed_negative: + type: integer + description: "Number of experiments completed with negative results" + example: 2 + aborted: + type: integer + description: "Number of experiments aborted in the period" + example: 1 + required: + - total_started + - total_running + - completed_insignificant + - completed_positive + - completed_negative + - aborted + + VelocityHistoryResponse: + type: object + description: "Velocity history data" + properties: + items: + type: array + items: + type: object + properties: + date_from: + type: string + format: date-time + description: "Start of the time period" + date_to: + type: string + format: date-time + description: "End of the time period" + started: + type: integer + description: "Number of experiments started in the period" + running: + type: integer + description: "Number of experiments running in the period" + completed_insignificant: + type: integer + description: "Number of experiments completed with insignificant results" + completed_positive: + type: integer + description: "Number of experiments completed with positive results" + completed_negative: + type: integer + description: "Number of experiments completed with negative results" + aborted: + type: integer + description: "Number of experiments aborted in the period" + description: "Array of time period data points" + required: + - items + + DecisionsWidgetsResponse: + type: object + description: "Decisions widgets summary data" + properties: + full_on_supported: + type: integer + description: "Number of experiments set to full-on with analysis support" + example: 8 + full_on_not_supported: + type: integer + description: "Number of experiments set to full-on without analysis support" + example: 2 + keep_current: + type: integer + description: "Number of experiments that were completed but not set to full-on" + example: 3 + aborted: + type: integer + description: "Number of experiments aborted in the period" + example: 1 + required: + - full_on_supported + - full_on_not_supported + - keep_current + - aborted + + DecisionsHistoryResponse: + type: object + description: "Decisions history data" + properties: + items: + type: array + items: + type: object + properties: + date_from: + type: string + format: date-time + description: "Start of the time period" + date_to: + type: string + format: date-time + description: "End of the time period" + full_on_supported: + type: integer + description: "Number of experiments set to full-on with analysis support" + full_on_not_supported: + type: integer + description: "Number of experiments set to full-on without analysis support" + keep_current: + type: integer + description: "Number of experiments that were completed but not set to full-on" + aborted: + type: integer + description: "Number of experiments aborted in the period" + description: "Array of time period data points" + required: + - items diff --git a/openapi_console/paths/metric_tags.yaml b/openapi_console/paths/metric_tags.yaml new file mode 100644 index 00000000..962212e8 --- /dev/null +++ b/openapi_console/paths/metric_tags.yaml @@ -0,0 +1,228 @@ +metric_tags: + get: + summary: Metric Tags [LIST] + description: "**Required Permissions**: `Metric List` or `Metric Admin`" + parameters: + - name: sort + in: query + schema: + type: string + example: "tag" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + tags: + - Metric Tags + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/MetricTag" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + post: + summary: Metric Tag [CREATE] + description: "**Required Permissions**: `Metric Create` or `Metric Admin`" + tags: + - Metric Tags + requestBody: + content: + application/json: + schema: + type: object + properties: + tag: + type: string + description: "Tag name" + example: "conversion" + required: + - tag + responses: + "201": + description: Created + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + example: true + metric_tag: + $ref: "#/components/schemas/MetricTag" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + +metric_tags_by_id: + get: + summary: Metric Tag [GET] + description: "**Required Permissions**: `Metric Get` or `Metric Admin`" + parameters: + - name: tagId + in: path + required: true + schema: + type: integer + tags: + - Metric Tags + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + metric_tag: + $ref: "#/components/schemas/MetricTag" + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Metric Tag not found + put: + summary: Metric Tag [UPDATE] + description: "**Required Permissions**: `Metric Edit` or `Metric Admin`" + parameters: + - name: tagId + in: path + required: true + schema: + type: integer + tags: + - Metric Tags + requestBody: + content: + application/json: + schema: + type: object + properties: + tag: + type: string + description: "Tag name" + example: "conversion-v2" + required: + - tag + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + example: true + metric_tag: + $ref: "#/components/schemas/MetricTag" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Metric Tag not found + delete: + summary: Metric Tag [DELETE] + description: "**Required Permissions**: `Metric Archive` or `Metric Admin`" + parameters: + - name: tagId + in: path + required: true + schema: + type: integer + tags: + - Metric Tags + responses: + "204": + description: No Content + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Metric Tag not found + +# Components +components: + schemas: + MetricTag: + type: object + description: "Represents a tag for metrics" + properties: + id: + type: integer + description: "Unique identifier for the metric tag" + example: 1 + tag: + type: string + description: "Tag name" + example: "conversion" + created_at: + type: string + format: date-time + description: "When the tag was created" + example: "2023-01-01T00:00:00Z" + created_by_user_id: + type: integer + description: "ID of the user who created the tag" + example: 1 + created_by: + $ref: "#/components/schemas/User" + updated_at: + type: string + format: date-time + description: "When the tag was last updated" + example: "2023-01-02T00:00:00Z" + updated_by_user_id: + type: integer + description: "ID of the user who last updated the tag" + example: 1 + updated_by: + $ref: "#/components/schemas/User" + required: + - id + - tag + - created_at + - created_by_user_id diff --git a/openapi_console/paths/metrics.yaml b/openapi_console/paths/metrics.yaml new file mode 100644 index 00000000..335a9be2 --- /dev/null +++ b/openapi_console/paths/metrics.yaml @@ -0,0 +1,508 @@ +metrics: + get: + summary: Metric [LIST] + description: "**Required Permissions**: `Metric List` or `Metric Admin`" + parameters: + - name: sort + in: query + schema: + type: string + example: "created_at" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/Metric" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + post: + summary: Metric [CREATE] + description: "**Required Permissions**: `Metric Create` or `Metric Admin`" + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + metric: + type: object + properties: + name: + type: string + example: "Conversion Rate" + application_id: + type: integer + example: 1 + unit_id: + type: integer + example: 1 + environment_id: + type: integer + example: 1 + required: + - name + - application_id + - unit_id + - environment_id + required: + - metric + responses: + "201": + description: Created + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + metric: + $ref: "#/components/schemas/Metric" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + +metrics_by_id: + get: + summary: Metric [GET] + description: "**Required Permissions**: `Metric Get` or `Metric Admin`" + parameters: + - name: metricId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + metric: + $ref: "#/components/schemas/Metric" + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Metric not found + put: + summary: Metric [UPDATE] + description: "**Required Permissions**: `Metric Edit` or `Metric Admin`" + parameters: + - name: metricId + in: path + required: true + schema: + type: integer + description: The id of the Metric that you wish to update. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + metric: + type: object + properties: + name: + type: string + example: "Updated Conversion Rate" + application_id: + type: integer + example: 1 + unit_id: + type: integer + example: 1 + environment_id: + type: integer + example: 1 + required: + - metric + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + metric: + $ref: "#/components/schemas/Metric" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Metric not found + delete: + summary: Metric [DELETE] + description: "**Required Permissions**: `Metric Delete` or `Metric Admin`" + parameters: + - name: metricId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Metric not found + +metric_tags: + get: + summary: Metric Tag [LIST] + description: "**Required Permissions**: `Metric Tag List` or `Metric Admin`" + parameters: + - name: sort + in: query + schema: + type: string + example: "name" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/MetricTag" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + post: + summary: Metric Tag [CREATE] + description: "**Required Permissions**: `Metric Tag Create` or `Metric Admin`" + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + metric_tag: + type: object + properties: + name: + type: string + example: "conversion" + color: + type: string + example: "#2196F3" + required: + - name + - color + required: + - metric_tag + responses: + "201": + description: Created + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + metric_tag: + $ref: "#/components/schemas/MetricTag" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + +metric_tags_by_id: + get: + summary: Metric Tag [GET] + description: "**Required Permissions**: `Metric Tag Get` or `Metric Admin`" + parameters: + - name: metricTagId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + metric_tag: + $ref: "#/components/schemas/MetricTag" + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Metric Tag not found + put: + summary: Metric Tag [UPDATE] + description: "**Required Permissions**: `Metric Tag Edit` or `Metric Admin`" + parameters: + - name: metricTagId + in: path + required: true + schema: + type: integer + description: The id of the Metric Tag that you wish to update. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + metric_tag: + type: object + properties: + name: + type: string + example: "Updated Tag Name" + color: + type: string + example: "#2196F3" + required: + - metric_tag + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + metric_tag: + $ref: "#/components/schemas/MetricTag" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Metric Tag not found + delete: + summary: Metric Tag [DELETE] + description: "**Required Permissions**: `Metric Tag Delete` or `Metric Admin`" + parameters: + - name: metricTagId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Metric Tag not found + +# Components +components: + schemas: + Metric: + type: object + description: "A metric model that defines how to measure and calculate experiment results" + properties: + id: + type: integer + description: "Unique identifier for the metric (auto-generated)" + example: 15 + name: + type: string + description: "Name of the metric. Must be unique within an application. Max length 256 characters." + example: "conversion_rate" + maxLength: 256 + description: + type: string + description: "Detailed description of what the metric measures and how it's calculated. Max length 8192 characters." + example: "Percentage of users who complete a purchase" + maxLength: 8192 + application_id: + type: integer + description: "ID of the application this metric is associated with" + example: 1 + environment_id: + type: integer + description: "ID of the environment this metric is associated with" + example: 2 + goal_id: + type: integer + description: "ID of the goal this metric is associated with, if any" + example: 3 + unit_id: + type: integer + description: "ID of the unit type for this metric (e.g., percentage, count, currency)" + example: 5 + expression: + type: string + description: "Mathematical expression used to calculate this metric, if it's a derived metric" + example: "(total_purchases / total_visitors) * 100" + sql_query: + type: string + description: "SQL query used to retrieve the data for this metric, if applicable" + example: "SELECT COUNT(*) FROM purchases WHERE completed = true" + created_at: + type: string + format: date-time + description: "When the metric was created" + example: "2023-01-01T00:00:00Z" + updated_at: + type: string + format: date-time + description: "When the metric was last updated" + example: "2023-01-02T00:00:00Z" + tags: + type: array + items: + $ref: "#/components/schemas/MetricTag" + required: + - id + - name + - application_id + - environment_id + - unit_id + example: + id: 15 + name: "conversion_rate" + description: "Percentage of users who complete a purchase" + goal_id: 70 + application_id: 1 + environment_id: 2 + unit_id: 5 + created_at: "2023-01-01T00:00:00Z" + updated_at: "2023-01-02T00:00:00Z" + + MetricTag: + type: object + properties: + id: + type: integer + description: "Unique identifier for the metric tag" + example: 1 + name: + type: string + description: "Name of the tag" + example: "conversion" + color: + type: string + description: "Color code for the tag" + example: "#2196F3" + required: + - id + - name diff --git a/openapi_console/paths/permission_categories.yaml b/openapi_console/paths/permission_categories.yaml new file mode 100644 index 00000000..51172916 --- /dev/null +++ b/openapi_console/paths/permission_categories.yaml @@ -0,0 +1,41 @@ +permission_categories: + get: + summary: Permission Categories [LIST] + description: "**Required Permissions**: `Authenticated`" + tags: + - Permission Categories + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + permission_categories: + type: array + items: + $ref: "#/components/schemas/PermissionCategory" + required: + - permission_categories + "401": + description: Unauthorized + +# Components +components: + schemas: + PermissionCategory: + type: object + description: "Represents a category for grouping permissions" + properties: + id: + type: integer + description: "Unique identifier for the permission category" + example: 1 + name: + type: string + description: "Category name" + example: "User Management" + required: + - id + - name diff --git a/openapi_console/paths/permissions.yaml b/openapi_console/paths/permissions.yaml new file mode 100644 index 00000000..adf86622 --- /dev/null +++ b/openapi_console/paths/permissions.yaml @@ -0,0 +1,439 @@ +permission_categories: + get: + summary: Permission Category [LIST] + description: "**Required Permissions**: `Role Admin`" + parameters: + - name: sort + in: query + schema: + type: string + example: "created_at" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/PermissionCategory" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + +permissions: + get: + summary: Permission [LIST] + description: "**Required Permissions**: `Role Admin`" + parameters: + - name: sort + in: query + schema: + type: string + example: "created_at" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/Permission" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + +roles: + get: + summary: Role [LIST] + description: "**Required Permissions**: `Role List` or `Role Admin`" + parameters: + - name: sort + in: query + schema: + type: string + example: "created_at" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/Role" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + post: + summary: Role [CREATE] + description: "**Required Permissions**: `Role Create` or `Role Admin`" + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + role: + type: object + properties: + name: + type: string + example: "Administrator" + permission_ids: + type: array + items: + type: integer + example: [1, 2, 3] + required: + - name + - permission_ids + required: + - role + responses: + "201": + description: Created + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + role: + $ref: "#/components/schemas/Role" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + +roles_by_id: + get: + summary: Role [GET] + description: "**Required Permissions**: `Role Get` or `Role Admin`" + parameters: + - name: roleId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + role: + $ref: "#/components/schemas/Role" + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Role not found + put: + summary: Role [UPDATE] + description: "**Required Permissions**: `Role Edit` or `Role Admin`" + parameters: + - name: roleId + in: path + required: true + schema: + type: integer + description: The id of the Role that you wish to update. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + role: + type: object + properties: + name: + type: string + example: "Updated Role Name" + permission_ids: + type: array + items: + type: integer + example: [1, 2, 3, 4] + required: + - role + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + role: + $ref: "#/components/schemas/Role" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Role not found + delete: + summary: Role [DELETE] + description: "**Required Permissions**: `Role Delete` or `Role Admin`" + parameters: + - name: roleId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Role not found + +components: + schemas: + Permission: + type: object + description: "Represents a permission that can be assigned to roles for access control" + properties: + id: + type: integer + description: "Unique identifier for the permission" + example: 1 + name: + type: string + description: "Name of the permission" + example: "Experiment View" + category: + type: string + description: "Category this permission belongs to" + example: "Experiment" + description: + type: string + description: "Detailed description of what this permission allows" + example: "Allows viewing experiments" + scope: + type: string + description: "Scope of the permission (Global, Team, or Application)" + enum: ["Global", "Team", "Application"] + example: "Application" + created_at: + type: string + format: date-time + description: "When the permission was created" + example: "2023-01-01T00:00:00Z" + updated_at: + type: string + format: date-time + description: "When the permission was last updated" + example: "2023-01-02T00:00:00Z" + required: + - id + - name + - category + - scope + example: + id: 1 + name: "Experiment View" + category: "Experiment" + description: "Allows viewing experiments" + scope: "Application" + created_at: "2023-01-01T00:00:00Z" + updated_at: "2023-01-02T00:00:00Z" + + Role: + type: object + description: "Represents a set of permissions that can be assigned to users" + properties: + id: + type: integer + description: "Unique identifier for the role" + example: 1 + name: + type: string + description: "Name of the role" + example: "Administrator" + description: + type: string + description: "Detailed description of the role" + example: "Full administrative access to all features" + is_system_role: + type: boolean + description: "Whether this is a system-defined role (cannot be modified by users)" + example: true + created_at: + type: string + format: date-time + description: "When the role was created" + example: "2023-01-01T00:00:00Z" + updated_at: + type: string + format: date-time + description: "When the role was last updated" + example: "2023-01-02T00:00:00Z" + permissions: + type: array + items: + $ref: "#/components/schemas/Permission" + required: + - id + - name + - is_system_role + + PermissionCategory: + type: object + description: "Represents a category for grouping related permissions" + properties: + id: + type: integer + description: "Unique identifier for the permission category" + example: 1 + name: + type: string + description: "Name of the category" + example: "Experiment" + description: + type: string + description: "Description of the permission category" + example: "Permissions related to experiment management" + created_at: + type: string + format: date-time + description: "When the category was created" + example: "2023-01-01T00:00:00Z" + updated_at: + type: string + format: date-time + description: "When the category was last updated" + example: "2023-01-02T00:00:00Z" + required: + - id + - name + example: + id: 1 + name: "Experiment" + description: "Permissions related to experiment management" + created_at: "2023-01-01T00:00:00Z" + updated_at: "2023-01-02T00:00:00Z" diff --git a/openapi_console/paths/permissions_and_roles.yaml b/openapi_console/paths/permissions_and_roles.yaml new file mode 100644 index 00000000..8603900c --- /dev/null +++ b/openapi_console/paths/permissions_and_roles.yaml @@ -0,0 +1,450 @@ +# Permission endpoints +permission_categories: + get: + summary: Permission Category [LIST] + description: "**Required Permissions**: `Role Admin`" + parameters: + - name: sort + in: query + schema: + type: string + example: "created_at" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/PermissionCategory" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + +permissions: + get: + summary: Permission [LIST] + description: "**Required Permissions**: `Role Admin`" + parameters: + - name: sort + in: query + schema: + type: string + example: "created_at" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/Permission" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + +# Role endpoints +roles: + get: + summary: Role [LIST] + description: "**Required Permissions**: `Role List` or `Role Admin`" + parameters: + - name: sort + in: query + schema: + type: string + example: "created_at" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/Role" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + post: + summary: Role [CREATE] + description: "**Required Permissions**: `Role Create` or `Role Admin`" + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + role: + type: object + properties: + name: + type: string + example: "Administrator" + permission_ids: + type: array + items: + type: integer + example: [1, 2, 3] + required: + - name + - permission_ids + required: + - role + responses: + "201": + description: Created + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + role: + $ref: "#/components/schemas/Role" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + +roles_by_id: + get: + summary: Role [GET] + description: "**Required Permissions**: `Role Get` or `Role Admin`" + parameters: + - name: roleId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + role: + $ref: "#/components/schemas/Role" + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Role not found + put: + summary: Role [UPDATE] + description: "**Required Permissions**: `Role Edit` or `Role Admin`" + parameters: + - name: roleId + in: path + required: true + schema: + type: integer + description: The id of the Role that you wish to update. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + role: + type: object + properties: + name: + type: string + example: "Updated Role Name" + permission_ids: + type: array + items: + type: integer + example: [1, 2, 3, 4] + required: + - role + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + role: + $ref: "#/components/schemas/Role" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Role not found + delete: + summary: Role [DELETE] + description: "**Required Permissions**: `Role Delete` or `Role Admin`" + parameters: + - name: roleId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Role not found + +# Components +components: + schemas: + PermissionCategory: + type: object + description: "Represents a category grouping related permissions" + properties: + id: + type: integer + description: "Unique identifier for the permission category" + example: 1 + name: + type: string + description: "Name of the permission category" + example: "Experiment" + display_order: + type: integer + description: "Order in which this category should be displayed in UI" + example: 10 + created_at: + type: string + format: date-time + description: "When the permission category was created" + example: "2023-01-01T00:00:00Z" + updated_at: + type: string + format: date-time + description: "When the permission category was last updated" + example: "2023-01-02T00:00:00Z" + required: + - id + - name + - display_order + example: + id: 1 + name: "Experiment" + display_order: 10 + created_at: "2023-01-01T00:00:00Z" + updated_at: "2023-01-02T00:00:00Z" + + Permission: + type: object + description: "Represents a permission that can be assigned to roles for access control" + properties: + id: + type: integer + description: "Unique identifier for the permission" + example: 1 + name: + type: string + description: "Name of the permission" + example: "Experiment View" + category: + type: string + description: "Category this permission belongs to" + example: "Experiment" + description: + type: string + description: "Detailed description of what this permission allows" + example: "Allows viewing experiments" + scope: + type: string + description: "Scope of the permission (Global, Team, or Application)" + enum: ["Global", "Team", "Application"] + example: "Application" + created_at: + type: string + format: date-time + description: "When the permission was created" + example: "2023-01-01T00:00:00Z" + updated_at: + type: string + format: date-time + description: "When the permission was last updated" + example: "2023-01-02T00:00:00Z" + required: + - id + - name + - category + - scope + example: + id: 1 + name: "Experiment View" + category: "Experiment" + description: "Allows viewing experiments" + scope: "Application" + created_at: "2023-01-01T00:00:00Z" + updated_at: "2023-01-02T00:00:00Z" + + Role: + type: object + description: "Represents a set of permissions that can be assigned to users" + properties: + id: + type: integer + description: "Unique identifier for the role" + example: 1 + name: + type: string + description: "Name of the role" + example: "Administrator" + description: + type: string + description: "Detailed description of the role" + example: "Full administrative access to all features" + is_system_role: + type: boolean + description: "Whether this is a system-defined role (cannot be modified by users)" + example: true + created_at: + type: string + format: date-time + description: "When the role was created" + example: "2023-01-01T00:00:00Z" + updated_at: + type: string + format: date-time + description: "When the role was last updated" + example: "2023-01-02T00:00:00Z" + permissions: + type: array + items: + $ref: "#/components/schemas/Permission" + required: + - id + - name + - is_system_role + example: + id: 1 + name: "Administrator" + description: "Full administrative access to all features" + is_system_role: true + created_at: "2023-01-01T00:00:00Z" + updated_at: "2023-01-02T00:00:00Z" diff --git a/openapi_console/paths/roles.yaml b/openapi_console/paths/roles.yaml new file mode 100644 index 00000000..61cadb5d --- /dev/null +++ b/openapi_console/paths/roles.yaml @@ -0,0 +1,307 @@ +roles: + get: + summary: Roles [LIST] + description: "**Required Permissions**: `Role List` or `Role Admin`" + parameters: + - name: sort + in: query + schema: + type: string + example: "name" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + tags: + - Roles + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/Role" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + post: + summary: Role [CREATE] + description: "**Required Permissions**: `Role Create` or `Role Admin`" + tags: + - Roles + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: "Role name" + example: "Marketing Manager" + description: + type: string + description: "Role description" + example: "Role for marketing managers with access to metrics and experiments" + permissions: + type: array + description: "List of permission IDs associated with this role" + items: + type: object + properties: + permission_id: + type: integer + access_control_policies: + type: array + description: "List of access control policy IDs associated with this role" + items: + type: object + properties: + access_control_policy_id: + type: integer + required: + - name + - permissions + responses: + "201": + description: Created + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + example: true + role: + $ref: "#/components/schemas/Role" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + +roles_by_id: + get: + summary: Role [GET] + description: "**Required Permissions**: `Role Get` or `Role Admin`" + parameters: + - name: roleId + in: path + required: true + schema: + type: integer + tags: + - Roles + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + role: + $ref: "#/components/schemas/Role" + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Role not found + put: + summary: Role [UPDATE] + description: "**Required Permissions**: `Role Edit` or `Role Admin`" + parameters: + - name: roleId + in: path + required: true + schema: + type: integer + tags: + - Roles + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: "Role name" + example: "Senior Marketing Manager" + description: + type: string + description: "Role description" + example: "Updated role for senior marketing managers" + permissions: + type: array + description: "List of permission IDs associated with this role" + items: + type: object + properties: + permission_id: + type: integer + access_control_policies: + type: array + description: "List of access control policy IDs associated with this role" + items: + type: object + properties: + access_control_policy_id: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + example: true + role: + $ref: "#/components/schemas/Role" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Role not found + delete: + summary: Role [DELETE] + description: "**Required Permissions**: `Role Delete` or `Role Admin`" + parameters: + - name: roleId + in: path + required: true + schema: + type: integer + tags: + - Roles + responses: + "204": + description: No Content + "400": + description: Bad Request - Role is not deletable + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Role not found + +# Components +components: + schemas: + Role: + type: object + description: "Represents a user role with associated permissions" + properties: + id: + type: integer + description: "Unique identifier for the role" + example: 1 + name: + type: string + description: "Role name" + example: "Marketing Manager" + description: + type: string + description: "Role description" + example: "Role for marketing managers with access to metrics and experiments" + created_at: + type: string + format: date-time + description: "When the role was created" + example: "2023-01-01T00:00:00Z" + created_by_user_id: + type: integer + description: "ID of the user who created the role" + example: 1 + created_by: + $ref: "#/components/schemas/User" + updated_at: + type: string + format: date-time + description: "When the role was last updated" + example: "2023-01-02T00:00:00Z" + updated_by_user_id: + type: integer + description: "ID of the user who last updated the role" + example: 1 + updated_by: + $ref: "#/components/schemas/User" + deletable: + type: boolean + description: "Whether the role can be deleted" + example: true + default_user_role: + type: boolean + description: "Whether this is the default role for new users" + example: false + full_admin_role: + type: boolean + description: "Whether this role has full admin privileges" + example: false + permissions: + type: array + description: "Permissions associated with this role" + items: + type: object + properties: + permission_id: + type: integer + permission: + $ref: "#/components/schemas/Permission" + access_control_policies: + type: array + description: "Access control policies associated with this role" + items: + type: object + properties: + access_control_policy_id: + type: integer + access_control_policy: + $ref: "#/components/schemas/AccessControlPolicy" + required: + - id + - name + - created_at + - deletable + - default_user_role + - full_admin_role diff --git a/openapi_console/paths/segments.yaml b/openapi_console/paths/segments.yaml new file mode 100644 index 00000000..96b2bb92 --- /dev/null +++ b/openapi_console/paths/segments.yaml @@ -0,0 +1,269 @@ +segments: + get: + summary: Segment [LIST] + description: "**Required Permissions**: `Segment List` or `Segment Admin`" + parameters: + - name: sort + in: query + schema: + type: string + example: "created_at" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/Segment" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + post: + summary: Segment [CREATE] + description: "**Required Permissions**: `Segment Create` or `Segment Admin`" + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + segment: + type: object + properties: + name: + type: string + example: "Mobile Users" + application_id: + type: integer + example: 1 + environment_id: + type: integer + example: 1 + definition: + type: object + example: { "type": "mobile" } + required: + - name + - application_id + - environment_id + - definition + required: + - segment + responses: + "201": + description: Created + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + segment: + $ref: "#/components/schemas/Segment" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + +segments_by_id: + get: + summary: Segment [GET] + description: "**Required Permissions**: `Segment Get` or `Segment Admin`" + parameters: + - name: segmentId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + segment: + $ref: "#/components/schemas/Segment" + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Segment not found + put: + summary: Segment [UPDATE] + description: "**Required Permissions**: `Segment Edit` or `Segment Admin`" + parameters: + - name: segmentId + in: path + required: true + schema: + type: integer + description: The id of the Segment that you wish to update. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + segment: + type: object + properties: + name: + type: string + example: "Updated Segment Name" + application_id: + type: integer + example: 1 + environment_id: + type: integer + example: 1 + definition: + type: object + example: { "type": "mobile", "version": "2.0" } + required: + - segment + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + segment: + $ref: "#/components/schemas/Segment" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Segment not found + delete: + summary: Segment [DELETE] + description: "**Required Permissions**: `Segment Delete` or `Segment Admin`" + parameters: + - name: segmentId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Segment not found + +# Components +components: + schemas: + Segment: + type: object + description: "Represents a segment of users or traffic for targeting in experiments" + properties: + id: + type: integer + description: "Unique identifier for the segment" + example: 1 + name: + type: string + description: "Name of the segment" + example: "Mobile Users" + description: + type: string + description: "Detailed description of the segment" + example: "Users accessing the site from mobile devices" + application_id: + type: integer + description: "ID of the application this segment belongs to" + example: 1 + environment_id: + type: integer + description: "ID of the environment this segment belongs to" + example: 2 + filter_expression: + type: string + description: "Expression used to evaluate if a user belongs to this segment" + example: "context.device.type == 'mobile'" + created_at: + type: string + format: date-time + description: "When the segment was created" + example: "2023-01-01T00:00:00Z" + updated_at: + type: string + format: date-time + description: "When the segment was last updated" + example: "2023-01-02T00:00:00Z" + required: + - id + - name + - application_id + - environment_id + example: + id: 1 + name: "Mobile Users" + description: "Users accessing the site from mobile devices" + application_id: 1 + environment_id: 2 + filter_expression: "context.device.type == 'mobile'" + created_at: "2023-01-01T00:00:00Z" + updated_at: "2023-01-02T00:00:00Z" diff --git a/openapi_console/paths/storage_configs.yaml b/openapi_console/paths/storage_configs.yaml new file mode 100644 index 00000000..fda4edfc --- /dev/null +++ b/openapi_console/paths/storage_configs.yaml @@ -0,0 +1,180 @@ +storage_configs: + get: + summary: Storage Configs [LIST] + description: "**Required Permissions**: `ExportConfig List` or `ExportConfig Admin`" + parameters: + - name: sort + in: query + schema: + type: string + example: "name" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + tags: + - Storage Configs + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/StorageConfig" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + +storage_configs_by_id: + parameters: + - name: id + in: path + required: true + schema: + type: integer + description: "Unique identifier for the storage configuration" + get: + summary: Storage Configs [GET] + description: "**Required Permissions**: `ExportConfig List` or `ExportConfig Admin`" + tags: + - Storage Configs + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/StorageConfig" + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Not Found + +storage_configs_test: + post: + summary: Storage Configs [TEST] + description: "**Required Permissions**: `ExportConfig Create` or `ExportConfig Update` or `ExportConfig Admin`" + tags: + - Storage Configs + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: "Storage configuration name" + example: "S3 Storage Config" + type: + type: string + enum: [S3] + description: "Storage type" + example: "S3" + properties: + type: object + description: "Provider-specific configuration properties" + required: + - name + - type + - properties + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + description: "Indicates if the test was successful" + message: + type: string + description: "Success or error message" + required: + - success + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + +# Components +components: + schemas: + StorageConfig: + type: object + description: "Configuration for storage providers" + properties: + id: + type: integer + description: "Unique identifier for the storage configuration" + example: 1 + name: + type: string + description: "Descriptive name for the storage configuration" + example: "S3 Storage Config" + properties: + type: object + description: "Provider-specific configuration properties" + type: + type: string + enum: [S3] + description: "Storage type" + example: "S3" + created_at: + type: string + format: date-time + description: "Timestamp when the storage config was created" + created_by_user_id: + type: integer + description: "ID of the user who created the storage config" + updated_at: + type: string + format: date-time + description: "Timestamp when the storage config was last updated" + updated_by_user_id: + type: integer + description: "ID of the user who last updated the storage config" + required: + - id + - name + - properties + - type + - created_at + - created_by_user_id diff --git a/openapi_console/paths/unit_types.yaml b/openapi_console/paths/unit_types.yaml new file mode 100644 index 00000000..253b59c2 --- /dev/null +++ b/openapi_console/paths/unit_types.yaml @@ -0,0 +1,258 @@ +unit_types: + get: + summary: Unit Type [LIST] + description: "**Required Permissions**: `UnitType List` or `UnitType Admin`" + parameters: + - name: sort + in: query + schema: + type: string + example: "created_at" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/UnitType" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + post: + summary: Unit Type [CREATE] + description: "**Required Permissions**: `UnitType Create` or `UnitType Admin`" + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + unit_type: + type: object + properties: + name: + type: string + example: "Percent" + short_name: + type: string + example: "%" + higher_is_better: + type: boolean + example: true + required: + - name + - short_name + - higher_is_better + required: + - unit_type + responses: + "201": + description: Created + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + unit_type: + $ref: "#/components/schemas/UnitType" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + +unit_types_by_id: + get: + summary: Unit Type [GET] + description: "**Required Permissions**: `UnitType Get` or `UnitType Admin`" + parameters: + - name: unitTypeId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + unit_type: + $ref: "#/components/schemas/UnitType" + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Unit Type not found + put: + summary: Unit Type [UPDATE] + description: "**Required Permissions**: `UnitType Edit` or `UnitType Admin`" + parameters: + - name: unitTypeId + in: path + required: true + schema: + type: integer + description: The id of the Unit Type that you wish to update. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + unit_type: + type: object + properties: + name: + type: string + example: "Updated Unit Type" + short_name: + type: string + example: "UT" + higher_is_better: + type: boolean + example: false + required: + - unit_type + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + unit_type: + $ref: "#/components/schemas/UnitType" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Unit Type not found + delete: + summary: Unit Type [DELETE] + description: "**Required Permissions**: `UnitType Delete` or `UnitType Admin`" + parameters: + - name: unitTypeId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Unit Type not found + +# Components +components: + schemas: + UnitType: + type: object + description: "Represents a unit of measurement for metrics (e.g., percentage, count, currency)" + properties: + id: + type: integer + description: "Unique identifier for the unit type" + example: 1 + name: + type: string + description: "Name of the unit type" + example: "Percentage" + abbreviation: + type: string + description: "Short abbreviation for the unit type" + example: "%" + precision: + type: integer + description: "Number of decimal places to display for values of this unit type" + example: 2 + is_system_unit: + type: boolean + description: "Whether this is a system-defined unit type (cannot be modified by users)" + example: true + created_at: + type: string + format: date-time + description: "When the unit type was created" + example: "2023-01-01T00:00:00Z" + updated_at: + type: string + format: date-time + description: "When the unit type was last updated" + example: "2023-01-02T00:00:00Z" + required: + - id + - name + - abbreviation + - precision + - is_system_unit + example: + id: 1 + name: "Percentage" + abbreviation: "%" + precision: 2 + is_system_unit: true + created_at: "2023-01-01T00:00:00Z" + updated_at: "2023-01-02T00:00:00Z" diff --git a/openapi_console/paths/users_and_teams.yaml b/openapi_console/paths/users_and_teams.yaml new file mode 100644 index 00000000..8a6e83f2 --- /dev/null +++ b/openapi_console/paths/users_and_teams.yaml @@ -0,0 +1,680 @@ +# User endpoints +users: + get: + summary: User [LIST] + description: "**Required Permissions**: `User List` or `User Admin`" + parameters: + - name: sort + in: query + schema: + type: string + example: "created_at" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/User" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + post: + summary: User [CREATE] + description: "**Required Permissions**: `User Create` or `User Admin`" + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + user: + type: object + properties: + email: + type: string + format: email + example: "user@example.com" + name: + type: string + example: "John Doe" + role_id: + type: integer + example: 1 + team_ids: + type: array + items: + type: integer + example: [1, 2] + required: + - email + - name + - role_id + required: + - user + responses: + "201": + description: Created + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + user: + $ref: "#/components/schemas/User" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + +users_by_id: + get: + summary: User [GET] + description: "**Required Permissions**: `User Get` or `User Admin`" + parameters: + - name: userId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + user: + $ref: "#/components/schemas/User" + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: User not found + put: + summary: User [UPDATE] + description: "**Required Permissions**: `User Edit` or `User Admin`" + parameters: + - name: userId + in: path + required: true + schema: + type: integer + description: The id of the User that you wish to update. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + user: + type: object + properties: + email: + type: string + format: email + example: "updated@example.com" + name: + type: string + example: "Updated User Name" + role_id: + type: integer + example: 2 + team_ids: + type: array + items: + type: integer + example: [1, 2, 3] + required: + - user + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + user: + $ref: "#/components/schemas/User" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: User not found + delete: + summary: User [DELETE] + description: "**Required Permissions**: `User Delete` or `User Admin`" + parameters: + - name: userId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: User not found + +users_api_keys: + get: + summary: User's API Keys [LIST] + description: "**Required Permissions**: `ApiKey List` or `ApiKey Admin`" + parameters: + - name: userId + in: path + required: true + schema: + type: integer + - name: sort + in: query + schema: + type: string + example: "created_at" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "./api_keys.yaml#/components/schemas/ApiKey" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: User not found + +# Team endpoints +teams: + get: + summary: Team [LIST] + description: "**Required Permissions**: `Team List` or `Team Admin`" + parameters: + - name: sort + in: query + schema: + type: string + example: "created_at" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/Team" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + post: + summary: Team [CREATE] + description: "**Required Permissions**: `Team Create` or `Team Admin`" + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + team: + type: object + properties: + name: + type: string + example: "Engineering Team" + application_ids: + type: array + items: + type: integer + example: [1, 2] + user_ids: + type: array + items: + type: integer + example: [101, 102] + required: + - name + required: + - team + responses: + "201": + description: Created + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + team: + $ref: "#/components/schemas/Team" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + +teams_by_id: + get: + summary: Team [GET] + description: "**Required Permissions**: `Team Get` or `Team Admin`" + parameters: + - name: teamId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + team: + $ref: "#/components/schemas/Team" + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Team not found + put: + summary: Team [UPDATE] + description: "**Required Permissions**: `Team Edit` or `Team Admin`" + parameters: + - name: teamId + in: path + required: true + schema: + type: integer + description: The id of the Team that you wish to update. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + team: + type: object + properties: + name: + type: string + example: "Updated Team Name" + application_ids: + type: array + items: + type: integer + example: [1, 2, 3] + user_ids: + type: array + items: + type: integer + example: [101, 102, 103] + required: + - team + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + team: + $ref: "#/components/schemas/Team" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Team not found + delete: + summary: Team [DELETE] + description: "**Required Permissions**: `Team Delete` or `Team Admin`" + parameters: + - name: teamId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Team not found + +# Components +components: + schemas: + User: + type: object + description: "Represents a user of the system with authentication and authorization capabilities" + properties: + id: + type: integer + description: "Unique identifier for the user" + example: 1 + email: + type: string + format: email + description: "User's email address, used for login" + example: "john.doe@example.com" + first_name: + type: string + description: "User's first name" + example: "John" + last_name: + type: string + description: "User's last name" + example: "Doe" + full_name: + type: string + description: "User's full name" + example: "John Doe" + is_superadmin: + type: boolean + description: "Whether the user has superadmin privileges" + example: false + avatar_url: + type: string + format: uri + description: "URL to the user's avatar image" + example: "https://example.com/avatars/johndoe.jpg" + created_at: + type: string + format: date-time + description: "When the user was created" + example: "2023-01-01T00:00:00Z" + updated_at: + type: string + format: date-time + description: "When the user was last updated" + example: "2023-01-02T00:00:00Z" + last_login_at: + type: string + format: date-time + description: "When the user last logged in" + example: "2023-01-15T10:30:00Z" + teams: + type: array + items: + $ref: "#/components/schemas/TeamMember" + global_role: + $ref: "./permissions_and_roles.yaml#/components/schemas/Role" + required: + - id + - email + - first_name + - last_name + - full_name + - is_superadmin + - created_at + - updated_at + example: + id: 1 + email: "john.doe@example.com" + first_name: "John" + last_name: "Doe" + full_name: "John Doe" + is_superadmin: false + avatar_url: "https://example.com/avatars/johndoe.jpg" + created_at: "2023-01-01T00:00:00Z" + updated_at: "2023-01-02T00:00:00Z" + last_login_at: "2023-01-15T10:30:00Z" + + Team: + type: object + description: "Represents a team of users who collaborate on experiments and applications" + properties: + id: + type: integer + description: "Unique identifier for the team" + example: 1 + name: + type: string + description: "Name of the team" + example: "Marketing Team" + description: + type: string + description: "Detailed description of the team" + example: "Team responsible for marketing experiments and campaigns" + created_at: + type: string + format: date-time + description: "When the team was created" + example: "2023-01-01T00:00:00Z" + updated_at: + type: string + format: date-time + description: "When the team was last updated" + example: "2023-01-02T00:00:00Z" + required: + - id + - name + example: + id: 1 + name: "Marketing Team" + description: "Team responsible for marketing experiments and campaigns" + created_at: "2023-01-01T00:00:00Z" + updated_at: "2023-01-02T00:00:00Z" + + TeamMember: + type: object + description: "Represents a user's membership in a team" + properties: + team_id: + type: integer + description: "ID of the team" + example: 1 + user_id: + type: integer + description: "ID of the user" + example: 2 + role_id: + type: integer + description: "ID of the role assigned to the user in this team" + example: 3 + created_at: + type: string + format: date-time + description: "When the team membership was created" + example: "2023-01-01T00:00:00Z" + updated_at: + type: string + format: date-time + description: "When the team membership was last updated" + example: "2023-01-02T00:00:00Z" + role: + $ref: "./permissions_and_roles.yaml#/components/schemas/Role" + required: + - team_id + - user_id + - role_id + example: + team_id: 1 + user_id: 2 + role_id: 3 + created_at: "2023-01-01T00:00:00Z" + updated_at: "2023-01-02T00:00:00Z" + + TeamApplication: + type: object + description: "Represents an application assigned to a team" + properties: + team_id: + type: integer + description: "ID of the team" + example: 1 + application_id: + type: integer + description: "ID of the application" + example: 2 + created_at: + type: string + format: date-time + description: "When the application was assigned to the team" + example: "2023-01-01T00:00:00Z" + updated_at: + type: string + format: date-time + description: "When the team-application relationship was last updated" + example: "2023-01-02T00:00:00Z" + required: + - team_id + - application_id + example: + team_id: 1 + application_id: 2 + created_at: "2023-01-01T00:00:00Z" + updated_at: "2023-01-02T00:00:00Z" diff --git a/openapi_console/paths/webhooks.yaml b/openapi_console/paths/webhooks.yaml new file mode 100644 index 00000000..e3767bff --- /dev/null +++ b/openapi_console/paths/webhooks.yaml @@ -0,0 +1,443 @@ +webhook_events: + get: + summary: Webhook Event [LIST] + description: "**Required Permissions**: `Webhook Event List` or `Webhook Event Admin`" + parameters: + - name: sort + in: query + schema: + type: string + example: "created_at" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/WebhookEvent" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + +webhooks: + get: + summary: Webhook [LIST] + description: "**Required Permissions**: `Webhook List` or `Webhook Admin`" + parameters: + - name: sort + in: query + schema: + type: string + example: "created_at" + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: "#/components/schemas/Webhook" + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + "401": + description: Unauthorized + "403": + description: Forbidden + post: + summary: Webhook [CREATE] + description: "**Required Permissions**: `Webhook Create` or `Webhook Admin`" + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + webhook: + type: object + properties: + name: + type: string + example: "Experiment Status Update" + url: + type: string + format: uri + example: "https://example.com/webhook" + application_id: + type: integer + example: 1 + environment_id: + type: integer + example: 1 + webhook_event_ids: + type: array + items: + type: integer + example: [1, 2] + headers: + type: object + example: { "Authorization": "Bearer token123" } + required: + - name + - url + - application_id + - environment_id + - webhook_event_ids + required: + - webhook + responses: + "201": + description: Created + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + webhook: + $ref: "#/components/schemas/Webhook" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + +webhooks_by_id: + get: + summary: Webhook [GET] + description: "**Required Permissions**: `Webhook Get` or `Webhook Admin`" + parameters: + - name: webhookId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + webhook: + $ref: "#/components/schemas/Webhook" + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Webhook not found + put: + summary: Webhook [UPDATE] + description: "**Required Permissions**: `Webhook Edit` or `Webhook Admin`" + parameters: + - name: webhookId + in: path + required: true + schema: + type: integer + description: The id of the Webhook that you wish to update. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + webhook: + type: object + properties: + name: + type: string + example: "Updated Webhook Name" + url: + type: string + format: uri + example: "https://updated-example.com/webhook" + application_id: + type: integer + example: 1 + environment_id: + type: integer + example: 1 + webhook_event_ids: + type: array + items: + type: integer + example: [1, 2, 3] + headers: + type: object + example: { "Authorization": "Bearer updated-token", "X-Custom": "Value" } + required: + - webhook + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + webhook: + $ref: "#/components/schemas/Webhook" + "400": + description: Bad Request + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Webhook not found + delete: + summary: Webhook [DELETE] + description: "**Required Permissions**: `Webhook Delete` or `Webhook Admin`" + parameters: + - name: webhookId + in: path + required: true + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + ok: + type: boolean + example: true + "401": + description: Unauthorized + "403": + description: Forbidden + "404": + description: Webhook not found + +components: + schemas: + Webhook: + type: object + description: "Represents a webhook configuration for receiving event notifications" + properties: + id: + type: integer + description: "Unique identifier for the webhook" + example: 1 + name: + type: string + description: "Name of the webhook" + example: "Production Deployment Hook" + url: + type: string + format: uri + description: "URL endpoint to send webhook events to" + example: "https://example.com/webhooks/absmartly" + application_id: + type: integer + description: "ID of the application this webhook is associated with" + example: 1 + environment_id: + type: integer + description: "ID of the environment this webhook is associated with" + example: 2 + secret: + type: string + description: "Secret key used to sign webhook payloads" + example: "whsec_abc123def456" + status: + type: string + description: "Status of the webhook (active, disabled)" + enum: ["active", "disabled"] + example: "active" + events: + type: array + items: + type: string + description: "List of event types this webhook subscribes to" + example: ["experiment.created", "experiment.started", "experiment.ended"] + created_at: + type: string + format: date-time + description: "When the webhook was created" + example: "2023-01-01T00:00:00Z" + updated_at: + type: string + format: date-time + description: "When the webhook was last updated" + example: "2023-01-02T00:00:00Z" + required: + - id + - name + - url + - application_id + - environment_id + - status + - events + example: + id: 1 + name: "Production Deployment Hook" + url: "https://example.com/webhooks/absmartly" + application_id: 1 + environment_id: 2 + secret: "whsec_abc123def456" + status: "active" + events: ["experiment.created", "experiment.started", "experiment.ended"] + created_at: "2023-01-01T00:00:00Z" + updated_at: "2023-01-02T00:00:00Z" + + WebhookEvent: + type: object + description: "Represents a type of event that can trigger a webhook" + properties: + id: + type: integer + description: "Unique identifier for the webhook event type" + example: 1 + name: + type: string + description: "Name of the event type" + example: "experiment.started" + description: + type: string + description: "Description of when this event is triggered" + example: "Triggered when an experiment is started" + category: + type: string + description: "Category of the event (e.g., experiment, application)" + example: "experiment" + created_at: + type: string + format: date-time + description: "When the webhook event type was created" + example: "2023-01-01T00:00:00Z" + updated_at: + type: string + format: date-time + description: "When the webhook event type was last updated" + example: "2023-01-02T00:00:00Z" + required: + - id + - name + - category + + WebhookDelivery: + type: object + description: "Represents a single webhook delivery attempt" + properties: + id: + type: integer + description: "Unique identifier for the webhook delivery" + example: 1 + webhook_id: + type: integer + description: "ID of the webhook that was delivered" + example: 1 + event_type: + type: string + description: "Type of event that triggered the webhook" + example: "experiment.started" + payload: + type: object + description: "JSON payload that was sent" + request_headers: + type: object + description: "HTTP headers sent with the request" + response_headers: + type: object + description: "HTTP headers received in the response" + response_body: + type: string + description: "Response body received" + response_status_code: + type: integer + description: "HTTP status code received in the response" + example: 200 + successful: + type: boolean + description: "Whether the delivery was successful" + example: true + created_at: + type: string + format: date-time + description: "When the webhook delivery was created/attempted" + example: "2023-01-01T00:00:00Z" + required: + - id + - webhook_id + - event_type + - payload + - successful + - created_at From c34a82259a37d82c370567a7d98f239e00c2cc39 Mon Sep 17 00:00:00 2001 From: Jonas Alves Date: Wed, 26 Mar 2025 11:59:46 +0000 Subject: [PATCH 2/2] More changes to the OpenAPI spec --- openapi_console/openapi.yaml | 10 + .../paths/access_control_policies.yaml | 8 +- openapi_console/paths/api_keys.yaml | 25 +- openapi_console/paths/applications.yaml | 14 +- openapi_console/paths/configs.yaml | 28 +- openapi_console/paths/environments.yaml | 8 +- openapi_console/paths/events.yaml | 11 +- .../paths/experiment_custom_sections.yaml | 253 +++++++- openapi_console/paths/experiment_tags.yaml | 8 +- openapi_console/paths/experiments.yaml | 573 +++++++++++++++--- openapi_console/paths/export_configs.yaml | 22 +- openapi_console/paths/files.yaml | 3 +- openapi_console/paths/goal_tags.yaml | 8 +- openapi_console/paths/goals.yaml | 24 +- openapi_console/paths/insights.yaml | 18 +- openapi_console/paths/metric_tags.yaml | 6 +- openapi_console/paths/metrics.yaml | 14 +- .../paths/permission_categories.yaml | 2 +- openapi_console/paths/permissions.yaml | 10 +- .../paths/permissions_and_roles.yaml | 8 +- openapi_console/paths/roles.yaml | 6 +- openapi_console/paths/segments.yaml | 7 +- openapi_console/paths/storage_configs.yaml | 4 +- openapi_console/paths/unit_types.yaml | 6 +- openapi_console/paths/users_and_teams.yaml | 15 +- openapi_console/paths/webhooks.yaml | 17 +- 26 files changed, 942 insertions(+), 166 deletions(-) diff --git a/openapi_console/openapi.yaml b/openapi_console/openapi.yaml index 34ad79f7..8c77f173 100644 --- a/openapi_console/openapi.yaml +++ b/openapi_console/openapi.yaml @@ -8,6 +8,7 @@ info: email: api@absmartly.com license: name: Proprietary + url: "https://www.absmartly.com/terms" externalDocs: description: Find out more about ABsmartly url: "https://www.absmartly.com" @@ -183,6 +184,10 @@ paths: $ref: "./paths/experiment_custom_sections.yaml#/experiment_custom_sections_by_id" /experiment_custom_sections/order: $ref: "./paths/experiment_custom_sections.yaml#/experiment_custom_sections_order" + /experiment_custom_section_fields: + $ref: "./paths/experiment_custom_sections.yaml#/experiment_custom_section_fields" + /experiment_custom_section_fields/{id}: + $ref: "./paths/experiment_custom_sections.yaml#/experiment_custom_section_fields_by_id" # Components reference components: @@ -192,3 +197,8 @@ components: type: http scheme: bearer bearerFormat: JWT + UserApiKey: + type: apiKey + in: header + name: X-API-Key + description: API key for authentication diff --git a/openapi_console/paths/access_control_policies.yaml b/openapi_console/paths/access_control_policies.yaml index 0b28bccc..31651196 100644 --- a/openapi_console/paths/access_control_policies.yaml +++ b/openapi_console/paths/access_control_policies.yaml @@ -54,6 +54,7 @@ access_control_policies: description: Unauthorized "403": description: Forbidden + operationId: listaccessControlPolicies post: summary: Access Control Policy [CREATE] description: "**Required Permissions**: `Admin`" @@ -109,7 +110,7 @@ access_control_policies: description: Unauthorized "403": description: Forbidden - + operationId: createaccessControlPolicy access_control_policies_by_id: get: summary: Access Control Policy [GET] @@ -138,6 +139,7 @@ access_control_policies_by_id: description: Forbidden "404": description: Access Control Policy not found + operationId: getaccessControlPolicy put: summary: Access Control Policy [UPDATE] description: "**Required Permissions**: `Admin`" @@ -197,6 +199,7 @@ access_control_policies_by_id: description: Forbidden "404": description: Access Control Policy not found + operationId: updateaccessControlPolicy delete: summary: Access Control Policy [DELETE] description: "**Required Permissions**: `Admin`" @@ -217,8 +220,7 @@ access_control_policies_by_id: description: Forbidden "404": description: Access Control Policy not found - -# Components + operationId: deleteaccessControlPolicy components: schemas: AccessControlPolicy: diff --git a/openapi_console/paths/api_keys.yaml b/openapi_console/paths/api_keys.yaml index 833d88c1..2d1a2718 100644 --- a/openapi_console/paths/api_keys.yaml +++ b/openapi_console/paths/api_keys.yaml @@ -52,6 +52,7 @@ api_keys: description: Unauthorized "403": description: Forbidden + operationId: listaPIKey post: summary: API Key [CREATE] description: "**Required Permissions**: `ApiKey Create` or `ApiKey Admin`" @@ -103,7 +104,7 @@ api_keys: description: Unauthorized "403": description: Forbidden - + operationId: createaPIKey api_keys_by_id: get: summary: API Key [GET] @@ -123,10 +124,24 @@ api_keys_by_id: type: object properties: api_key: - $ref: "#/components/schemas/ApiKey" + $ref: '#/components/schemas/ApiKey' + '400': + description: Bad Request + '401': + description: Unauthorized + '403': + description: Forbidden + '404': + description: Not Found + operationId: getaPIKey put: summary: API Key [UPDATE] - description: "**Required Permissions**: `ApiKey Edit` or `ApiKey Admin`" + description: | + **Required Permissions**: `ApiKey Edit` or `ApiKey Admin` + + :::caution + Only fields provided in the request will be updated. Fields not included in the request body will retain their existing values. + ::: parameters: - name: apiKeyId in: path @@ -179,6 +194,7 @@ api_keys_by_id: description: Forbidden "404": description: API Key not found + operationId: updateaPIKey delete: summary: API Key [DELETE] description: "**Required Permissions**: `ApiKey Delete` or `ApiKey Admin`" @@ -205,8 +221,7 @@ api_keys_by_id: description: Forbidden "404": description: API Key not found - -# Components + operationId: deleteaPIKey components: schemas: ApiKey: diff --git a/openapi_console/paths/applications.yaml b/openapi_console/paths/applications.yaml index 1720f3bd..7c28ba8d 100644 --- a/openapi_console/paths/applications.yaml +++ b/openapi_console/paths/applications.yaml @@ -52,6 +52,7 @@ applications: description: Unauthorized "403": description: Forbidden + operationId: listapplication post: summary: Application [CREATE] description: "**Required Permissions**: `Application Create` or `Application Admin`" @@ -98,7 +99,7 @@ applications: description: Unauthorized "403": description: Forbidden - + operationId: createapplication applications_by_id: get: summary: Application [GET] @@ -125,9 +126,15 @@ applications_by_id: description: Forbidden "404": description: Application not found + operationId: getapplication put: summary: Application [UPDATE] - description: "**Required Permissions**: `Application Edit` or `Application Admin`" + description: | + **Required Permissions**: `Application Edit` or `Application Admin` + + :::caution + Only fields provided in the request will be updated. Fields not included in the request body will retain their existing values. + ::: parameters: - name: applicationId in: path @@ -177,6 +184,7 @@ applications_by_id: description: Forbidden "404": description: Application not found + operationId: updateapplication delete: summary: Application [DELETE] description: "**Required Permissions**: `Application Delete` or `Application Admin`" @@ -203,7 +211,7 @@ applications_by_id: description: Forbidden "404": description: Application not found - + operationId: deleteapplication components: schemas: Application: diff --git a/openapi_console/paths/configs.yaml b/openapi_console/paths/configs.yaml index b0a4bb32..6dc65013 100644 --- a/openapi_console/paths/configs.yaml +++ b/openapi_console/paths/configs.yaml @@ -54,7 +54,7 @@ configs: description: Unauthorized "403": description: Forbidden - + operationId: listconfigs configs_by_id: parameters: - name: id @@ -62,29 +62,34 @@ configs_by_id: required: true schema: type: integer - description: "Unique identifier for the configuration" + description: Unique identifier for the configuration get: summary: Configs [GET] - description: "**Required Permissions**: `Config List` or `Config Admin`" + description: '**Required Permissions**: `Config List` or `Config Admin`' tags: - Configs responses: - "200": + '200': description: OK content: application/json: schema: - $ref: "#/components/schemas/Config" - "401": + $ref: '#/components/schemas/Config' + '401': description: Unauthorized - "403": + '403': description: Forbidden - "404": + '404': description: Not Found - + operationId: getconfigs put: summary: Configs [UPDATE] - description: "**Required Permissions**: `Config Update` or `Config Admin`" + description: | + **Required Permissions**: `Config Update` or `Config Admin` + + :::caution + Only fields provided in the request will be updated. Fields not included in the request body will retain their existing values. + ::: tags: - Configs requestBody: @@ -115,8 +120,7 @@ configs_by_id: description: Forbidden "404": description: Not Found - -# Components + operationId: updateconfigs components: schemas: Config: diff --git a/openapi_console/paths/environments.yaml b/openapi_console/paths/environments.yaml index 0c05ef7d..ed305f4e 100644 --- a/openapi_console/paths/environments.yaml +++ b/openapi_console/paths/environments.yaml @@ -52,6 +52,7 @@ environments: description: Unauthorized "403": description: Forbidden + operationId: listenvironment post: summary: Environment [CREATE] description: "**Required Permissions**: `Environment Create` or `Environment Admin`" @@ -95,7 +96,7 @@ environments: description: Unauthorized "403": description: Forbidden - + operationId: createenvironment environments_by_id: get: summary: Environment [GET] @@ -122,6 +123,7 @@ environments_by_id: description: Forbidden "404": description: Environment not found + operationId: getenvironment put: summary: Environment [UPDATE] description: "**Required Permissions**: `Environment Edit` or `Environment Admin`" @@ -171,6 +173,7 @@ environments_by_id: description: Forbidden "404": description: Environment not found + operationId: updateenvironment delete: summary: Environment [DELETE] description: "**Required Permissions**: `Environment Delete` or `Environment Admin`" @@ -197,8 +200,7 @@ environments_by_id: description: Forbidden "404": description: Environment not found - -# Components + operationId: deleteenvironment components: schemas: Environment: diff --git a/openapi_console/paths/events.yaml b/openapi_console/paths/events.yaml index 0fadc144..d5538cf0 100644 --- a/openapi_console/paths/events.yaml +++ b/openapi_console/paths/events.yaml @@ -100,6 +100,7 @@ events: "403": description: Forbidden + operationId: createevents events_history: post: summary: Events History [LIST] @@ -208,7 +209,7 @@ events_history: description: Unauthorized "403": description: Forbidden - + operationId: createeventsHistory events_unit_data: post: summary: Get Unit Data @@ -258,6 +259,7 @@ events_unit_data: description: Unauthorized "403": description: Forbidden + operationId: geteventsUnitData delete: summary: Delete Unit Data description: "**Required Permissions**: `Delete`" @@ -305,7 +307,7 @@ events_unit_data: description: Unauthorized "403": description: Forbidden - + operationId: deleteeventsUnitData events_json_values: post: summary: Get JSON Values from Events @@ -380,7 +382,7 @@ events_json_values: description: Forbidden "404": description: Not Found - + operationId: geteventsJsonValues events_json_layouts: post: summary: Get JSON Layouts @@ -457,8 +459,7 @@ events_json_layouts: description: Unauthorized "403": description: Forbidden - -# Components + operationId: geteventsJsonLayouts components: schemas: Event: diff --git a/openapi_console/paths/experiment_custom_sections.yaml b/openapi_console/paths/experiment_custom_sections.yaml index 4b898e0c..f5421153 100644 --- a/openapi_console/paths/experiment_custom_sections.yaml +++ b/openapi_console/paths/experiment_custom_sections.yaml @@ -67,7 +67,7 @@ experiment_custom_sections: description: Unauthorized "403": description: Forbidden - + operationId: listexperimentCustomSections post: summary: Experiment Custom Sections [CREATE] description: "**Required Permissions**: `ExperimentCustomSection Create` or `ExperimentCustomSection Admin`" @@ -110,7 +110,7 @@ experiment_custom_sections: description: Unauthorized "403": description: Forbidden - + operationId: createexperimentCustomSections experiment_custom_sections_by_id: parameters: - name: id @@ -137,10 +137,17 @@ experiment_custom_sections_by_id: description: Forbidden "404": description: Not Found - + operationId: getexperimentCustomSections put: summary: Experiment Custom Sections [UPDATE] - description: "**Required Permissions**: `ExperimentCustomSection Update` or `ExperimentCustomSection Admin`" + description: | + **Required Permissions**: `ExperimentCustomSection Update` or `ExperimentCustomSection Admin` + + :::caution + Only fields provided in the request will be updated. Fields not included in the request body will retain their existing values. + + Note that when updating experiment fields within custom sections (e.g., through the Experiments endpoint), all existing custom section field values will be DELETED and replaced with only those provided in the request. + ::: tags: - Experiment Custom Sections requestBody: @@ -178,7 +185,7 @@ experiment_custom_sections_by_id: description: Forbidden "404": description: Not Found - + operationId: updateexperimentCustomSections delete: summary: Experiment Custom Sections [ARCHIVE] description: "**Required Permissions**: `ExperimentCustomSection Archive` or `ExperimentCustomSection Admin`" @@ -193,7 +200,7 @@ experiment_custom_sections_by_id: description: Forbidden "404": description: Not Found - + operationId: deleteexperimentCustomSections experiment_custom_sections_order: put: summary: Experiment Custom Sections [REORDER] @@ -260,14 +267,240 @@ experiment_custom_sections_order: type: string required: - ok - "400": + '400': description: Bad Request - "401": + '401': description: Unauthorized - "403": + '403': description: Forbidden + operationId: reorderExperimentCustomSections +experiment_custom_section_fields: + get: + summary: Experiment Custom Section Fields [LIST] + description: '**Required Permissions**: `ExperimentCustomSection List` or `ExperimentCustomSection Admin`' + tags: + - Experiment Custom Section Fields + parameters: + - name: sort + in: query + schema: + type: string + example: title + - name: page + in: query + schema: + type: integer + example: 1 + default: 1 + - name: per_page + in: query + schema: + type: integer + example: 15 + default: 15 + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/ExperimentCustomSectionField' + metadata: + type: object + properties: + count: + type: integer + page: + type: integer + page_count: + type: integer + per_page: + type: integer + total: + type: integer + required: + - items + - metadata + '401': + description: Unauthorized + '403': + description: Forbidden + operationId: listexperimentCustomSectionFields + post: + summary: Experiment Custom Section Fields [CREATE] + description: '**Required Permissions**: `ExperimentCustomSection Create` or `ExperimentCustomSection Admin`' + tags: + - Experiment Custom Section Fields + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: Name of the field + example: rollback_plan + title: + type: string + description: Display title of the field + example: Rollback Plan + description: + type: string + description: Description of the field + example: Describe how to rollback in case of issues + type: + type: string + enum: + - text + - string + - json + - boolean + - number + description: Data type of the field + example: text + required: + type: boolean + description: Whether the field is required + example: true + section_id: + type: integer + description: ID of the parent section + example: 1 + required: + - name + - title + - description + - type + - required + - section_id + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/ExperimentCustomSectionField' + '400': + description: Bad Request + '401': + description: Unauthorized + '403': + description: Forbidden + operationId: createexperimentCustomSectionFields +experiment_custom_section_fields_by_id: + parameters: + - name: id + in: path + required: true + schema: + type: integer + description: Unique identifier for the experiment custom section field + get: + summary: Experiment Custom Section Fields [GET] + description: '**Required Permissions**: `ExperimentCustomSection List` or `ExperimentCustomSection Admin`' + tags: + - Experiment Custom Section Fields + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ExperimentCustomSectionField' + '401': + description: Unauthorized + '403': + description: Forbidden + '404': + description: Not Found + operationId: getexperimentCustomSectionFields + put: + summary: Experiment Custom Section Fields [UPDATE] + description: | + **Required Permissions**: `ExperimentCustomSection Update` or `ExperimentCustomSection Admin` + + :::caution + Regular fields provided in the request will be updated. Regular fields not included in the request body will retain their existing values. -# Components + However, when updating experiment custom section field values through the Experiments endpoint, ALL existing field values will be DELETED and replaced with only those provided in the request. + ::: + tags: + - Experiment Custom Section Fields + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: Name of the field + example: rollback_plan + title: + type: string + description: Display title of the field + example: Rollback Plan + description: + type: string + description: Description of the field + example: Describe how to rollback in case of issues + type: + type: string + enum: + - text + - string + - json + - boolean + - number + description: Data type of the field + example: text + required: + type: boolean + description: Whether the field is required + example: true + section_id: + type: integer + description: ID of the parent section + example: 1 + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ExperimentCustomSectionField' + '400': + description: Bad Request + '401': + description: Unauthorized + '403': + description: Forbidden + '404': + description: Not Found + operationId: updateexperimentCustomSectionFields + delete: + summary: Experiment Custom Section Fields [ARCHIVE] + description: '**Required Permissions**: `ExperimentCustomSection Archive` or `ExperimentCustomSection Admin`' + tags: + - Experiment Custom Section Fields + responses: + '204': + description: No Content + '401': + description: Unauthorized + '403': + description: Forbidden + '404': + description: Not Found + operationId: deleteexperimentCustomSectionFields components: schemas: ExperimentCustomSection: diff --git a/openapi_console/paths/experiment_tags.yaml b/openapi_console/paths/experiment_tags.yaml index b011506d..65c190d1 100644 --- a/openapi_console/paths/experiment_tags.yaml +++ b/openapi_console/paths/experiment_tags.yaml @@ -54,6 +54,7 @@ experiment_tags: description: Unauthorized "403": description: Forbidden + operationId: listexperimentTags post: summary: Experiment Tag [CREATE] description: "**Required Permissions**: `Experiment Create` or `Experiment Admin`" @@ -90,7 +91,7 @@ experiment_tags: description: Unauthorized "403": description: Forbidden - + operationId: createexperimentTag experiment_tags_by_id: get: summary: Experiment Tag [GET] @@ -119,6 +120,7 @@ experiment_tags_by_id: description: Forbidden "404": description: Experiment Tag not found + operationId: getexperimentTag put: summary: Experiment Tag [UPDATE] description: "**Required Permissions**: `Experiment Edit` or `Experiment Admin`" @@ -163,6 +165,7 @@ experiment_tags_by_id: description: Forbidden "404": description: Experiment Tag not found + operationId: updateexperimentTag delete: summary: Experiment Tag [DELETE] description: "**Required Permissions**: `Experiment Archive` or `Experiment Admin`" @@ -183,8 +186,7 @@ experiment_tags_by_id: description: Forbidden "404": description: Experiment Tag not found - -# Components + operationId: deleteexperimentTag components: schemas: ExperimentTag: diff --git a/openapi_console/paths/experiments.yaml b/openapi_console/paths/experiments.yaml index 52189784..a7ccfd43 100644 --- a/openapi_console/paths/experiments.yaml +++ b/openapi_console/paths/experiments.yaml @@ -1,5 +1,6 @@ experiments: get: + operationId: listExperiments summary: Experiment [LIST] description: "**Required Permissions**: `Experiment List` or `Experiment Admin`" parameters: @@ -46,32 +47,27 @@ experiments: schema: type: object properties: - items: + experiments: type: array items: - $ref: "#/components/schemas/Experiment" - metadata: - type: object - properties: - count: - type: integer - page: - type: integer - page_count: - type: integer - per_page: - type: integer - total: - type: integer + $ref: '#/components/schemas/Experiment' + page: + type: integer + items: + type: integer + total: + type: integer required: + - experiments + - page - items - - metadata - "401": + - total + '401': description: Unauthorized "403": description: Forbidden - post: + operationId: createExperiment summary: Experiment [CREATE] description: "**Required Permissions**: `Experiment Create` or `Experiment Admin`" requestBody: @@ -139,10 +135,192 @@ experiments: custom_code: type: string example: "// custom code goes here" + custom_section_field_values: + type: array + description: "Custom section field values to associate with this experiment." + items: + type: object + properties: + field_id: + type: integer + description: "ID of the custom section field" + example: 1 + value: + type: string + description: "Value for the custom section field (will be parsed according to the field type)" + example: "Our rollback plan is to disable the experiment" + required: + - field_id + - value + example: [ + { + "field_id": 1, + "value": "This experiment tests the effect of different button colors on conversion rate" + }, + { + "field_id": 2, + "value": "We hypothesize that purple buttons will increase conversion by 5-10%" + }, + { + "field_id": 3, + "value": "We predict the purple variant will outperform control by at least 8%" + }, + { + "field_id": 4, + "value": "To increase conversion rates on the checkout page" + }, + { + "field_id": 5, + "value": "The implementation uses CSS changes only, with no backend modifications" + }, + { + "field_id": 6, + "value": "{\"targetAudience\": \"all users\", \"deviceTypes\": [\"desktop\", \"mobile\"]}" + }, + { + "field_id": 7, + "value": "1. Monitor conversion rates daily\n2. Check for any technical issues\n3. Prepare rollback plan" + }, + { + "field_id": 8, + "value": "Experiment approved by marketing team on March 25, 2025" + } + ] environment_id: type: integer description: The ID of the environment that this experiment is for. Must be an environment ID that exists in your account. example: 1 + display_name: + type: string + description: User-friendly display name for the experiment + example: Test Experiment for Button Colors + maxLength: 256 + type: + type: string + enum: + - test + - feature + - template + example: test + seed: + type: string + description: Seed value for deterministic randomization + example: abc123 + traffic_seed: + type: string + description: Seed value for traffic randomization + example: xyz789 + percentage_of_traffic: + type: integer + description: Percentage of traffic to include in the experiment (0-100) + example: 100 + minimum: 0 + maximum: 100 + nr_variants: + type: integer + description: Number of variants in the experiment + example: 2 + minimum: 2 + audience: + type: string + description: Audience targeting specification + example: "browser == 'chrome'" + audience_strict: + type: boolean + description: Whether audience targeting should be strict + example: false + minimum_detectable_effect: + type: number + format: float + description: Minimum detectable effect size for statistical significance + example: 0.05 + analysis_type: + type: string + enum: + - fixed_horizon + - group_sequential + example: fixed_horizon + group_sequential_futility_type: + type: string + nullable: true + description: Futility type for group sequential analysis + example: predicted + group_sequential_analysis_count: + type: integer + nullable: true + description: Number of analyses for group sequential analysis + example: 5 + group_sequential_min_analysis_interval: + type: integer + nullable: true + description: Minimum interval between analyses for group sequential analysis (in days) + example: 7 + group_sequential_first_analysis_interval: + type: integer + nullable: true + description: First analysis interval for group sequential analysis (in days) + example: 14 + group_sequential_max_duration_interval: + type: integer + nullable: true + description: Maximum duration interval for group sequential analysis (in days) + example: 90 + baseline_primary_metric_mean: + type: number + format: float + nullable: true + description: Mean value of the primary metric at baseline + example: 0.5 + baseline_primary_metric_stdev: + type: number + format: float + nullable: true + description: Standard deviation of the primary metric at baseline + example: 0.1 + baseline_participants_per_day: + type: integer + nullable: true + description: Expected participants per day based on baseline + example: 1000 + required_alpha: + type: number + format: float + description: Required significance level (alpha) + example: 0.05 + required_power: + type: number + format: float + description: Required statistical power + example: 0.8 + parent_experiment_id: + type: integer + description: ID of the parent experiment (for iterations/versions of experiments) + example: 42 + nullable: true + parent_experiment_iteration: + type: integer + description: Iteration number of the parent experiment + example: 1 + nullable: true + template_description: + type: string + description: Description for experiment templates + example: "A/B test template for button color tests" + nullable: true + template_iteration: + type: integer + description: Iteration number for experiment templates + example: 1 + nullable: true + unit_type_id: + type: integer + description: ID of the unit type for this experiment + example: 1 + primary_metric_id: + type: integer + description: ID of the primary metric for this experiment + example: 1 + nullable: true required: - name - team_id @@ -172,9 +350,9 @@ experiments: description: Unauthorized "403": description: Forbidden - experiments_by_id: get: + operationId: getExperiment summary: Experiment [GET] description: "**Required Permissions**: `Experiment Get` or `Experiment Admin`" parameters: @@ -202,8 +380,16 @@ experiments_by_id: "404": description: Experiment not found put: + operationId: updateExperiment summary: Experiment [UPDATE] - description: "**Required Permissions**: `Experiment Edit` or `Experiment Admin`" + description: | + **Required Permissions**: `Experiment Edit` or `Experiment Admin` + + :::caution + Only regular fields provided in the request will be updated. Regular fields not included in the request body will retain their existing values. + + However, if custom section field values (`custom_section_field_values`) are included in the request, ALL existing custom field values will be DELETED and replaced with only those provided in the request. + ::: parameters: - name: experimentId in: path @@ -240,6 +426,57 @@ experiments_by_id: type: string custom_code: type: string + custom_section_field_values: + type: array + description: "Custom section field values. If included, all existing values will be DELETED and replaced with these." + items: + type: object + properties: + field_id: + type: integer + description: "ID of the custom section field" + example: 1 + value: + type: string + description: "Value for the custom section field (will be parsed according to the field type)" + example: "Our rollback plan is to disable the experiment" + required: + - field_id + - value + example: [ + { + "field_id": 1, + "value": "This experiment tests the effect of different button colors on checkout conversion rate" + }, + { + "field_id": 2, + "value": "We hypothesize that purple buttons will increase conversion by 5-10% due to better visibility" + }, + { + "field_id": 3, + "value": "Initial results suggest 7% improvement, expecting to reach 10% by end of experiment" + }, + { + "field_id": 4, + "value": "To increase conversion rates and improve user experience on the checkout page" + }, + { + "field_id": 5, + "value": "CSS changes implemented via JavaScript injection to avoid caching issues" + }, + { + "field_id": 6, + "value": "{\"targetAudience\": \"all users\", \"deviceTypes\": [\"desktop\", \"mobile\", \"tablet\"], \"regions\": [\"US\", \"EU\"]}" + }, + { + "field_id": 7, + "value": "1. Daily monitoring shows stable performance\n2. No technical issues observed\n3. If CR drops below -2%, trigger auto-disable" + }, + { + "field_id": 8, + "value": "Mid-experiment review: Results promising, proceed to full traffic allocation" + } + ] responses: "200": description: OK @@ -260,7 +497,6 @@ experiments_by_id: description: Forbidden "404": description: Experiment not found - experiments_start: post: summary: Experiment [START] @@ -291,7 +527,7 @@ experiments_start: description: Forbidden "404": description: Experiment not found - + operationId: createexperiment experiments_stop: post: summary: Experiment [STOP] @@ -322,7 +558,7 @@ experiments_stop: description: Forbidden "404": description: Experiment not found - + operationId: createexperiment experiments_development: post: summary: Experiment [DEVELOPMENT] @@ -355,7 +591,7 @@ experiments_development: description: Forbidden "404": description: Experiment not found - + operationId: createexperiment experiments_full_on: post: summary: Experiment [FULL ON] @@ -386,7 +622,7 @@ experiments_full_on: description: Forbidden "404": description: Experiment not found - + operationId: createexperiment experiments_archive: post: summary: Experiment [ARCHIVE] @@ -417,9 +653,10 @@ experiments_archive: description: Forbidden "404": description: Experiment not found - + operationId: createexperiment experiments_participants_history: post: + operationId: getExperimentParticipantsHistory summary: Experiment-Participants-History [GET] description: "**Required Permissions**: `Experiment Get` or `Experiment Admin`" parameters: @@ -498,9 +735,17 @@ experiments_participants_history: ["2025-03-16", "Control", "2025-03-16T00:00:00Z", "2025-03-16T23:59:59Z", 4890, 10170], ["2025-03-16", "Variant A", "2025-03-16T00:00:00Z", "2025-03-16T23:59:59Z", 4920, 10230] ] - + '400': + description: Bad Request + '401': + description: Unauthorized + '403': + description: Forbidden + '404': + description: Experiment not found experiments_metrics_main_history: post: + operationId: getExperimentMainMetricsHistory summary: Experiment-Main-Metrics-History [DATA] description: "**Required Permissions**: `Experiment Get` or `Experiment Admin`" parameters: @@ -589,9 +834,17 @@ experiments_metrics_main_history: ["2025-03-16", "Control", "2025-03-16T00:00:00Z", "2025-03-16T23:59:59Z", 4890, 10170, 401, 0.0820, 0.00037, 1.0, 0, 0, 0], ["2025-03-16", "Variant A", "2025-03-16T00:00:00Z", "2025-03-16T23:59:59Z", 4920, 10230, 442, 0.0898, 0.00036, 0.019, 9.51, 1.57, 17.45] ] - + '400': + description: Bad Request + '401': + description: Unauthorized + '403': + description: Forbidden + '404': + description: Experiment not found experiments_metrics_main: post: + operationId: getExperimentMainMetrics summary: Experiment-Main-Metrics [DATA] description: "**Required Permissions**: `Experiment Get` or `Experiment Admin`" parameters: @@ -665,9 +918,18 @@ experiments_metrics_main: ["Control", "2025-03-15T08:00:00Z", "2025-03-16T23:59:59Z", 10170, 824, 0.0810, 0.00035, 1.0, 0, 0, 0], ["Variant A", "2025-03-15T08:00:00Z", "2025-03-16T23:59:59Z", 10230, 898, 0.0878, 0.00035, 0.021, 8.40, 1.25, 15.55] ] + '400': + description: Bad Request + '401': + description: Unauthorized + '403': + description: Forbidden + '404': + description: Experiment not found experiments_activity: get: + operationId: getExperimentActivity summary: Experiment-Activity [GET] description: "**Required Permissions**: `Experiment Get` or `Experiment Admin`" parameters: @@ -698,6 +960,14 @@ experiments_activity: properties: offset: type: integer + '400': + description: Bad Request + '401': + description: Unauthorized + '403': + description: Forbidden + '404': + description: Not Found post: summary: Experiment-Comment [CREATE] description: "**Required Permissions**: `Experiment Get` or `Experiment Admin`" @@ -732,8 +1002,14 @@ experiments_activity: type: boolean example: true comment: - $ref: "#/components/schemas/Comment" - + $ref: '#/components/schemas/Comment' + '400': + description: Bad Request + '401': + description: Unauthorized + '403': + description: Forbidden + operationId: createexperiment-Comment experiments_activity_reply: post: summary: Experiment-Comment-Reply [CREATE] @@ -774,8 +1050,14 @@ experiments_activity_reply: type: boolean example: true comment: - $ref: "#/components/schemas/Comment" - + $ref: '#/components/schemas/Comment' + '400': + description: Bad Request + '401': + description: Unauthorized + '403': + description: Forbidden + operationId: createexperiment-Comment-Reply experiment_annotations: get: summary: Experiment-Annotation [LIST] @@ -830,7 +1112,7 @@ experiment_annotations: description: Unauthorized "403": description: Forbidden - + operationId: listexperiment-Annotation experiment_annotations_by_id: get: summary: Experiment-Annotation [GET] @@ -850,8 +1132,16 @@ experiment_annotations_by_id: type: object properties: experiment_annotation: - $ref: "#/components/schemas/ExperimentAnnotation" - + $ref: '#/components/schemas/ExperimentAnnotation' + '400': + description: Bad Request + '401': + description: Unauthorized + '403': + description: Forbidden + '404': + description: Not Found + operationId: getexperiment-Annotation experiment_recommended_actions_dismiss: put: summary: Experiment Recommended Action [DISMISS] @@ -901,7 +1191,7 @@ experiment_recommended_actions_dismiss: description: Forbidden "404": description: Not Found - + operationId: updateexperimentRecommendedAction experiment_tags: get: summary: Experiment-Tag [LIST] @@ -956,7 +1246,7 @@ experiment_tags: description: Unauthorized "403": description: Forbidden - + operationId: listexperiment-Tag experiment_tags_by_id: get: summary: Experiment-Tag [GET] @@ -976,8 +1266,16 @@ experiment_tags_by_id: type: object properties: experiment_tag: - $ref: "#/components/schemas/ExperimentTag" - + $ref: '#/components/schemas/ExperimentTag' + '400': + description: Bad Request + '401': + description: Unauthorized + '403': + description: Forbidden + '404': + description: Not Found + operationId: getexperiment-Tag components: schemas: Experiment: @@ -993,6 +1291,11 @@ components: description: "Name of the experiment, used in code. REQUIRED. Max length 256 characters." example: test_experiment maxLength: 256 + display_name: + type: string + description: User-friendly display name for the experiment + example: Test Experiment for Button Colors + maxLength: 256 iteration: type: integer description: "Iteration number for this experiment. Auto-generated, starts at 1 and increments for each iteration." @@ -1002,48 +1305,142 @@ components: description: "Current state of the experiment. REQUIRED. States like 'created', 'development', 'running', etc. Note that 'archived' is a separate boolean field, not a state." example: running enum: ["created", "development", "running", "stopped", "feature_on", "feature_off", "scheduled"] - full_name: + type: type: string - description: "Full, descriptive name of the experiment. REQUIRED. Max length 256 characters." - example: "New Homepage Design Test" - maxLength: 256 + description: Type of experiment + example: test + enum: ["test", "feature", "template"] description: type: string description: "Detailed description of the experiment and what it's testing. Max length 8192 characters." example: "Testing different button colors to improve conversion rate" maxLength: 8192 - start_time: - type: string - format: date-time - description: "When the experiment was started (or scheduled to start if in 'scheduled' state)" - example: "2023-01-01T00:00:00Z" - end_time: - type: string - format: date-time - description: "When the experiment was ended (or scheduled to end if in 'scheduled' state)" - example: "2023-01-31T23:59:59Z" archived: type: boolean description: "Whether the experiment is archived. Archived experiments are hidden from regular views." example: false percentages: type: string - description: "String representation of the traffic split percentages for each variant, separated by slashes. E.g., '50/50' for 50% control and 50% treatment." - example: "50/50" - exposure: + description: String representation of the traffic split percentages for each variant, separated by slashes. E.g., '50/50' for 50% control and 50% treatment. + example: 50/50 + seed: + type: string + description: Seed value for deterministic randomization + example: abc123 + traffic_seed: + type: string + description: Seed value for traffic randomization + example: xyz789 + percentage_of_traffic: type: integer - description: "Traffic exposure percentage (0-100). Controls what percentage of users are included in the experiment." + description: Percentage of traffic to include in the experiment (0-100) example: 100 minimum: 0 maximum: 100 - segment_id: + nr_variants: type: integer - description: "ID of the segment to target with this experiment, if segmentation is used. NULL means no segmentation." + description: Number of variants in the experiment + example: 2 + minimum: 2 + audience: + type: string + description: Audience targeting specification + example: "browser == 'chrome'" + audience_strict: + type: boolean + description: Whether audience targeting should be strict + example: false + minimum_detectable_effect: + type: number + format: float + description: Minimum detectable effect size for statistical significance + example: 0.05 + analysis_type: + type: string + description: Type of statistical analysis to use + example: fixed_horizon + enum: ["fixed_horizon", "group_sequential"] + group_sequential_futility_type: + type: string + nullable: true + description: Futility type for group sequential analysis + example: predicted + group_sequential_analysis_count: + type: integer + nullable: true + description: Number of analyses for group sequential analysis + example: 5 + group_sequential_min_analysis_interval: + type: integer + nullable: true + description: Minimum interval between analyses for group sequential analysis (in days) + example: 7 + group_sequential_first_analysis_interval: + type: integer + nullable: true + description: First analysis interval for group sequential analysis (in days) + example: 14 + group_sequential_max_duration_interval: + type: integer + nullable: true + description: Maximum duration interval for group sequential analysis (in days) + example: 90 + baseline_primary_metric_mean: + type: number + format: float + nullable: true + description: Mean value of the primary metric at baseline + example: 0.5 + baseline_primary_metric_stdev: + type: number + format: float + nullable: true + description: Standard deviation of the primary metric at baseline + example: 0.1 + baseline_participants_per_day: + type: integer + nullable: true + description: Expected participants per day based on baseline + example: 1000 + required_alpha: + type: number + format: float + description: Required significance level (alpha) + example: 0.05 + required_power: + type: number + format: float + description: Required statistical power + example: 0.8 + parent_experiment_id: + type: integer + description: ID of the parent experiment (for iterations/versions of experiments) + example: 42 + nullable: true + parent_experiment_iteration: + type: integer + description: Iteration number of the parent experiment example: 1 - schedule_job_id: + nullable: true + template_description: type: string - description: "ID of the scheduling job for scheduled experiments. NULL for non-scheduled experiments." - example: "job_123456" + description: Description for experiment templates + example: "A/B test template for button color tests" + nullable: true + template_iteration: + type: integer + description: Iteration number for experiment templates + example: 1 + nullable: true + unit_type_id: + type: integer + description: ID of the unit type for this experiment + example: 1 + primary_metric_id: + type: integer + description: ID of the primary metric for this experiment + example: 1 + nullable: true created_at: type: string format: date-time @@ -1069,23 +1466,50 @@ components: tags: type: array items: - $ref: "#/components/schemas/ExperimentTag" + $ref: '#/components/schemas/ExperimentTag' + custom_section_field_values: + type: array + description: Custom section field values associated with this experiment + items: + type: object + properties: + field_id: + type: integer + description: ID of the custom section field + example: 1 + value: + type: string + description: Value for the custom section field (parsed according to the field type) + example: Our rollback plan is to disable the experiment + required: + - field_id + - value required: - id - name - - full_name - state - variants example: id: 123 - name: "new_homepage_design" - state: "running" - percentages: "34/33/33" - full_name: "New Homepage Design Test" - exposure: 100 - created_at: "2023-01-01T00:00:00Z" - updated_at: "2023-01-02T00:00:00Z" - + name: new_homepage_design + display_name: New Homepage Design Test + state: running + type: test + percentages: 34/33/33 + seed: abcdef123 + traffic_seed: xyz789 + percentage_of_traffic: 100 + nr_variants: 3 + audience: "browser == 'chrome'" + audience_strict: false + minimum_detectable_effect: 0.05 + analysis_type: fixed_horizon + required_alpha: 0.05 + required_power: 0.8 + unit_type_id: 1 + primary_metric_id: 42 + created_at: '2023-01-01T00:00:00Z' + updated_at: '2023-01-02T00:00:00Z' ExperimentVariant: type: object properties: @@ -1098,11 +1522,6 @@ components: description: "Name of the variant, used in code. REQUIRED. Max length 64 characters." example: "control" maxLength: 64 - full_name: - type: string - description: "Full, descriptive name of the variant. Max length 256 characters." - example: "Control Group" - maxLength: 256 experiment_id: type: integer description: "ID of the experiment this variant belongs to" diff --git a/openapi_console/paths/export_configs.yaml b/openapi_console/paths/export_configs.yaml index 08b5ff7c..19dd5800 100644 --- a/openapi_console/paths/export_configs.yaml +++ b/openapi_console/paths/export_configs.yaml @@ -72,7 +72,7 @@ export_configs: description: Unauthorized "403": description: Forbidden - + operationId: listexportConfigs post: summary: Export Configs [CREATE] description: "**Required Permissions**: `ExportConfig Create` or `ExportConfig Admin`" @@ -127,7 +127,7 @@ export_configs: description: Unauthorized "403": description: Forbidden - + operationId: createexportConfigs export_configs_by_id: parameters: - name: id @@ -153,10 +153,15 @@ export_configs_by_id: description: Forbidden "404": description: Not Found - + operationId: getexportConfigs put: summary: Export Configs [UPDATE] - description: "**Required Permissions**: `ExportConfig Update` or `ExportConfig Admin`" + description: | + **Required Permissions**: `ExportConfig Update` or `ExportConfig Admin` + + :::caution + Only fields provided in the request will be updated. Fields not included in the request body will retain their existing values. + ::: tags: - Export Configs requestBody: @@ -204,7 +209,7 @@ export_configs_by_id: description: Forbidden "404": description: Not Found - + operationId: updateexportConfigs delete: summary: Export Configs [ARCHIVE] description: "**Required Permissions**: `ExportConfig Archive` or `ExportConfig Admin`" @@ -219,7 +224,7 @@ export_configs_by_id: description: Forbidden "404": description: Not Found - + operationId: deleteexportConfigs export_configs_id_export_histories: parameters: - name: id @@ -284,7 +289,7 @@ export_configs_id_export_histories: description: Forbidden "404": description: Not Found - + operationId: listexportHistories export_configs_id_export_histories_by_history_id: parameters: - name: id @@ -328,8 +333,7 @@ export_configs_id_export_histories_by_history_id: description: Forbidden "404": description: Not Found - -# Components + operationId: updateexportHistories components: schemas: ExportConfig: diff --git a/openapi_console/paths/files.yaml b/openapi_console/paths/files.yaml index 449ac9b5..9a372453 100644 --- a/openapi_console/paths/files.yaml +++ b/openapi_console/paths/files.yaml @@ -48,8 +48,9 @@ files_usage_id_action_filename: description: Unauthorized "404": description: Not Found - + operationId: getfiles head: + operationId: checkFileExists summary: Files [HEAD] description: "**Required Permissions**: Access to the file based on its usage type" tags: diff --git a/openapi_console/paths/goal_tags.yaml b/openapi_console/paths/goal_tags.yaml index a40b736a..c7a7a036 100644 --- a/openapi_console/paths/goal_tags.yaml +++ b/openapi_console/paths/goal_tags.yaml @@ -54,6 +54,7 @@ goal_tags: description: Unauthorized "403": description: Forbidden + operationId: listgoalTags post: summary: Goal Tag [CREATE] description: "**Required Permissions**: `Goal Create` or `Goal Admin`" @@ -90,7 +91,7 @@ goal_tags: description: Unauthorized "403": description: Forbidden - + operationId: creategoalTag goal_tags_by_id: get: summary: Goal Tag [GET] @@ -119,6 +120,7 @@ goal_tags_by_id: description: Forbidden "404": description: Goal Tag not found + operationId: getgoalTag put: summary: Goal Tag [UPDATE] description: "**Required Permissions**: `Goal Edit` or `Goal Admin`" @@ -163,6 +165,7 @@ goal_tags_by_id: description: Forbidden "404": description: Goal Tag not found + operationId: updategoalTag delete: summary: Goal Tag [DELETE] description: "**Required Permissions**: `Goal Archive` or `Goal Admin`" @@ -183,8 +186,7 @@ goal_tags_by_id: description: Forbidden "404": description: Goal Tag not found - -# Components + operationId: deletegoalTag components: schemas: GoalTag: diff --git a/openapi_console/paths/goals.yaml b/openapi_console/paths/goals.yaml index 3b01a34b..ec60418b 100644 --- a/openapi_console/paths/goals.yaml +++ b/openapi_console/paths/goals.yaml @@ -52,6 +52,7 @@ goals: description: Unauthorized "403": description: Forbidden + operationId: listgoal post: summary: Goal [CREATE] description: "**Required Permissions**: `Goal Create` or `Goal Admin`" @@ -103,7 +104,7 @@ goals: description: Unauthorized "403": description: Forbidden - + operationId: creategoal goals_by_id: get: summary: Goal [GET] @@ -130,9 +131,17 @@ goals_by_id: description: Forbidden "404": description: Goal not found + operationId: getgoal put: summary: Goal [UPDATE] - description: "**Required Permissions**: `Goal Edit` or `Goal Admin`" + description: | + **Required Permissions**: `Goal Edit` or `Goal Admin` + + :::caution + Regular fields provided in the request will be updated. Regular fields not included in the request body will retain their existing values. + + However, if relationship fields (`tags`, `owners`, or `teams`) are included in the request, ALL existing related records will be DELETED and replaced with only those provided in the request. + ::: parameters: - name: goalId in: path @@ -185,6 +194,7 @@ goals_by_id: description: Forbidden "404": description: Goal not found + operationId: updategoal delete: summary: Goal [DELETE] description: "**Required Permissions**: `Goal Delete` or `Goal Admin`" @@ -211,7 +221,7 @@ goals_by_id: description: Forbidden "404": description: Goal not found - + operationId: deletegoal goal_tags: get: summary: Goal Tag [LIST] @@ -266,6 +276,7 @@ goal_tags: description: Unauthorized "403": description: Forbidden + operationId: listgoalTag post: summary: Goal Tag [CREATE] description: "**Required Permissions**: `Goal Tag Create` or `Goal Admin`" @@ -309,7 +320,7 @@ goal_tags: description: Unauthorized "403": description: Forbidden - + operationId: creategoalTag goal_tags_by_id: get: summary: Goal Tag [GET] @@ -336,6 +347,7 @@ goal_tags_by_id: description: Forbidden "404": description: Goal Tag not found + operationId: getgoalTag put: summary: Goal Tag [UPDATE] description: "**Required Permissions**: `Goal Tag Edit` or `Goal Admin`" @@ -385,6 +397,7 @@ goal_tags_by_id: description: Forbidden "404": description: Goal Tag not found + operationId: updategoalTag delete: summary: Goal Tag [DELETE] description: "**Required Permissions**: `Goal Tag Delete` or `Goal Admin`" @@ -411,8 +424,7 @@ goal_tags_by_id: description: Forbidden "404": description: Goal Tag not found - -# Components + operationId: deletegoalTag components: schemas: Goal: diff --git a/openapi_console/paths/insights.yaml b/openapi_console/paths/insights.yaml index a6ad1227..d44568bf 100644 --- a/openapi_console/paths/insights.yaml +++ b/openapi_console/paths/insights.yaml @@ -5,9 +5,17 @@ insights: tags: - Insights responses: - "308": + '200': + description: Success response before redirect + '308': description: Permanent Redirect - + '400': + description: Bad Request + '401': + description: Unauthorized + '403': + description: Forbidden + operationId: listinsights insightsvelocitywidgets: get: summary: Velocity Insights Widgets [GET] @@ -66,7 +74,7 @@ insightsvelocitywidgets: description: Unauthorized "403": description: Forbidden - + operationId: getvelocityInsightsWidgets insightsvelocityhistory: get: summary: Velocity Insights History [GET] @@ -125,7 +133,7 @@ insightsvelocityhistory: description: Unauthorized "403": description: Forbidden - + operationId: getvelocityInsightsHistory insightsdecisionswidgets: get: summary: Decisions Insights Widgets [GET] @@ -185,6 +193,7 @@ insightsdecisionswidgets: "403": description: Forbidden + operationId: getdecisionsInsightsWidgets insightsdecisionshistory: get: summary: Decisions Insights History [GET] @@ -245,6 +254,7 @@ insightsdecisionshistory: description: Forbidden # Components + operationId: getdecisionsInsightsHistory components: schemas: VelocityWidgetsResponse: diff --git a/openapi_console/paths/metric_tags.yaml b/openapi_console/paths/metric_tags.yaml index 962212e8..33db9576 100644 --- a/openapi_console/paths/metric_tags.yaml +++ b/openapi_console/paths/metric_tags.yaml @@ -54,6 +54,7 @@ metric_tags: description: Unauthorized "403": description: Forbidden + operationId: listmetricTags post: summary: Metric Tag [CREATE] description: "**Required Permissions**: `Metric Create` or `Metric Admin`" @@ -90,7 +91,7 @@ metric_tags: description: Unauthorized "403": description: Forbidden - + operationId: createmetricTag metric_tags_by_id: get: summary: Metric Tag [GET] @@ -119,6 +120,7 @@ metric_tags_by_id: description: Forbidden "404": description: Metric Tag not found + operationId: getmetricTag put: summary: Metric Tag [UPDATE] description: "**Required Permissions**: `Metric Edit` or `Metric Admin`" @@ -163,6 +165,7 @@ metric_tags_by_id: description: Forbidden "404": description: Metric Tag not found + operationId: updatemetricTag delete: summary: Metric Tag [DELETE] description: "**Required Permissions**: `Metric Archive` or `Metric Admin`" @@ -185,6 +188,7 @@ metric_tags_by_id: description: Metric Tag not found # Components + operationId: deletemetricTag components: schemas: MetricTag: diff --git a/openapi_console/paths/metrics.yaml b/openapi_console/paths/metrics.yaml index 335a9be2..011b52f7 100644 --- a/openapi_console/paths/metrics.yaml +++ b/openapi_console/paths/metrics.yaml @@ -52,6 +52,7 @@ metrics: description: Unauthorized "403": description: Forbidden + operationId: listmetric post: summary: Metric [CREATE] description: "**Required Permissions**: `Metric Create` or `Metric Admin`" @@ -103,7 +104,7 @@ metrics: description: Unauthorized "403": description: Forbidden - + operationId: createmetric metrics_by_id: get: summary: Metric [GET] @@ -130,6 +131,7 @@ metrics_by_id: description: Forbidden "404": description: Metric not found + operationId: getmetric put: summary: Metric [UPDATE] description: "**Required Permissions**: `Metric Edit` or `Metric Admin`" @@ -185,6 +187,7 @@ metrics_by_id: description: Forbidden "404": description: Metric not found + operationId: updatemetric delete: summary: Metric [DELETE] description: "**Required Permissions**: `Metric Delete` or `Metric Admin`" @@ -211,7 +214,7 @@ metrics_by_id: description: Forbidden "404": description: Metric not found - + operationId: deletemetric metric_tags: get: summary: Metric Tag [LIST] @@ -266,6 +269,7 @@ metric_tags: description: Unauthorized "403": description: Forbidden + operationId: listmetricTag post: summary: Metric Tag [CREATE] description: "**Required Permissions**: `Metric Tag Create` or `Metric Admin`" @@ -309,7 +313,7 @@ metric_tags: description: Unauthorized "403": description: Forbidden - + operationId: createmetricTag metric_tags_by_id: get: summary: Metric Tag [GET] @@ -336,6 +340,7 @@ metric_tags_by_id: description: Forbidden "404": description: Metric Tag not found + operationId: getmetricTag put: summary: Metric Tag [UPDATE] description: "**Required Permissions**: `Metric Tag Edit` or `Metric Admin`" @@ -385,6 +390,7 @@ metric_tags_by_id: description: Forbidden "404": description: Metric Tag not found + operationId: updatemetricTag delete: summary: Metric Tag [DELETE] description: "**Required Permissions**: `Metric Tag Delete` or `Metric Admin`" @@ -412,7 +418,7 @@ metric_tags_by_id: "404": description: Metric Tag not found -# Components + operationId: deletemetricTag components: schemas: Metric: diff --git a/openapi_console/paths/permission_categories.yaml b/openapi_console/paths/permission_categories.yaml index 51172916..7f84d120 100644 --- a/openapi_console/paths/permission_categories.yaml +++ b/openapi_console/paths/permission_categories.yaml @@ -21,7 +21,7 @@ permission_categories: "401": description: Unauthorized -# Components + operationId: listpermissionCategories components: schemas: PermissionCategory: diff --git a/openapi_console/paths/permissions.yaml b/openapi_console/paths/permissions.yaml index adf86622..a68b15be 100644 --- a/openapi_console/paths/permissions.yaml +++ b/openapi_console/paths/permissions.yaml @@ -53,6 +53,7 @@ permission_categories: "403": description: Forbidden + operationId: listpermissionCategory permissions: get: summary: Permission [LIST] @@ -107,7 +108,7 @@ permissions: description: Unauthorized "403": description: Forbidden - + operationId: listpermission roles: get: summary: Role [LIST] @@ -162,6 +163,7 @@ roles: description: Unauthorized "403": description: Forbidden + operationId: listrole post: summary: Role [CREATE] description: "**Required Permissions**: `Role Create` or `Role Admin`" @@ -207,7 +209,7 @@ roles: description: Unauthorized "403": description: Forbidden - + operationId: createrole roles_by_id: get: summary: Role [GET] @@ -234,6 +236,7 @@ roles_by_id: description: Forbidden "404": description: Role not found + operationId: getrole put: summary: Role [UPDATE] description: "**Required Permissions**: `Role Edit` or `Role Admin`" @@ -285,6 +288,7 @@ roles_by_id: description: Forbidden "404": description: Role not found + operationId: updaterole delete: summary: Role [DELETE] description: "**Required Permissions**: `Role Delete` or `Role Admin`" @@ -311,7 +315,7 @@ roles_by_id: description: Forbidden "404": description: Role not found - + operationId: deleterole components: schemas: Permission: diff --git a/openapi_console/paths/permissions_and_roles.yaml b/openapi_console/paths/permissions_and_roles.yaml index 8603900c..e09851c8 100644 --- a/openapi_console/paths/permissions_and_roles.yaml +++ b/openapi_console/paths/permissions_and_roles.yaml @@ -54,6 +54,7 @@ permission_categories: "403": description: Forbidden + operationId: listpermissionCategory permissions: get: summary: Permission [LIST] @@ -110,6 +111,7 @@ permissions: description: Forbidden # Role endpoints + operationId: listpermission roles: get: summary: Role [LIST] @@ -164,6 +166,7 @@ roles: description: Unauthorized "403": description: Forbidden + operationId: listrole post: summary: Role [CREATE] description: "**Required Permissions**: `Role Create` or `Role Admin`" @@ -210,6 +213,7 @@ roles: "403": description: Forbidden + operationId: createrole roles_by_id: get: summary: Role [GET] @@ -236,6 +240,7 @@ roles_by_id: description: Forbidden "404": description: Role not found + operationId: getrole put: summary: Role [UPDATE] description: "**Required Permissions**: `Role Edit` or `Role Admin`" @@ -287,6 +292,7 @@ roles_by_id: description: Forbidden "404": description: Role not found + operationId: updaterole delete: summary: Role [DELETE] description: "**Required Permissions**: `Role Delete` or `Role Admin`" @@ -314,7 +320,7 @@ roles_by_id: "404": description: Role not found -# Components + operationId: deleterole components: schemas: PermissionCategory: diff --git a/openapi_console/paths/roles.yaml b/openapi_console/paths/roles.yaml index 61cadb5d..3422384d 100644 --- a/openapi_console/paths/roles.yaml +++ b/openapi_console/paths/roles.yaml @@ -54,6 +54,7 @@ roles: description: Unauthorized "403": description: Forbidden + operationId: listroles post: summary: Role [CREATE] description: "**Required Permissions**: `Role Create` or `Role Admin`" @@ -112,6 +113,7 @@ roles: "403": description: Forbidden + operationId: createrole roles_by_id: get: summary: Role [GET] @@ -140,6 +142,7 @@ roles_by_id: description: Forbidden "404": description: Role not found + operationId: getrole put: summary: Role [UPDATE] description: "**Required Permissions**: `Role Edit` or `Role Admin`" @@ -202,6 +205,7 @@ roles_by_id: description: Forbidden "404": description: Role not found + operationId: updaterole delete: summary: Role [DELETE] description: "**Required Permissions**: `Role Delete` or `Role Admin`" @@ -225,7 +229,7 @@ roles_by_id: "404": description: Role not found -# Components + operationId: deleterole components: schemas: Role: diff --git a/openapi_console/paths/segments.yaml b/openapi_console/paths/segments.yaml index 96b2bb92..5118f12c 100644 --- a/openapi_console/paths/segments.yaml +++ b/openapi_console/paths/segments.yaml @@ -52,6 +52,7 @@ segments: description: Unauthorized "403": description: Forbidden + operationId: listsegment post: summary: Segment [CREATE] description: "**Required Permissions**: `Segment Create` or `Segment Admin`" @@ -103,7 +104,7 @@ segments: description: Unauthorized "403": description: Forbidden - + operationId: createsegment segments_by_id: get: summary: Segment [GET] @@ -130,6 +131,7 @@ segments_by_id: description: Forbidden "404": description: Segment not found + operationId: getsegment put: summary: Segment [UPDATE] description: "**Required Permissions**: `Segment Edit` or `Segment Admin`" @@ -185,6 +187,7 @@ segments_by_id: description: Forbidden "404": description: Segment not found + operationId: updatesegment delete: summary: Segment [DELETE] description: "**Required Permissions**: `Segment Delete` or `Segment Admin`" @@ -212,7 +215,7 @@ segments_by_id: "404": description: Segment not found -# Components + operationId: deletesegment components: schemas: Segment: diff --git a/openapi_console/paths/storage_configs.yaml b/openapi_console/paths/storage_configs.yaml index fda4edfc..b30deb54 100644 --- a/openapi_console/paths/storage_configs.yaml +++ b/openapi_console/paths/storage_configs.yaml @@ -55,6 +55,7 @@ storage_configs: "403": description: Forbidden + operationId: liststorageConfigs storage_configs_by_id: parameters: - name: id @@ -82,6 +83,7 @@ storage_configs_by_id: "404": description: Not Found + operationId: getstorageConfigs storage_configs_test: post: summary: Storage Configs [TEST] @@ -134,7 +136,7 @@ storage_configs_test: "403": description: Forbidden -# Components + operationId: createstorageConfigs components: schemas: StorageConfig: diff --git a/openapi_console/paths/unit_types.yaml b/openapi_console/paths/unit_types.yaml index 253b59c2..a74cca69 100644 --- a/openapi_console/paths/unit_types.yaml +++ b/openapi_console/paths/unit_types.yaml @@ -52,6 +52,7 @@ unit_types: description: Unauthorized "403": description: Forbidden + operationId: listunitType post: summary: Unit Type [CREATE] description: "**Required Permissions**: `UnitType Create` or `UnitType Admin`" @@ -100,6 +101,7 @@ unit_types: "403": description: Forbidden + operationId: createunitType unit_types_by_id: get: summary: Unit Type [GET] @@ -126,6 +128,7 @@ unit_types_by_id: description: Forbidden "404": description: Unit Type not found + operationId: getunitType put: summary: Unit Type [UPDATE] description: "**Required Permissions**: `UnitType Edit` or `UnitType Admin`" @@ -178,6 +181,7 @@ unit_types_by_id: description: Forbidden "404": description: Unit Type not found + operationId: updateunitType delete: summary: Unit Type [DELETE] description: "**Required Permissions**: `UnitType Delete` or `UnitType Admin`" @@ -205,7 +209,7 @@ unit_types_by_id: "404": description: Unit Type not found -# Components + operationId: deleteunitType components: schemas: UnitType: diff --git a/openapi_console/paths/users_and_teams.yaml b/openapi_console/paths/users_and_teams.yaml index 8a6e83f2..be42f49f 100644 --- a/openapi_console/paths/users_and_teams.yaml +++ b/openapi_console/paths/users_and_teams.yaml @@ -53,6 +53,7 @@ users: description: Unauthorized "403": description: Forbidden + operationId: listuser post: summary: User [CREATE] description: "**Required Permissions**: `User Create` or `User Admin`" @@ -107,6 +108,7 @@ users: "403": description: Forbidden + operationId: createuser users_by_id: get: summary: User [GET] @@ -133,6 +135,7 @@ users_by_id: description: Forbidden "404": description: User not found + operationId: getuser put: summary: User [UPDATE] description: "**Required Permissions**: `User Edit` or `User Admin`" @@ -191,6 +194,7 @@ users_by_id: description: Forbidden "404": description: User not found + operationId: updateuser delete: summary: User [DELETE] description: "**Required Permissions**: `User Delete` or `User Admin`" @@ -217,7 +221,7 @@ users_by_id: description: Forbidden "404": description: User not found - + operationId: deleteuser users_api_keys: get: summary: User's API Keys [LIST] @@ -280,7 +284,7 @@ users_api_keys: "404": description: User not found -# Team endpoints + operationId: listusersApiKeys teams: get: summary: Team [LIST] @@ -335,6 +339,7 @@ teams: description: Unauthorized "403": description: Forbidden + operationId: listteam post: summary: Team [CREATE] description: "**Required Permissions**: `Team Create` or `Team Admin`" @@ -384,7 +389,7 @@ teams: description: Unauthorized "403": description: Forbidden - + operationId: createteam teams_by_id: get: summary: Team [GET] @@ -411,6 +416,7 @@ teams_by_id: description: Forbidden "404": description: Team not found + operationId: getteam put: summary: Team [UPDATE] description: "**Required Permissions**: `Team Edit` or `Team Admin`" @@ -467,6 +473,7 @@ teams_by_id: description: Forbidden "404": description: Team not found + operationId: updateteam delete: summary: Team [DELETE] description: "**Required Permissions**: `Team Delete` or `Team Admin`" @@ -494,7 +501,7 @@ teams_by_id: "404": description: Team not found -# Components + operationId: deleteteam components: schemas: User: diff --git a/openapi_console/paths/webhooks.yaml b/openapi_console/paths/webhooks.yaml index e3767bff..d5fc5a72 100644 --- a/openapi_console/paths/webhooks.yaml +++ b/openapi_console/paths/webhooks.yaml @@ -53,6 +53,7 @@ webhook_events: "403": description: Forbidden + operationId: listwebhookEvent webhooks: get: summary: Webhook [LIST] @@ -107,6 +108,7 @@ webhooks: description: Unauthorized "403": description: Forbidden + operationId: listwebhook post: summary: Webhook [CREATE] description: "**Required Permissions**: `Webhook Create` or `Webhook Admin`" @@ -168,7 +170,7 @@ webhooks: description: Unauthorized "403": description: Forbidden - + operationId: createwebhook webhooks_by_id: get: summary: Webhook [GET] @@ -195,9 +197,17 @@ webhooks_by_id: description: Forbidden "404": description: Webhook not found + operationId: getwebhook put: summary: Webhook [UPDATE] - description: "**Required Permissions**: `Webhook Edit` or `Webhook Admin`" + description: | + **Required Permissions**: `Webhook Edit` or `Webhook Admin` + + :::caution + Regular fields provided in the request will be updated. Regular fields not included in the request body will retain their existing values. + + However, if webhook events (`events`) are included in the request, ALL existing webhook events will be DELETED and replaced with only those provided in the request. + ::: parameters: - name: webhookId in: path @@ -259,6 +269,7 @@ webhooks_by_id: description: Forbidden "404": description: Webhook not found + operationId: updatewebhook delete: summary: Webhook [DELETE] description: "**Required Permissions**: `Webhook Delete` or `Webhook Admin`" @@ -285,7 +296,7 @@ webhooks_by_id: description: Forbidden "404": description: Webhook not found - + operationId: deletewebhook components: schemas: Webhook: