openapi: 3.2.0 info: title: Console Experiments (Warehouse Native) Experiments…… description: The "Console API" is the CRUD API for performing the actions offered on console.statsig.com without needing to go through the web UI. version: 20240601.0.0 contact: {} servers: - url: https://statsigapi.net tags: - name: Experiments (Warehouse Native) paths: /console/v1/experiments/qualifying_events: get: summary: List qualifying event parameters: - name: limit required: false in: query description: Results per page schema: example: 10 oneOf: - type: string - type: number type: integer - name: page required: false in: query description: Page number schema: example: 1 oneOf: - type: string - type: number type: integer responses: '200': description: List metric source response content: application/json: schema: allOf: - $ref: '#/components/schemas/PaginationResponseWithMessage' - properties: data: type: array items: $ref: '#/components/schemas/MetricSourceContractDto' example: message: Qualifying events listed successfully. data: - name: Log Events description: all app events including add to cart, purchase, page view, checkout tags: [] sql: 'SELECT * FROM shoppy-sales.logging.events where DATE(ts) between {statsig_start_date} and {statsig_end_date} ' timestampColumn: ts timestampAsDay: false idTypeMapping: - statsigUnitID: userID column: user_id - statsigUnitID: deviceID column: device_id tableName: '' customFieldMapping: - key: '' formula: '' pagination: itemsPerPage: 1 pageNumber: 1 totalItems: 14 nextPage: /console/v1/metrics/qualifying_event/list?page=2&limit=1 previousPage: null all: /console/v1/metrics/qualifying_event/list example: message: Qualifying events listed successfully. data: - name: Log Events description: all app events including add to cart, purchase, page view, checkout tags: [] sql: 'SELECT * FROM shoppy-sales.logging.events where DATE(ts) between {statsig_start_date} and {statsig_end_date} ' timestampColumn: ts timestampAsDay: false idTypeMapping: - statsigUnitID: userID column: user_id - statsigUnitID: deviceID column: device_id tableName: '' customFieldMapping: - key: '' formula: '' pagination: itemsPerPage: 1 pageNumber: 1 totalItems: 14 nextPage: /console/v1/metrics/qualifying_event/list?page=2&limit=1 previousPage: null all: /console/v1/metrics/qualifying_event/list '400': description: Invalid request. Please check the request input and try again. content: application/json: schema: type: object properties: status: type: integer enum: - 400 message: type: string required: - status - message examples: Invalid Request: value: status: 400 message: Invalid request. Please check the request input and try again. '401': description: 'This endpoint only accepts an active CONSOLE key, but an invalid key was sent. Key: console-xxxXXXxxxXXXxxx' content: application/json: schema: type: object properties: status: type: integer enum: - 401 message: type: string required: - status - message examples: Invalid Endpoint: value: status: 401 message: 'This endpoint only accepts an active CONSOLE key, but an invalid key was sent. Key: console-xxxXXXxxxXXXxxx' tags: - Experiments (Warehouse Native) security: - STATSIG-API-KEY: [] operationId: getConsoleV1ExperimentsQualifyingEvents x-operation-id-source: derived post: summary: Create Qualifying Event parameters: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/MetricSourceCreationContractDto' responses: '201': description: Create qualifying event response content: application/json: schema: allOf: - $ref: '#/components/schemas/SingleDataResponse' - properties: data: $ref: '#/components/schemas/MetricSourceContractDto' example: message: Qualifying event created successfully. data: name: test_qualifying_event description: Test description for qualifying event tags: - non_production sql: SELECT * FROM `shoppy-sales.logging.events` timestampColumn: ts timestampAsDay: true idTypeMapping: - statsigUnitID: userID column: user_id sourceType: table tableName: shoppy-sales.logging.events example: message: Qualifying event created successfully. data: name: test_qualifying_event description: Test description for qualifying event tags: - non_production sql: SELECT * FROM `shoppy-sales.logging.events` timestampColumn: ts timestampAsDay: true idTypeMapping: - statsigUnitID: userID column: user_id sourceType: table tableName: shoppy-sales.logging.events '400': description: Invalid request. Please check the request input and try again. content: application/json: schema: type: object properties: status: type: integer enum: - 400 message: type: string required: - status - message examples: Invalid Request: value: status: 400 message: Invalid request. Please check the request input and try again. '401': description: 'This endpoint only accepts an active CONSOLE key, but an invalid key was sent. Key: console-xxxXXXxxxXXXxxx' content: application/json: schema: type: object properties: status: type: integer enum: - 401 message: type: string required: - status - message examples: Invalid Endpoint: value: status: 401 message: 'This endpoint only accepts an active CONSOLE key, but an invalid key was sent. Key: console-xxxXXXxxxXXXxxx' tags: - Experiments (Warehouse Native) security: - STATSIG-API-KEY: [] operationId: postConsoleV1ExperimentsQualifyingEvents x-operation-id-source: derived /console/v1/experiments/qualifying_events/{name}: get: summary: Read Qualifying Event parameters: - name: name required: true in: path description: name schema: type: string responses: '200': description: Read Qualifying Event response content: application/json: schema: allOf: - $ref: '#/components/schemas/SingleDataResponse' - properties: data: $ref: '#/components/schemas/MetricSourceContractDto' example: message: Qualifying event read successfully. data: name: test_qualifying_event description: Test description for qualifying event tags: - non_production sql: SELECT * FROM `shoppy-sales.logging.events` timestampColumn: ts timestampAsDay: true idTypeMapping: - statsigUnitID: userID column: user_id sourceType: table tableName: shoppy-sales.logging.events example: message: Qualifying event read successfully. data: name: test_qualifying_event description: Test description for qualifying event tags: - non_production sql: SELECT * FROM `shoppy-sales.logging.events` timestampColumn: ts timestampAsDay: true idTypeMapping: - statsigUnitID: userID column: user_id sourceType: table tableName: shoppy-sales.logging.events '400': description: Invalid request. Please check the request input and try again. content: application/json: schema: type: object properties: status: type: integer enum: - 400 message: type: string required: - status - message examples: Invalid Request: value: status: 400 message: Invalid request. Please check the request input and try again. '401': description: 'This endpoint only accepts an active CONSOLE key, but an invalid key was sent. Key: console-xxxXXXxxxXXXxxx' content: application/json: schema: type: object properties: status: type: integer enum: - 401 message: type: string required: - status - message examples: Invalid Endpoint: value: status: 401 message: 'This endpoint only accepts an active CONSOLE key, but an invalid key was sent. Key: console-xxxXXXxxxXXXxxx' tags: - Experiments (Warehouse Native) security: - STATSIG-API-KEY: [] operationId: getConsoleV1ExperimentsQualifyingEventsByName x-operation-id-source: derived post: summary: Update Qualifying Event parameters: - name: name required: true in: path description: name schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/MetricSourceUpdateContractDto' responses: '200': description: Update Qualifying Event response content: application/json: schema: allOf: - $ref: '#/components/schemas/SingleDataResponse' - properties: data: $ref: '#/components/schemas/MetricSourceContractDto' example: message: Qualifying event updated successfully. data: name: test_qualifying_event description: Test description for qualifying event tags: - non_production sql: SELECT * FROM `shoppy-sales.logging.events` timestampColumn: ts timestampAsDay: true idTypeMapping: - statsigUnitID: userID column: user_id sourceType: table tableName: shoppy-sales.logging.events example: message: Qualifying event updated successfully. data: name: test_qualifying_event description: Test description for qualifying event tags: - non_production sql: SELECT * FROM `shoppy-sales.logging.events` timestampColumn: ts timestampAsDay: true idTypeMapping: - statsigUnitID: userID column: user_id sourceType: table tableName: shoppy-sales.logging.events '400': description: Invalid request. Please check the request input and try again. content: application/json: schema: type: object properties: status: type: integer enum: - 400 message: type: string required: - status - message examples: Invalid Request: value: status: 400 message: Invalid request. Please check the request input and try again. '401': description: 'This endpoint only accepts an active CONSOLE key, but an invalid key was sent. Key: console-xxxXXXxxxXXXxxx' content: application/json: schema: type: object properties: status: type: integer enum: - 401 message: type: string required: - status - message examples: Invalid Endpoint: value: status: 401 message: 'This endpoint only accepts an active CONSOLE key, but an invalid key was sent. Key: console-xxxXXXxxxXXXxxx' tags: - Experiments (Warehouse Native) security: - STATSIG-API-KEY: [] operationId: postConsoleV1ExperimentsQualifyingEventsByName x-operation-id-source: derived delete: summary: Delete Qualifying Event parameters: - name: name required: true in: path description: name schema: type: string responses: '200': description: Delete Qualifying Event response content: application/json: schema: properties: message: type: string example: message: Qualifying event deleted successfully. example: message: Qualifying event deleted successfully. '400': description: Invalid request. Please check the request input and try again. content: application/json: schema: type: object properties: status: type: integer enum: - 400 message: type: string required: - status - message examples: Invalid Request: value: status: 400 message: Invalid request. Please check the request input and try again. '401': description: 'This endpoint only accepts an active CONSOLE key, but an invalid key was sent. Key: console-xxxXXXxxxXXXxxx' content: application/json: schema: type: object properties: status: type: integer enum: - 401 message: type: string required: - status - message examples: Invalid Endpoint: value: status: 401 message: 'This endpoint only accepts an active CONSOLE key, but an invalid key was sent. Key: console-xxxXXXxxxXXXxxx' tags: - Experiments (Warehouse Native) security: - STATSIG-API-KEY: [] operationId: deleteConsoleV1ExperimentsQualifyingEventsByName x-operation-id-source: derived components: schemas: PaginationResponseWithMessage: type: object properties: message: type: string description: A simple string explaining the result of the operation. data: description: Array of results returned by pagination limit. type: array items: type: object pagination: description: Pagination metadata for checking if there is next page for example. allOf: - $ref: '#/components/schemas/PaginationResponseMetadataDto' required: - message - data - pagination SingleDataResponse: type: object properties: message: type: string description: A simple string explaining the result of the operation. data: type: object description: A single result. required: - message - data MetricSourceContractDto: type: object properties: name: type: string description: The name of the source, serving as its primary identifier. description: type: string description: A detailed description of the source, providing context and usage information. tags: type: array items: type: string description: Optional tags for categorizing the source and improving searchability. sql: type: string description: The SQL query or statement used to extract data from the source. timestampColumn: type: string description: The name of the column containing timestamp data for the source. timestampAsDay: type: boolean description: Indicates whether the timestamp should be treated as a day-level granularity. idTypeMapping: type: array items: type: object properties: statsigUnitID: type: string description: The identifier mapping for Statsig units. column: type: string description: The corresponding column name in the source that relates to the Statsig unit ID. required: - statsigUnitID - column description: Array defining the mapping between Statsig unit IDs and their respective source columns. sourceType: type: string enum: - table - query description: The type of source, indicating whether it is a database table or a custom query. tableName: type: string description: The name of the database table if the source type is "table". datePartitionColumn: type: string description: The name of the date partition column if the source type is "table". Can be undefined. customFieldMapping: type: array items: type: object properties: key: type: string description: The identifier for the custom field mapping. formula: type: string description: The formula or expression used to compute the custom field value. required: - key - formula description: Optional array defining mappings for custom fields using specific formulas. isReadOnly: type: boolean description: Specifies if the source can only be edited via the Console API. isVerified: type: boolean description: Marks the metric source as verified, indicating trustworthiness within the organization. example: false disableCURE: type: boolean description: Disable CURE for all metrics built from this metric source owner: type: - object - 'null' properties: ownerID: type: string description: ID of the owner example: abc123 ownerType: type: string description: Type of the owner (e.g., SDK_KEY or USER) example: USER ownerName: type: string description: The name of the owner. This field is optional. example: John Doe ownerEmail: type: string description: The email of the owner. This field is optional. description: Schema for owner data including ID, type, name. example: ownerID: user123 ownerType: USER ownerName: John Doe ownerEmail: owner123@test.com team: type: - string - 'null' description: Optional field indicating the team name responsible for the metric source, aiding in accountability and management. teamID: type: - string - 'null' description: Optional field indicating the team ID responsible for the metric source, aiding in accountability and management. required: - name - description - sql - timestampColumn - idTypeMapping MetricSourceCreationContractDto: type: object properties: name: type: string description: The name of the source, serving as its primary identifier. description: type: string description: An optional description for the source, providing context and details about its purpose and usage. tags: type: array items: type: string description: Optional array of tags to categorize the source, facilitating easier organization and retrieval. sql: type: string description: The SQL query or statement used to extract data from the source. timestampColumn: type: string description: The name of the column containing timestamp data for the source. timestampAsDay: type: boolean description: Indicates whether the timestamp should be treated as a day-level granularity. idTypeMapping: type: array items: type: object properties: statsigUnitID: type: string description: The identifier mapping for Statsig units. column: type: string description: The corresponding column name in the source that relates to the Statsig unit ID. required: - statsigUnitID - column description: Array defining the mapping between Statsig unit IDs and their respective source columns. sourceType: type: string enum: - table - query description: The type of source, indicating whether it is a database table or a custom query. tableName: type: string description: The name of the database table if the source type is "table". datePartitionColumn: type: string description: The name of the date partition column if the source type is "table". Can be undefined. customFieldMapping: type: array items: type: object properties: key: type: string description: The identifier for the custom field mapping. formula: type: string description: The formula or expression used to compute the custom field value. required: - key - formula description: Optional array defining mappings for custom fields using specific formulas. isReadOnly: type: boolean description: Specifies if the source can only be edited via the Console API. isVerified: type: boolean description: Marks the metric source as verified, indicating trustworthiness within the organization. example: false disableCURE: type: boolean description: Disable CURE for all metrics built from this metric source owner: type: - object - 'null' properties: ownerID: type: string description: ID of the owner example: abc123 ownerType: type: string description: Type of the owner (e.g., SDK_KEY or USER) example: USER ownerName: type: string description: The name of the owner. This field is optional. example: John Doe ownerEmail: type: string description: The email of the owner. This field is optional. description: Schema for owner data including ID, type, name. example: ownerID: user123 ownerType: USER ownerName: John Doe ownerEmail: owner123@test.com team: type: - string - 'null' description: Optional field indicating the team name responsible for the metric source, aiding in accountability and management. teamID: type: - string - 'null' description: Optional field indicating the team ID responsible for the metric source, aiding in accountability and management. dryRun: type: boolean description: Skips persisting the source (used to validate that inputs are correct) skip_validation: type: boolean description: Skips running SQL validation for the source. Requires all_columns and column_types when true. Availability is gated. all_columns: type: array items: type: string description: Column names to persist when skip_validation is true. Optional otherwise. column_types: type: array items: type: string description: Column types aligned with all_columns when skip_validation is true. Optional otherwise. required: - name - sql - timestampColumn - idTypeMapping PaginationResponseMetadataDto: type: object properties: itemsPerPage: type: number format: double pageNumber: type: number format: double nextPage: type: - string - 'null' previousPage: type: - string - 'null' totalItems: type: number format: double all: type: string required: - itemsPerPage - pageNumber - nextPage - previousPage MetricSourceUpdateContractDto: type: object properties: name: readOnly: true type: string description: The name of the source cannot be changed in this update, ensuring the identity remains consistent. description: type: string description: An optional updated description for the source, providing additional context or changes. tags: type: array items: type: string description: Optional array of tags for categorizing the source, allowing for updates to its categorization. sql: type: string description: The SQL query or statement used to extract data from the source. timestampColumn: type: string description: The name of the column containing timestamp data for the source. timestampAsDay: type: boolean description: Indicates whether the timestamp should be treated as a day-level granularity. idTypeMapping: type: array items: type: object properties: statsigUnitID: type: string description: The identifier mapping for Statsig units. column: type: string description: The corresponding column name in the source that relates to the Statsig unit ID. required: - statsigUnitID - column description: Array defining the mapping between Statsig unit IDs and their respective source columns. sourceType: type: string enum: - table - query description: The type of source, indicating whether it is a database table or a custom query. tableName: type: string description: The name of the database table if the source type is "table". datePartitionColumn: type: string description: The name of the date partition column if the source type is "table". Can be undefined. customFieldMapping: type: array items: type: object properties: key: type: string description: The identifier for the custom field mapping. formula: type: string description: The formula or expression used to compute the custom field value. required: - key - formula description: Optional array defining mappings for custom fields using specific formulas. isReadOnly: type: boolean description: Specifies if the source can only be edited via the Console API. isVerified: type: boolean description: Marks the metric source as verified, indicating trustworthiness within the organization. example: false disableCURE: type: boolean description: Disable CURE for all metrics built from this metric source owner: type: - object - 'null' properties: ownerID: type: string description: ID of the owner example: abc123 ownerType: type: string description: Type of the owner (e.g., SDK_KEY or USER) example: USER ownerName: type: string description: The name of the owner. This field is optional. example: John Doe ownerEmail: type: string description: The email of the owner. This field is optional. description: Schema for owner data including ID, type, name. example: ownerID: user123 ownerType: USER ownerName: John Doe ownerEmail: owner123@test.com team: type: - string - 'null' description: Optional field indicating the team name responsible for the metric source, aiding in accountability and management. teamID: type: - string - 'null' description: Optional field indicating the team ID responsible for the metric source, aiding in accountability and management. dryRun: type: boolean description: Skips persisting updates to the source (used to validate that inputs are correct) skip_validation: type: boolean description: Skips running SQL validation for the source. Requires all_columns and column_types when true. Availability is gated. all_columns: type: array items: type: string description: Column names to persist when skip_validation is true. Optional otherwise. column_types: type: array items: type: string description: Column types aligned with all_columns when skip_validation is true. Optional otherwise. required: - sql - timestampColumn - idTypeMapping securitySchemes: STATSIG-API-KEY: type: apiKey name: STATSIG-API-KEY in: header