# Allocate Segment Source: https://confidence-auth-testing.mintlify.io/api-reference/allocate-segment /api/flags/api/segment.openapi.json post /v1/segments/{segment}:allocate Allocate the segment so that it can be used. Note, if the segment is coordinated, it can only be allocated if there is remaining space. # Applys Flag Source: https://confidence-auth-testing.mintlify.io/api-reference/applys-flag /api/flags/api/resolve.openapi.json post /v1/flags:apply Indicates that resolved values of a set of flags have been used. In many situations there is a delay between the moment a flag is resolved and when it is actually used in a client. This is often the case in mobile clients where you typically batch resolve all flags at startup, but then apply them later when the user interacts with a specific view. If the `apply` flag is set to false in a resolve, the flag assignment event is delayed until the flag is applied. # Archive Flag Source: https://confidence-auth-testing.mintlify.io/api-reference/archive-flag /api/flags/api/flag.openapi.json post /v1/flags/{flag}:archive Archive a flag. It will no longer be possible to resolve this flag, and it will no be included in batch resolves. # Archive Segment Source: https://confidence-auth-testing.mintlify.io/api-reference/archive-segment /api/flags/api/segment.openapi.json post /v1/segments/{segment}:archive Archive the segment. To archive the segment it must be `ALLOCATED` and there must be no rules currently referencing the segment. # Availablespace Segment Source: https://confidence-auth-testing.mintlify.io/api-reference/availablespace-segment /api/flags/api/segment.openapi.json post /v1/segments/{segment}:segmentAvailableSpace Check if there is space available for a specific segment to be allocated. Used when a segment is coordinated before trying to allocate it. # Cancel MetricCalculation Source: https://confidence-auth-testing.mintlify.io/api-reference/cancel-metriccalculation /api/metrics/api/metric-calculation.openapi.json post /v1/scheduledMetricCalculations/{scheduledMetricCalculation}/metricCalculations/{metricCalculation}:cancel Cancels the metric calculation. Only applicable for a currently running metric calculation. # Cancel ScheduledExposureCalculation Source: https://confidence-auth-testing.mintlify.io/api-reference/cancel-scheduledexposurecalculation /api/metrics/api/exposure-calculation.openapi.json post /v1/scheduledExposureCalculations/{scheduledExposureCalculation}:cancel Cancel the scheduled exposure calculation. The calculation will still exist but no new computations will be scheduled. # Cancel ScheduledMetricCalculation Source: https://confidence-auth-testing.mintlify.io/api-reference/cancel-scheduledmetriccalculation /api/metrics/api/metric-calculation.openapi.json post /v1/scheduledMetricCalculations/{scheduledMetricCalculation}:cancel Cancel but do not delete a scheduled metric calculation. The schedule still exists, but no metric computations are performed. # Clone Clone Source: https://confidence-auth-testing.mintlify.io/api-reference/clone-clone /api/experiments/abtest.openapi.json post /v1/workflows/abtest/instances/{instance}:clone Clones an existing abtest. # Computespacecalendar Segment Source: https://confidence-auth-testing.mintlify.io/api-reference/computespacecalendar-segment /api/flags/api/segment.openapi.json post /v1/segments:computeSegmentSpaceCalendar Compute a calendar view of space availability over time for a set of segments with prospective start and end dates. This allows planning segment allocation by showing how much space will be available on each date in the requested range. # Create Abtest Source: https://confidence-auth-testing.mintlify.io/api-reference/create-abtest /api/experiments/abtest.openapi.json post /v1/workflows/abtest Creates a new Abtest. # Create AnalysisResult Source: https://confidence-auth-testing.mintlify.io/api-reference/create-analysisresult /api/stats/api/analysis-result.openapi.json post /v2/workflows/{workflow}/instances/{instance}/analysisResults # Create ApiClient Source: https://confidence-auth-testing.mintlify.io/api-reference/create-apiclient /api/iam/api/api-client.openapi.json post /v1/apiClients Create a new API client. An API client is used to programmatically interact with the Confidence APIs. # Create AssignmentTable Source: https://confidence-auth-testing.mintlify.io/api-reference/create-assignmenttable /api/metrics/api/assignment-table.openapi.json post /v1/assignmentTables Create an assignment table. An assignment table is a description of a dataset of how flags have been assigned to variants. Specifically, it should contain the id of the entity that was resolved, when it was resolved, and which variant was assigned. # Create Client Source: https://confidence-auth-testing.mintlify.io/api-reference/create-client /api/iam/api/client.openapi.json post /v1/clients Create a new client. A `Client` is used to resolve flags from all applications of a particular type, like an iOS client. To resolve a flag you need to pass credentials from a specific `Client` and have the flag enabled for that client. # Create ClientCredential Source: https://confidence-auth-testing.mintlify.io/api-reference/create-clientcredential /api/iam/api/client.openapi.json post /v1/clients/{client}/credentials Create a new client credential. A credential is a type of secret used to authenticate a client when resolving flags. # Create DataWarehouse Source: https://confidence-auth-testing.mintlify.io/api-reference/create-datawarehouse /api/metrics/api/data-warehouse.openapi.json post /v1/dataWarehouses Create a new data warehouse. This endpoint is used to configure access to your data warehouse, were all assignment, exposure and metric data will be stored and computed. The endpoint will verify that access to relevant resources are set up correctly. # Create DimensionTable Source: https://confidence-auth-testing.mintlify.io/api-reference/create-dimensiontable /api/metrics/api/dimension-table.openapi.json post /v1/dimensionTables Create a dimension table. A dimension table is a description of a dataset that contains dimensions about an entity that are not included in the fact table. For example, it could be general dimensions like the country of a user, that can be used across many metrics. The dimension table maps out the entity column and the dimension columns in the table. # Create Entity Source: https://confidence-auth-testing.mintlify.io/api-reference/create-entity /api/metrics/api/entity.openapi.json post /v1/entities Create a new entity. An entity is a class of instances that can be uniquely identified and measured. A typical example is a user, but can also be something more abstract like a bank transaction. # Create ExposureCalculation Source: https://confidence-auth-testing.mintlify.io/api-reference/create-exposurecalculation /api/metrics/api/exposure-calculation.openapi.json post /v1/exposureCalculations Calculates exposure from an assignment table. # Create ExposureTable Source: https://confidence-auth-testing.mintlify.io/api-reference/create-exposuretable /api/metrics/api/exposure-table.openapi.json post /v1/exposureTables Create an exposure table. An exposure table is a general description of how to compute exposures for a specific entity. Unlike the assignment table, the exposure table is more specific, and typically one is created for each experiment. # Create FactTable Source: https://confidence-auth-testing.mintlify.io/api-reference/create-facttable /api/metrics/api/fact-table.openapi.json post /v1/factTables Create a new fact table. A fact table is a description of a dataset, specifically, it describes which columns correspond to entities, dimensions and measurements. It is the basis for describing metrics. # Create Flag Source: https://confidence-auth-testing.mintlify.io/api-reference/create-flag /api/flags/api/flag.openapi.json post /v1/flags Creates a new flag. Flags are used to control part of an application by defining a set of rules that deterministically or randomly assign variants to users. Only the `flag_id` is required when creating the flag, the remaining attributes can be set by calling `UpdateFlag`. When creating a flag it will start in the `ACTIVE` state, when you no longer need a flag you can call `ArchiveFlag`. # Create Group Source: https://confidence-auth-testing.mintlify.io/api-reference/create-group /api/iam/api/group.openapi.json post /v1/groups Creates a new group # Create MaterializedSegment Source: https://confidence-auth-testing.mintlify.io/api-reference/create-materializedsegment /api/flags/api/materialized-segments.openapi.json post /v1/materializedSegments Create a new materialized segment. The materialization can then be attached to rules. # Create Metric Source: https://confidence-auth-testing.mintlify.io/api-reference/create-metric /api/metrics/api/metric.openapi.json post /v1/metrics Create a metric. A metric is a general description of how to aggregate a measurement from a fact table to an entity. For example, averaging the number of seconds a user has been on a page, from a fact table of page views. # Create MetricCalculation Source: https://confidence-auth-testing.mintlify.io/api-reference/create-metriccalculation /api/metrics/api/metric-calculation.openapi.json post /v1/metricCalculations Create a new metric calculation. The metric calculation represents the calculation of a metric for a specific time window, for example, the date 2020-01-01, or the hour 2020-01-01T01. It is a long running operation and the current status can be seen in the `state` field of the `MetricCalculation`. # Create Role Source: https://confidence-auth-testing.mintlify.io/api-reference/create-role /api/iam/api/role.openapi.json post /v1/roles Creates a new role # Create Rollout Source: https://confidence-auth-testing.mintlify.io/api-reference/create-rollout /api/experiments/rollout.openapi.json post /v1/workflows/rollout Creates a new Rollout. # Create Rule Source: https://confidence-auth-testing.mintlify.io/api-reference/create-rule /api/flags/api/flag.openapi.json post /v1/flags/{flag}/rules Create a new rule. A rule decides at which proportions user from a specific segment should be assigned variants from the flag. # Create ScheduledExposureCalculation Source: https://confidence-auth-testing.mintlify.io/api-reference/create-scheduledexposurecalculation /api/metrics/api/exposure-calculation.openapi.json post /v1/scheduledExposureCalculations Create a scheduled exposure calculation. The schedule defines the start time and frequency that the exposure table should be calculated. The exposure table is calculated by finding the first assignment of each entity in the referenced assignment table. # Create ScheduledMetricCalculation Source: https://confidence-auth-testing.mintlify.io/api-reference/create-scheduledmetriccalculation /api/metrics/api/metric-calculation.openapi.json post /v1/scheduledMetricCalculations Create a scheduled metric calculation. The schedule defines the start time and frequency that a metric should be calculated for a specific exposure table. # Create Segment Source: https://confidence-auth-testing.mintlify.io/api-reference/create-segment /api/flags/api/segment.openapi.json post /v1/segments Create a new segment. A segment defines a part of the population of an entity, for example, the population of users. It contains an overall proportion of the population as well as optional targeting criteria, like the country a user is from. A segment can also be coordinated with other segments, by setting `exclusivity_tags` and `exclusive_to`, preventing one user to be included in two segments, that are exclusive to each other, simultaneously. Note, the segment is not active until it is allocated. # Create Surface Source: https://confidence-auth-testing.mintlify.io/api-reference/create-surface /api/workflows/api/surface.openapi.json post /v1/surfaces # Create UserInvitation Source: https://confidence-auth-testing.mintlify.io/api-reference/create-userinvitation /api/iam/api/user.openapi.json post /v1/userInvitations Creates a new invitation for a user and sends an email with a login link. # Create Variant Source: https://confidence-auth-testing.mintlify.io/api-reference/create-variant /api/flags/api/flag.openapi.json post /v1/flags/{flag}/variants Creates a new variant and add it to the given flag. A variant is a named value that typically represents a group of settings that can be used to control part of an application. Before you can create a variant the flag must have a schema, and the variant must satisfy the schema. # Delete AnalysisResult Source: https://confidence-auth-testing.mintlify.io/api-reference/delete-analysisresult /api/stats/api/analysis-result.openapi.json delete /v2/workflows/{workflow}/instances/{instance}/analysisResults/{analysisResult} # Delete ApiClient Source: https://confidence-auth-testing.mintlify.io/api-reference/delete-apiclient /api/iam/api/api-client.openapi.json delete /v1/apiClients/{apiClient} Delete an API client. # Delete AssignmentTable Source: https://confidence-auth-testing.mintlify.io/api-reference/delete-assignmenttable /api/metrics/api/assignment-table.openapi.json delete /v1/assignmentTables/{assignmentTable} Delete an assignment table. The assignment table can only be deleted if there are no active scheduled exposure calculations referencing the table. # Delete Client Source: https://confidence-auth-testing.mintlify.io/api-reference/delete-client /api/iam/api/client.openapi.json delete /v1/clients/{client} Delete an existing client. # Delete ClientCredential Source: https://confidence-auth-testing.mintlify.io/api-reference/delete-clientcredential /api/iam/api/client.openapi.json delete /v1/clients/{client}/credentials/{credential} Delete a client credential. # Delete DimensionTable Source: https://confidence-auth-testing.mintlify.io/api-reference/delete-dimensiontable /api/metrics/api/dimension-table.openapi.json delete /v1/dimensionTables/{dimensionTable} Delete a dimension table. A dimension table can only be deleted if no metrics are using it. # Delete Entity Source: https://confidence-auth-testing.mintlify.io/api-reference/delete-entity /api/metrics/api/entity.openapi.json delete /v1/entities/{entity} Delete an entity. The entity cannot be used by a fact table or metric. # Delete ExposureTable Source: https://confidence-auth-testing.mintlify.io/api-reference/delete-exposuretable /api/metrics/api/exposure-table.openapi.json delete /v1/exposureTables/{exposureTable} Deletes an entity relation table. # Delete FactTable Source: https://confidence-auth-testing.mintlify.io/api-reference/delete-facttable /api/metrics/api/fact-table.openapi.json delete /v1/factTables/{factTable} Delete a fact table. The fact table can only be deleted if there are no metrics referencing it. # Delete Group Source: https://confidence-auth-testing.mintlify.io/api-reference/delete-group /api/iam/api/group.openapi.json delete /v1/groups/{group} Deletes a group. # Delete MaterializedSegment Source: https://confidence-auth-testing.mintlify.io/api-reference/delete-materializedsegment /api/flags/api/materialized-segments.openapi.json delete /v1/materializedSegments/{materializedSegment} Delete a materialized segment. # Delete Metric Source: https://confidence-auth-testing.mintlify.io/api-reference/delete-metric /api/metrics/api/metric.openapi.json delete /v1/metrics/{metric} Delete a metric. A metric can only be deleted if there are no scheduled metric calculations referencing it. # Delete Role Source: https://confidence-auth-testing.mintlify.io/api-reference/delete-role /api/iam/api/role.openapi.json delete /v1/roles/{role} Deletes a role # Delete Rule Source: https://confidence-auth-testing.mintlify.io/api-reference/delete-rule /api/flags/api/flag.openapi.json delete /v1/flags/{flag}/rules/{rule} Delete a rule. Note, entities that previously matched this rule, will now be passed on to the next rule. # Delete ScheduledMetricCalculation Source: https://confidence-auth-testing.mintlify.io/api-reference/delete-scheduledmetriccalculation /api/metrics/api/metric-calculation.openapi.json delete /v1/scheduledMetricCalculations/{scheduledMetricCalculation} Delete a scheduled metric calculation. A scheduled metric calculation can always be deleted. # Delete Surface Source: https://confidence-auth-testing.mintlify.io/api-reference/delete-surface /api/workflows/api/surface.openapi.json delete /v1/surfaces/{surface} # Delete User Source: https://confidence-auth-testing.mintlify.io/api-reference/delete-user /api/iam/api/user.openapi.json delete /v1/users/{user} Delete user by name. # Delete UserInvitation Source: https://confidence-auth-testing.mintlify.io/api-reference/delete-userinvitation /api/iam/api/user.openapi.json delete /v1/userInvitations/{userInvitation} Revokes an existing invitation. # Delete Variant Source: https://confidence-auth-testing.mintlify.io/api-reference/delete-variant /api/flags/api/flag.openapi.json delete /v1/flags/{flag}/variants/{variant} Deletes a variant. Variants that are used by one or more rules cannot be deleted. # Deriveevaluationcontextschema Client Source: https://confidence-auth-testing.mintlify.io/api-reference/deriveevaluationcontextschema-client /api/flags/api/flag.openapi.json post /v1/clientEvaluationContextSchema:derive Infer the schema of the evaluation context for a specific set of clients, that has previously been used to resolve one or more flags. # Describe AssignmentTable Source: https://confidence-auth-testing.mintlify.io/api-reference/describe-assignmenttable /api/metrics/api/assignment-table.openapi.json post /v1/assignmentTable:describe Describe the assignments table # Execute AddExploratoryAnalysis Source: https://confidence-auth-testing.mintlify.io/api-reference/execute-addexploratoryanalysis /api/experiments/rollout.openapi.json post /v1/workflows/rollout/instances/{instance}:addexploratoryanalysis Executes the addExploratoryAnalysis function. # Execute ArchiveAction Source: https://confidence-auth-testing.mintlify.io/api-reference/execute-archiveaction /api/experiments/rollout.openapi.json post /v1/workflows/rollout/instances/{instance}:archive Executes the archive action # Execute ConvertToRolloutAction Source: https://confidence-auth-testing.mintlify.io/api-reference/execute-converttorolloutaction /api/experiments/abtest.openapi.json post /v1/workflows/abtest/instances/{instance}:converttorollout Executes the convertToRollout action # Execute DeleteExploratoryAnalysis Source: https://confidence-auth-testing.mintlify.io/api-reference/execute-deleteexploratoryanalysis /api/experiments/rollout.openapi.json post /v1/workflows/rollout/instances/{instance}:deleteexploratoryanalysis Executes the deleteExploratoryAnalysis function. # Execute DeleteReviewResponse Source: https://confidence-auth-testing.mintlify.io/api-reference/execute-deletereviewresponse /api/experiments/rollout.openapi.json post /v1/workflows/rollout/instances/{instance}:deletereviewresponse Executes the deleteReviewResponse function. # Execute EditExploratoryAnalysis Source: https://confidence-auth-testing.mintlify.io/api-reference/execute-editexploratoryanalysis /api/experiments/rollout.openapi.json post /v1/workflows/rollout/instances/{instance}:editexploratoryanalysis Executes the editExploratoryAnalysis function. # Execute EndAction Source: https://confidence-auth-testing.mintlify.io/api-reference/execute-endaction /api/experiments/rollout.openapi.json post /v1/workflows/rollout/instances/{instance}:end Executes the end action # Execute ExecuteScheduledIncrease Source: https://confidence-auth-testing.mintlify.io/api-reference/execute-executescheduledincrease /api/experiments/rollout.openapi.json post /v1/workflows/rollout/instances/{instance}:executescheduledincrease Executes the executeScheduledIncrease function. # Execute GetExploratoryAnalysis Source: https://confidence-auth-testing.mintlify.io/api-reference/execute-getexploratoryanalysis /api/experiments/rollout.openapi.json post /v1/workflows/rollout/instances/{instance}:getexploratoryanalysis Executes the getExploratoryAnalysis function. # Execute GetMandatoryMetric Source: https://confidence-auth-testing.mintlify.io/api-reference/execute-getmandatorymetric /api/experiments/rollout.openapi.json post /v1/workflows/rollout/instances/{instance}:getmandatorymetrics Executes the getMandatoryMetrics function. # Execute GetRolloutInfo Source: https://confidence-auth-testing.mintlify.io/api-reference/execute-getrolloutinfo /api/experiments/rollout.openapi.json post /v1/workflows/rollout/instances/{instance}:getrolloutinfo Executes the getRolloutInfo function. # Execute LaunchAction Source: https://confidence-auth-testing.mintlify.io/api-reference/execute-launchaction /api/experiments/rollout.openapi.json post /v1/workflows/rollout/instances/{instance}:launch Executes the launch action # Execute PauseIntake Source: https://confidence-auth-testing.mintlify.io/api-reference/execute-pauseintake /api/experiments/rollout.openapi.json post /v1/workflows/rollout/instances/{instance}:pauseintake Executes the pauseIntake function. # Execute RefreshExploratoryAnalysisCalculation Source: https://confidence-auth-testing.mintlify.io/api-reference/execute-refreshexploratoryanalysiscalculation /api/experiments/rollout.openapi.json post /v1/workflows/rollout/instances/{instance}:refreshexploratoryanalysiscalculations Executes the refreshExploratoryAnalysisCalculations function. # Execute RequestReview Source: https://confidence-auth-testing.mintlify.io/api-reference/execute-requestreview /api/experiments/rollout.openapi.json post /v1/workflows/rollout/instances/{instance}:requestreviews Executes the requestReviews function. # Execute ResumeIntake Source: https://confidence-auth-testing.mintlify.io/api-reference/execute-resumeintake /api/experiments/rollout.openapi.json post /v1/workflows/rollout/instances/{instance}:resumeintake Executes the resumeIntake function. # Execute RetriggerExposure Source: https://confidence-auth-testing.mintlify.io/api-reference/execute-retriggerexposure /api/experiments/rollout.openapi.json post /v1/workflows/rollout/instances/{instance}:retriggerexposure Retrigger the exposure calculation for this experiment. This will also retrigger all dependent metric calculations if 'retriggerDependentMetrics' is set to true. # Execute RetriggerMetric Source: https://confidence-auth-testing.mintlify.io/api-reference/execute-retriggermetric /api/experiments/rollout.openapi.json post /v1/workflows/rollout/instances/{instance}:retriggermetric Retrigger a specific metric calculation for this experiment. # Execute SubmitReviewResponse Source: https://confidence-auth-testing.mintlify.io/api-reference/execute-submitreviewresponse /api/experiments/rollout.openapi.json post /v1/workflows/rollout/instances/{instance}:submitreviewresponse Executes the submitReviewResponse function. # Execute UpdateReview Source: https://confidence-auth-testing.mintlify.io/api-reference/execute-updatereview /api/experiments/rollout.openapi.json post /v1/workflows/rollout/instances/{instance}:updatereviews Executes the updateReviews function. # Execute UpdateSegment Source: https://confidence-auth-testing.mintlify.io/api-reference/execute-updatesegment /api/experiments/rollout.openapi.json post /v1/workflows/rollout/instances/{instance}:updatesegment Executes the updateSegment function. # Exists DataWarehouse Source: https://confidence-auth-testing.mintlify.io/api-reference/exists-datawarehouse /api/metrics/api/data-warehouse.openapi.json get /v1/dataWarehouses:exists Checks if a data warehouse is currently configured # Get Abtest Source: https://confidence-auth-testing.mintlify.io/api-reference/get-abtest /api/experiments/abtest.openapi.json get /v1/workflows/abtest/instances/{instance} Retrieves a abtest by name. # Get AnalysisResult Source: https://confidence-auth-testing.mintlify.io/api-reference/get-analysisresult /api/stats/api/analysis-result.openapi.json get /v2/workflows/{workflow}/instances/{instance}/analysisResults/{analysisResult} # Get ApiClient Source: https://confidence-auth-testing.mintlify.io/api-reference/get-apiclient /api/iam/api/api-client.openapi.json get /v1/apiClients/{apiClient} Fetch an API client. # Get AssignmentTable Source: https://confidence-auth-testing.mintlify.io/api-reference/get-assignmenttable /api/metrics/api/assignment-table.openapi.json get /v1/assignmentTables/{assignmentTable} Get an assignment table. # Get Client Source: https://confidence-auth-testing.mintlify.io/api-reference/get-client /api/iam/api/client.openapi.json get /v1/clients/{client} Get an existing client. # Get ClientCredential Source: https://confidence-auth-testing.mintlify.io/api-reference/get-clientcredential /api/iam/api/client.openapi.json get /v1/clients/{client}/credentials/{credential} Get an existing client credential. # Get DataWarehouse Source: https://confidence-auth-testing.mintlify.io/api-reference/get-datawarehouse /api/metrics/api/data-warehouse.openapi.json get /v1/dataWarehouses/{dataWarehouse} Get the data warehouse. # Get DimensionTable Source: https://confidence-auth-testing.mintlify.io/api-reference/get-dimensiontable /api/metrics/api/dimension-table.openapi.json get /v1/dimensionTables/{dimensionTable} Get a dimension table. # Get Entity Source: https://confidence-auth-testing.mintlify.io/api-reference/get-entity /api/metrics/api/entity.openapi.json get /v1/entities/{entity} Get the given entity. # Get ExposureCalculation Source: https://confidence-auth-testing.mintlify.io/api-reference/get-exposurecalculation /api/metrics/api/exposure-calculation.openapi.json get /v1/scheduledExposureCalculations/{scheduledExposureCalculation}/exposureCalculations/{exposureCalculation} Get an existing exposure calculation. # Get ExposureTable Source: https://confidence-auth-testing.mintlify.io/api-reference/get-exposuretable /api/metrics/api/exposure-table.openapi.json get /v1/exposureTables/{exposureTable} Get the exposure table. # Get FactTable Source: https://confidence-auth-testing.mintlify.io/api-reference/get-facttable /api/metrics/api/fact-table.openapi.json get /v1/factTables/{factTable} Get a fact table. # Get Flag Source: https://confidence-auth-testing.mintlify.io/api-reference/get-flag /api/flags/api/flag.openapi.json get /v1/flags/{flag} Get a flag. # Get Group Source: https://confidence-auth-testing.mintlify.io/api-reference/get-group /api/iam/api/group.openapi.json get /v1/groups/{group} Gets a group by name. # Get MaterializedSegment Source: https://confidence-auth-testing.mintlify.io/api-reference/get-materializedsegment /api/flags/api/materialized-segments.openapi.json get /v1/materializedSegments/{materializedSegment} Get a materialized segment. # Get Metric Source: https://confidence-auth-testing.mintlify.io/api-reference/get-metric /api/metrics/api/metric.openapi.json get /v1/metrics/{metric} Get a metric. # Get MetricCalculation Source: https://confidence-auth-testing.mintlify.io/api-reference/get-metriccalculation /api/metrics/api/metric-calculation.openapi.json get /v1/scheduledMetricCalculations/{scheduledMetricCalculation}/metricCalculations/{metricCalculation} Get an existing metric calculation. # Get Role Source: https://confidence-auth-testing.mintlify.io/api-reference/get-role /api/iam/api/role.openapi.json get /v1/roles/{role} Fetch a single role. # Get Rollout Source: https://confidence-auth-testing.mintlify.io/api-reference/get-rollout /api/experiments/rollout.openapi.json get /v1/workflows/rollout/instances/{instance} Retrieves a rollout by name. # Get Rule Source: https://confidence-auth-testing.mintlify.io/api-reference/get-rule /api/flags/api/flag.openapi.json get /v1/flags/{flag}/rules/{rule} Get a rule of a flag. # Get ScheduledExposureCalculation Source: https://confidence-auth-testing.mintlify.io/api-reference/get-scheduledexposurecalculation /api/metrics/api/exposure-calculation.openapi.json get /v1/scheduledExposureCalculations/{scheduledExposureCalculation} Get the scheduled exposure calculation. # Get ScheduledMetricCalculation Source: https://confidence-auth-testing.mintlify.io/api-reference/get-scheduledmetriccalculation /api/metrics/api/metric-calculation.openapi.json get /v1/scheduledMetricCalculations/{scheduledMetricCalculation} Get the scheduled metric calculation. # Get Segment Source: https://confidence-auth-testing.mintlify.io/api-reference/get-segment /api/flags/api/segment.openapi.json get /v1/segments/{segment} Get a segment. # Get Surface Source: https://confidence-auth-testing.mintlify.io/api-reference/get-surface /api/workflows/api/surface.openapi.json get /v1/surfaces/{surface} # Get User Source: https://confidence-auth-testing.mintlify.io/api-reference/get-user /api/iam/api/user.openapi.json get /v1/users/{user} Fetch a single user. # Get UserInvitation Source: https://confidence-auth-testing.mintlify.io/api-reference/get-userinvitation /api/iam/api/user.openapi.json get /v1/userInvitations/{userInvitation} Get an invitation. # Get Variant Source: https://confidence-auth-testing.mintlify.io/api-reference/get-variant /api/flags/api/flag.openapi.json get /v1/flags/{flag}/variants/{variant} Get a specific variant of the given flag. # List Abtest Source: https://confidence-auth-testing.mintlify.io/api-reference/list-abtest /api/experiments/abtest.openapi.json get /v1/workflows/abtest/instances Lists abtests with optional filtering and pagination. # List AnalysisResult Source: https://confidence-auth-testing.mintlify.io/api-reference/list-analysisresult /api/stats/api/analysis-result.openapi.json get /v2/workflows/{workflow}/instances/{instance}/analysisResults # List ApiClient Source: https://confidence-auth-testing.mintlify.io/api-reference/list-apiclient /api/iam/api/api-client.openapi.json get /v1/apiClients List API clients. # List AssignmentTable Source: https://confidence-auth-testing.mintlify.io/api-reference/list-assignmenttable /api/metrics/api/assignment-table.openapi.json get /v1/assignmentTables List assignment tables. The assignment tables are returned in no particular order. # List Client Source: https://confidence-auth-testing.mintlify.io/api-reference/list-client /api/iam/api/client.openapi.json get /v1/clients List clients. Clients are listed in no particular order. # List ClientCredential Source: https://confidence-auth-testing.mintlify.io/api-reference/list-clientcredential /api/iam/api/client.openapi.json get /v1/clients/{client}/credentials List client credentials. Credentials are listed in no particular order. # List DataWarehouse Source: https://confidence-auth-testing.mintlify.io/api-reference/list-datawarehouse /api/metrics/api/data-warehouse.openapi.json get /v1/dataWarehouses List data warehouses. The data warehouses are returned in no particular order. # List DimensionTable Source: https://confidence-auth-testing.mintlify.io/api-reference/list-dimensiontable /api/metrics/api/dimension-table.openapi.json get /v1/dimensionTables List dimension tables. The dimension tables are returned in no particular order. # List Entity Source: https://confidence-auth-testing.mintlify.io/api-reference/list-entity /api/metrics/api/entity.openapi.json get /v1/entities List entities. Entities are returned in no particular order. # List ExposureCalculation Source: https://confidence-auth-testing.mintlify.io/api-reference/list-exposurecalculation /api/metrics/api/exposure-calculation.openapi.json get /v1/scheduledExposureCalculations/{scheduledExposureCalculation}/exposureCalculations List exposure calculations from a schedule. The results are returned from latest to oldest. # List ExposureTable Source: https://confidence-auth-testing.mintlify.io/api-reference/list-exposuretable /api/metrics/api/exposure-table.openapi.json get /v1/exposureTables List exposure tables. The exposure tables are returned in no particular order. # List FactTable Source: https://confidence-auth-testing.mintlify.io/api-reference/list-facttable /api/metrics/api/fact-table.openapi.json get /v1/factTables List fact tables. The fact tables are returned in no particular order. # List Flag Source: https://confidence-auth-testing.mintlify.io/api-reference/list-flag /api/flags/api/flag.openapi.json get /v1/flags List all flags optionally filtered by state. The flags are ordered by `updateTime`. # List Group Source: https://confidence-auth-testing.mintlify.io/api-reference/list-group /api/iam/api/group.openapi.json get /v1/groups List the groups. # List MaterializedSegment Source: https://confidence-auth-testing.mintlify.io/api-reference/list-materializedsegment /api/flags/api/materialized-segments.openapi.json get /v1/materializedSegments List all materialized segments. # List Metric Source: https://confidence-auth-testing.mintlify.io/api-reference/list-metric /api/metrics/api/metric.openapi.json get /v1/metrics List metrics. The metrics are in no particular order. # List MetricCalculation Source: https://confidence-auth-testing.mintlify.io/api-reference/list-metriccalculation /api/metrics/api/metric-calculation.openapi.json get /v1/scheduledMetricCalculations/{scheduledMetricCalculation}/metricCalculations List metric calculations from a schedule. The results are returned in no particular order. # List Role Source: https://confidence-auth-testing.mintlify.io/api-reference/list-role /api/iam/api/role.openapi.json get /v1/roles List roles. # List Rollout Source: https://confidence-auth-testing.mintlify.io/api-reference/list-rollout /api/experiments/rollout.openapi.json get /v1/workflows/rollout/instances Lists rollouts with optional filtering and pagination. # List Rule Source: https://confidence-auth-testing.mintlify.io/api-reference/list-rule /api/flags/api/flag.openapi.json get /v1/flags/{flag}/rules List all rules of the flag. Rules are returned in the same order as they are evaluated. # List ScheduledExposureCalculation Source: https://confidence-auth-testing.mintlify.io/api-reference/list-scheduledexposurecalculation /api/metrics/api/exposure-calculation.openapi.json get /v1/scheduledExposureCalculations List scheduled exposure calculations. The results are returned in no particular order. # List ScheduledMetricCalculation Source: https://confidence-auth-testing.mintlify.io/api-reference/list-scheduledmetriccalculation /api/metrics/api/metric-calculation.openapi.json get /v1/scheduledMetricCalculations List scheduled metric calculations. The results are returned in no particular order. # List Segment Source: https://confidence-auth-testing.mintlify.io/api-reference/list-segment /api/flags/api/segment.openapi.json get /v1/segments List segments. Segments are listed in no particular order. # List Surface Source: https://confidence-auth-testing.mintlify.io/api-reference/list-surface /api/workflows/api/surface.openapi.json get /v1/surfaces # List User Source: https://confidence-auth-testing.mintlify.io/api-reference/list-user /api/iam/api/user.openapi.json get /v1/users List users within the organization. # List UserGroup Source: https://confidence-auth-testing.mintlify.io/api-reference/list-usergroup /api/iam/api/user.openapi.json get /v1/users/{user}/groups List groups for a user. # List UserInvitation Source: https://confidence-auth-testing.mintlify.io/api-reference/list-userinvitation /api/iam/api/user.openapi.json get /v1/userInvitations List the invitations currently existing for this account. # List Variant Source: https://confidence-auth-testing.mintlify.io/api-reference/list-variant /api/flags/api/flag.openapi.json get /v1/flags/{flag}/variants List all the variants of this flag. The variants are returned in the order they were added to the flag. # Query MetricCalculation Source: https://confidence-auth-testing.mintlify.io/api-reference/query-metriccalculation /api/metrics/api/metric-calculation.openapi.json post /v1/scheduledMetricCalculations/{scheduledMetricCalculation}/metricCalculations/{metricCalculation}:query Query results for a single metric calculation. # Query ScheduledMetricCalculation Source: https://confidence-auth-testing.mintlify.io/api-reference/query-scheduledmetriccalculation /api/metrics/api/metric-calculation.openapi.json post /v1/scheduledMetricCalculations/{scheduledMetricCalculation}:query Query results from a given metric calculation schedule. This is a general endpoint for querying and aggregating metric data. The aggregation can be performed over both time and specific dimensions. # Queryreferences Segment Source: https://confidence-auth-testing.mintlify.io/api-reference/queryreferences-segment /api/flags/api/segment.openapi.json get /v1/segments/{segment}:queryReferences Query all segments that reference the specified segment in their targeting. # Queryusage Flag Source: https://confidence-auth-testing.mintlify.io/api-reference/queryusage-flag /api/flags/api/flag.openapi.json post /v1/flags/{flag}/usage:query Query time series data about how much this flag was used recently. You cannot query more than 7 days back in time. # Request AccessToken Source: https://confidence-auth-testing.mintlify.io/api-reference/request-accesstoken /api/iam/api/auth.openapi.json post /v1/oauth/token # Resolves Flag Source: https://confidence-auth-testing.mintlify.io/api-reference/resolves-flag /api/flags/api/resolve.openapi.json post /v1/flags:resolve Resolve multiple flags into variants and values. This method resolves all flags that are enabled for the given client, or a subset of them specified in the request. A flag is resolved by evaluating its rules in order, a rule matches if: 1) it is enabled, 2) the referred segment is active, and 3) the randomization unit is in the population indicated by the segment's targeting criteria and population allocation. The first rule that matches will assign a variant and value to the unit. Archived flags are not included. # Resume ScheduledMetricCalculation Source: https://confidence-auth-testing.mintlify.io/api-reference/resume-scheduledmetriccalculation /api/metrics/api/metric-calculation.openapi.json post /v1/scheduledMetricCalculations/{scheduledMetricCalculation}:resume Resumes the scheduled metric calculation. # Retrigger MetricCalculation Source: https://confidence-auth-testing.mintlify.io/api-reference/retrigger-metriccalculation /api/metrics/api/metric-calculation.openapi.json post /v1/scheduledMetricCalculations/{scheduledMetricCalculation}/metricCalculations/{metricCalculation}:retrigger Retriggers a completed metric calculation. This will invalidate the results of the existing calculation and replace with the new results. Can only be done if the current calculation is completed and not already retriggered. Returns the new metric calculation. # Retrigger ScheduledExposureCalculation Source: https://confidence-auth-testing.mintlify.io/api-reference/retrigger-scheduledexposurecalculation /api/metrics/api/exposure-calculation.openapi.json post /v1/scheduledExposureCalculations/{scheduledExposureCalculation}:retrigger Retriggers the scheduled exposure calculation. This will truncate the exposure table and reset the schedule # Retrigger ScheduledMetricCalculation Source: https://confidence-auth-testing.mintlify.io/api-reference/retrigger-scheduledmetriccalculation /api/metrics/api/metric-calculation.openapi.json post /v1/scheduledMetricCalculations/{scheduledMetricCalculation}:retrigger Retriggers the scheduled metric calculation. This will directly retrigger all calculations that have been run so far # Run Analysis Source: https://confidence-auth-testing.mintlify.io/api-reference/run-analysis /api/stats/api/analysis.openapi.json post /v2/stats:runAnalysis Runs an analysis that tests multiple hypotheses and evaluates their results by an optional decision rule. # Run PowerAnalysis Source: https://confidence-auth-testing.mintlify.io/api-reference/run-poweranalysis /api/stats/api/power.openapi.json post /v2/stats:runPowerAnalysis Runs a power analysis. # Abtest Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/abtest Represents an Abtest. # Abtest.AbTestData Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/abtest-abtestdata Module data for abtest. # Abtest.DecisionRecordData Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/abtest-decisionrecorddata Module data for decision. # Abtest.ExploreData Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/abtest-exploredata Module data for explore. # Abtest.ExposureData Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/abtest-exposuredata Module data for exposure. # Abtest.FlagsData Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/abtest-flagsdata Module data for flags. # Abtest.HypothesisData Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/abtest-hypothesisdata Module data for hypothesis. # Abtest.MetricsData Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/abtest-metricsdata Module data for metrics. # Abtest.PlanningData Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/abtest-planningdata Module data for planning. # Abtest.ReportData Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/abtest-reportdata Module data for report. # Abtest.ReviewsData Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/abtest-reviewsdata Module data for reviews. # Abtest.SampleSizeData Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/abtest-samplesizedata Module data for samplesize. # Abtest.StatsData Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/abtest-statsdata Module data for stats. # AccessToken Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/accesstoken Schema reference for the AccessToken object in the Confidence API. # AnalysisData Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/analysisdata Data used for the analysis. # AnalysisPlan Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/analysisplan The description of which hypotheses are going to be tested, which group comparisons are included, and how the result should be evaluated. # AnalysisResult Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/analysisresult The result of a statistical analysis for an experiment instance. # ApiClient Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/apiclient An API client that can be used to programmatically access the Confidence APIs. # AssignmentTable Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/assignmenttable An assignment table is a description of a dataset of how entities have been assigned to variants. # Client Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/client A Client allows an app to access certain Confidence services like resolving flags and sending events. # ClientCredential Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/clientcredential The credentials required for a client to access Confidence. # DimensionTable Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/dimensiontable A description of a dataset that contains one or more dimensions of an entity. # Entity Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/entity Description of a uniquely identifiable entity. # ExposureCalculation Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/exposurecalculation Represents the calculation of an exposure table for a specific time window from an assignment table. # ExposureTable Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/exposuretable An exposure table describes how to compute exposures from assignments. # FactTable Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/facttable A set of events from some business process, for example, a sale occurred. # Flag Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/flag A flag controlling how entities are assigned variants. # Flag.Rule Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/flag-rule A rule that decides how a subset of the flag's variants are assigned. # Flag.Variant Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/flag-variant A possible named value the flag can assign. # Group Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/group A group of identities. # MaterializedSegment Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/materializedsegment A slice of the entity population that is materialized as individual entity identifiers stored in a database. # Metric Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/metric A general description of how to aggregate a measurement from a fact table across entities. # MetricCalculation Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/metriccalculation Represents the calculation of a metric for a specific time window. # PowerAnalysisData Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/poweranalysisdata Data used for the power analysis. # Role Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/role A role is a named set of permissions, like `Admin` or `Flag Editor`. # Rollout Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/rollout Represents a Rollout. # Rollout.ExploreData Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/rollout-exploredata Module data for explore. # Rollout.ExposureData Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/rollout-exposuredata Module data for exposure. # Rollout.FlagsData Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/rollout-flagsdata Module data for flags. # Rollout.MetricsData Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/rollout-metricsdata Module data for metrics. # Rollout.PlanningData Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/rollout-planningdata Module data for planning. # Rollout.ReviewsData Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/rollout-reviewsdata Module data for reviews. # Rollout.RolloutData Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/rollout-rolloutdata Module data for rollout. # Rollout.SampleSizeData Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/rollout-samplesizedata Module data for samplesize. # Rollout.StatsData Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/rollout-statsdata Module data for stats. # ScheduledExposureCalculation Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/scheduledexposurecalculation Represents the schedule of an exposure calculation. # ScheduledMetricCalculation Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/scheduledmetriccalculation Represents a schedule of metric calculations. # Segment Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/segment A reusable slice of an entity population. # Surface Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/surface A surface that represents some area of an application that can be experimented on. # Targeting Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/targeting Schema reference for the Targeting object in the Confidence API. # Targeting.Criterion Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/targeting-criterion Schema reference for the Targeting.Criterion object in the Confidence API. # User Source: https://confidence-auth-testing.mintlify.io/api-reference/schemas/user A Confidence user. # Suggest Metric Source: https://confidence-auth-testing.mintlify.io/api-reference/suggest-metric /api/metrics/api/metric.openapi.json post /v1/metrics:suggestMetric Suggests a metric based on a title and / or description # Unarchive Flag Source: https://confidence-auth-testing.mintlify.io/api-reference/unarchive-flag /api/flags/api/flag.openapi.json post /v1/flags/{flag}:unarchive unarchive a flag that has been archived. # Undelete FactTable Source: https://confidence-auth-testing.mintlify.io/api-reference/undelete-facttable /api/metrics/api/fact-table.openapi.json post /v1/factTables/{factTable}:undelete Undeletes a fact table. # Update Abtest Source: https://confidence-auth-testing.mintlify.io/api-reference/update-abtest /api/experiments/abtest.openapi.json patch /v1/workflows/abtest/instances/{instance} Updates an existing abtest. # Update AnalysisResult Source: https://confidence-auth-testing.mintlify.io/api-reference/update-analysisresult /api/stats/api/analysis-result.openapi.json patch /v2/workflows/{workflow}/instances/{instance}/analysisResults/{analysisResult} # Update ApiClient Source: https://confidence-auth-testing.mintlify.io/api-reference/update-apiclient /api/iam/api/api-client.openapi.json patch /v1/apiClients/{apiClient} Update an existing API client. # Update AssignmentTable Source: https://confidence-auth-testing.mintlify.io/api-reference/update-assignmenttable /api/metrics/api/assignment-table.openapi.json patch /v1/assignmentTables/{assignmentTable} Update an assignment table. # Update Client Source: https://confidence-auth-testing.mintlify.io/api-reference/update-client /api/iam/api/client.openapi.json patch /v1/clients/{client} Update an existing client. # Update ClientCredential Source: https://confidence-auth-testing.mintlify.io/api-reference/update-clientcredential /api/iam/api/client.openapi.json patch /v1/clients/{client}/credentials/{credential} Update an existing client client credential. # Update DataWarehouse Source: https://confidence-auth-testing.mintlify.io/api-reference/update-datawarehouse /api/metrics/api/data-warehouse.openapi.json patch /v1/dataWarehouses/{dataWarehouse} Update the data warehouse. It is not possible to switch between data warehouses, e.g., going from BigQuery to Databricks. The endpoint will verify that access to relevant resources are set up correctly. # Update DimensionTable Source: https://confidence-auth-testing.mintlify.io/api-reference/update-dimensiontable /api/metrics/api/dimension-table.openapi.json patch /v1/dimensionTables/{dimensionTable} Updates the given dimension table. # Update Entity Source: https://confidence-auth-testing.mintlify.io/api-reference/update-entity /api/metrics/api/entity.openapi.json patch /v1/entities/{entity} Updates the given entity. # Update ExposureTable Source: https://confidence-auth-testing.mintlify.io/api-reference/update-exposuretable /api/metrics/api/exposure-table.openapi.json patch /v1/exposureTables/{exposureTable} Update the exposure table. # Update FactTable Source: https://confidence-auth-testing.mintlify.io/api-reference/update-facttable /api/metrics/api/fact-table.openapi.json patch /v1/factTables/{factTable} Updates the given fact table. # Update Flag Source: https://confidence-auth-testing.mintlify.io/api-reference/update-flag /api/flags/api/flag.openapi.json patch /v1/flags/{flag} Updates the flag. When updating a flag, all variants must match the schema, segments and variants referenced by rules must exist. # Update Group Source: https://confidence-auth-testing.mintlify.io/api-reference/update-group /api/iam/api/group.openapi.json patch /v1/groups/{group} Updates a group # Update MaterializedSegment Source: https://confidence-auth-testing.mintlify.io/api-reference/update-materializedsegment /api/flags/api/materialized-segments.openapi.json patch /v1/materializedSegments/{materializedSegment} Update a rule. The segment and variants referred to by the rule must exist. # Update Metric Source: https://confidence-auth-testing.mintlify.io/api-reference/update-metric /api/metrics/api/metric.openapi.json patch /v1/metrics/{metric} Update a metric. This will affect future calculations using this metric # Update Role Source: https://confidence-auth-testing.mintlify.io/api-reference/update-role /api/iam/api/role.openapi.json patch /v1/roles/{role} Updates a role # Update Rollout Source: https://confidence-auth-testing.mintlify.io/api-reference/update-rollout /api/experiments/rollout.openapi.json patch /v1/workflows/rollout/instances/{instance} Updates an existing rollout. # Update Rule Source: https://confidence-auth-testing.mintlify.io/api-reference/update-rule /api/flags/api/flag.openapi.json patch /v1/flags/{flag}/rules/{rule} Update a rule. The segment and variants referred to by the rule must exist. # Update ScheduledExposureCalculation Source: https://confidence-auth-testing.mintlify.io/api-reference/update-scheduledexposurecalculation /api/metrics/api/exposure-calculation.openapi.json patch /v1/scheduledExposureCalculations/{scheduledExposureCalculation} Updates a scheduled exposure calculation. # Update ScheduledMetricCalculation Source: https://confidence-auth-testing.mintlify.io/api-reference/update-scheduledmetriccalculation /api/metrics/api/metric-calculation.openapi.json patch /v1/scheduledMetricCalculations/{scheduledMetricCalculation} Updates a scheduled metric calculation. # Update Segment Source: https://confidence-auth-testing.mintlify.io/api-reference/update-segment /api/flags/api/segment.openapi.json patch /v1/segments/{segment} Update the segment. Only segments in state UNALLOCATED can be updated. # Update Surface Source: https://confidence-auth-testing.mintlify.io/api-reference/update-surface /api/workflows/api/surface.openapi.json patch /v1/surfaces/{surface} # Update User Source: https://confidence-auth-testing.mintlify.io/api-reference/update-user /api/iam/api/user.openapi.json patch /v1/users/{user} Update a user. # Update Variant Source: https://confidence-auth-testing.mintlify.io/api-reference/update-variant /api/flags/api/flag.openapi.json patch /v1/flags/{flag}/variants/{variant} Updates a variant of a flag. The updated variant must satisfy the schema of the flag. # Validate Metric Source: https://confidence-auth-testing.mintlify.io/api-reference/validate-metric /api/metrics/api/metric.openapi.json post /v1/metrics:validateMetric Validates a metric configuration # Changelog Source: https://confidence-auth-testing.mintlify.io/changelog New features, improvements, and fixes in Confidence. Follow the latest improvements to Confidence. Subscribe through the RSS feed to receive new entries. ## Target string values with contains String targeting conditions now support **contains**, making it easier to match values when an exact, prefix, or suffix comparison is not appropriate. ## Reorder metrics in exploratory analysis Metrics in the metrics explorer can now be reordered, giving you more control over how an analysis is organized and presented. ## Schedule materialized segment loads Materialized segments support scheduled load jobs. Owners can configure when segment data should be refreshed and follow the status of those jobs. ## Additional improvements * Use two data warehouses during a warehouse migration. * Search for metric display names containing percent signs. * Edit credential display names. * Configure verified login domains through account administration. * GitHub Enterprise Cloud repositories are supported by GitHub integrations. ## Manage the metric lifecycle Metrics can now be created as drafts and published when they are ready for use. Lifecycle states are visible in metric lists and pickers, and metrics can be archived or restored. Verified and code-managed indicators make it clearer which metric definitions have been reviewed or originate from a repository. ## Configure flag rules more easily The flag rule creation flow has been redesigned with clearer targeting controls and a more focused configuration experience. ## Explore metric definitions Open a metric directly in the metrics explorer with its relevant configuration already selected. Metric diagnostics also expose more of the data behind calculations. ## Additional improvements * Filter the metrics catalog by lifecycle state. * Select numerator and denominator filters in the metric explorer. * Choose an owner when creating a materialized segment. * Access documentation, the blog, and support through the header help menu. ## Create metrics from the metrics explorer The metrics explorer can now create a metric or measurement from the current analysis. Metric filters support **contains** and **does not contain**, and metric pickers show the preferred direction of each metric. ## Inspect materialized segments Materialized segment details now include Bloom filter information, making storage and distribution characteristics easier to understand. ## Additional improvements * Rollout schedule editing and validation are clearer. * Group identities appear in identity selection. * Theme names can be edited inline. * Flag rule cards display readable country names instead of country codes. ## Archive flags with active rules Flags can now be archived without first removing all active rules. This simplifies cleanup while preserving the flag's existing configuration and history. ## Filter experiments by surface properties Experiment lists on surface pages can be filtered by property, making it easier to find experiments that affect a particular part of a surface. ## Additional improvements * Randomization and allocation can be optional where the workflow supports it. * Metric SQL previews correctly support `LIKE` filters. * Exposure filters are preserved when metric data is updated. * The updated flag page is now the default experience. ## Explore fact table dimensions Explorations can now use dimensions from the fact table that backs a metric, in addition to dimensions from related dimension tables. ## Automate flag cleanup [Automatic flag cleanup](/docs/flags/flag-cleanup) runs scheduled checks for unused flags. Agents can remove unused flags from your codebase and archive them in Confidence. The first release supports GitHub and Cursor, with more integrations and cleanup capabilities planned. To get started, go to **Flags** and select **Cleanup**. ## Filter ratio metric numerators Ratio metrics now support filters that apply only to the numerator. This gives you more control over which events contribute to the numerator without changing the denominator. ## Configure multi-variant experiments Experiments with more than two variants now have simpler weight selection. The transition from an A/B test to a rollout also preserves multi-variant configurations more smoothly. ## Additional improvements * Confidence has an updated look and feel, which is rolling out gradually. * Cloudflare telemetry is more reliable. ## Receive activity notifications through webhooks [Webhooks](/docs/notifications/webhook-configuration) can send Confidence activity notifications to your HTTPS endpoint. Use them with external systems, monitoring tools, or custom notification workflows. ## Use HyperLogLog metrics Confidence now supports HyperLogLog metrics for approximate distinct counts over large datasets. ## Follow resource activity The home page now includes an [activity feed](/docs/notifications/activity-feeds) for important events from resources you follow. You automatically follow resources that you create. ## Additional improvements * Result pages load faster. * Selecting environments in flag rules is easier. ## Create richer reports The [report editor](/docs/experiments/reports) has been redesigned. It now includes templates, an AI writing assistant, more formatting options, image uploads, and metric tables. Open it from the **Reports** tab of any live or completed experiment. ## Target string prefixes and suffixes New **starts with** and **ends with** criteria support rules such as targeting users whose email address ends with a specific domain. This capability is available as a beta. ## Coordinate experiments with exclusivity guidance Exclusivity groups can now be marked as required or suggested for a surface. These settings make the intended coordination between experiments clearer. ## Estimate experiment duration The updated [sample size calculator](/docs/experiments/sample-size-calculator) is now available to everyone. It estimates how many days an experiment design requires and provides a visual breakdown of its sample size requirements. ## Additional improvements * Ratio metrics support numerator-only filters. * Configure the initial reach of a rollout from the sidebar. * Launch and end notifications in Slack include the hypothesis, variants, targeting, results, surfaces, and owner. * Entity pages support editing more properties, including the display name. ## Review experiments with AI The [AI review agent](/docs/how-to-guides/create-review-agent) is now available to everyone. It helps teams review their experiments autonomously against your organization's guidelines. ## Inspect flags through MCP The Flag MCP server has three new capabilities: * Pass `summary=false` to `getFlag` to retrieve detailed rule configurations and timestamps. * Use `getFlagHistory` to see who changed a flag, which fields changed, and when. You can filter the history by date range. * Use `getIdentityInfo` to resolve identity references to readable names when reviewing flag history. ## Forecast experiment duration The sample size calculator beta now estimates expected traffic, shows how expected and required sample sizes change over time, and predicts how many days an experiment needs to run. ## Access experiments through MCP The new Experiments MCP server is available as a beta. AI agents can list experiments, inspect individual experiments, read results, and retrieve related metric and fact table definitions. ## Organize resources with labels [Labels](/docs/labels/introduction) are now available for flags, metrics, A/B tests, and rollouts. Create your own labels to categorize resources and make them easier to find. ## Resolve flags locally Production-ready [local OpenFeature providers](/docs/flags/local-resolver) are now available for Go, JavaScript, Java, and Rust. They provide near-zero-latency flag resolution and greater resilience. ## Additional improvements * Select all metrics returned by a search in the metric picker. * Boolean flags automatically populate treatments when you create an A/B test. * Large exploratory analyses load faster. * The Go OpenFeature provider supports native Go structs for stronger type safety and less parsing. * The JavaScript OpenFeature provider includes React and Next.js utilities for server-side and client-side feature flags. ## Choosing proxy metrics Our new article, [When proxy metrics shape product development](https://confidence.spotify.com/blog/proxy-metrics), explores the risks of optimizing for a metric that only approximates the outcome you care about. ## Early previews * An agentic review assistant can check whether rollouts and A/B tests follow your organization's guidelines. * Metric labels let you annotate and organize metrics with your own labels. These capabilities are available as opt-in previews. ## Additional improvements * Minimum detectable effect (MDE) is now optional for success metrics. * The hypothesis is now in the main experiment design area instead of the sidebar. ## Configure environments Environments separate flag behavior across deployment stages such as development, staging, and production. Use the same client in several environments while assigning different credentials to each one. Flag rules can now apply only in selected environments. To get started, configure your environments, assign client credentials, and add environments to your flag rules. ## Get targeting value suggestions Confidence can suggest recently used values when you configure targeting. Mark non-personally identifiable information (non-PII), such as an app version, in your context schema override to enable suggestions for that field. ## Additional improvements * React to comments and review responses with emoji. * View rollout progress in the overview table. * Set and format hypotheses with Markdown more easily. * Flag filter conditions have a clearer visualization. # API Fundamentals Source: https://confidence-auth-testing.mintlify.io/docs/api/api-basics Learn the fundamentals of working with Confidence APIs including authentication, pagination, and resource names. The Confidence API uses the REST structure. Confidence supports authentication via access tokens and OAuth 2.0. You make requests via HTTP endpoints with clear functions and appropriate response codes. The API follows the [Google API guidelines](https://google.aip.dev/general) as much as possible. ## Authentication Before you can access an endpoint within Confidence, you need to have valid authentication. Two kinds of APIs exist in Confidence: the management API that you use to configure the different entities in the platform (flags, experiments, fact tables etc), and the resolve/events API that you use in the Client SDKs to resolve flag values and emit events. Because these two kinds have different characteristics, they use different methods for authentication. For the resolve API, you create a "Client" which has an `API_TOKEN` that you use to authenticate. This API token is long-lived so you can, for example, bundle it inside your mobile app to resolve flags. A client can have multiple API tokens attached to it, to allow for rotating tokens as needed. You create clients in the **Admin** panel in [Confidence](https://app.confidence.spotify.com). The management API uses a [Client Credentials OAuth flow](https://auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow), where you supply a client ID and a client secret and in exchange get an access token that is valid for 24 hours. The token is then included in all requests to the API in an HTTP header. You create API clients in the **Admin** panel in [Confidence](https://app.confidence.spotify.com). ### Request a Token for an API Client To request an access token, make a POST request to the `/v1/oauth/token` endpoint with your client credentials. Try the interactive API playground to request an access token. ## Pagination List resources allow for [pagination](https://google.aip.dev/158) by allowing a `page_token` and a `page_size` in the requests. If there are more results, a list response has a `next_page_token` field. Use this token in the next request to ask for the next page of results. ## Resource Names The API uses [resource names](https://google.aip.dev/122) to uniquely identify each entity that you can use to reference that resource. A resource name consists of a type and an identifier, for example `flags/my-flag`. A resource name can be hierarchical if the parent owns a child resource. The resource name can then have multiple levels, for example `flags/my-flag/variants/control`. ## Response Status Codes The Confidence API uses standard HTTP status codes to signal the status of a request to a consumer, for example `200 (OK)`, `401 (Unauthorized)`, `404 (Not found)`. ## Errors The Confidence API uses standard HTTP status codes to signal error conditions. Is some cases the response also includes a JSON payload with a more detailed error message: ```json theme={null} { "code": 7, "message": "Permission denied, missing permission list:metrics", "details": [] } ``` ## Update Masks When updating a resource, the update request can take an optional field mask, which specifies which fields on the resource the request should update. If the field mask is not included, the request updates the whole resource. More details about field masks and how to specify them are available in the [Google API guidelines](https://google.aip.dev/161). # Connectors Source: https://confidence-auth-testing.mintlify.io/docs/api/connectors Confidence Event connectors is a managed service for exporting different types of event data from Confidence. Read more about how to get started with [exporting data](/docs/api/how-to-guides/connectors/export-data) from Confidence. As for everything else in the Confidence platform you pay as you go and only pay for what you use of Confidence Events. ## Use Confidence Events Learn how to export event from Confidence. Learn how to export assignment events from Confidence. Learn how to export different kinds of internal events from Confidence. # Experiments Source: https://confidence-auth-testing.mintlify.io/docs/api/experiments Confidence Experiments is a fully managed service for A/B testing and experimentation. Confidence Experiments is a fully managed service for A/B testing and experimentation. With Confidence Experiments you can run controlled experiments to measure the impact of changes in your application, make data-driven decisions, and continuously optimize your product. Experiments allow you to test hypotheses, analyze results with statistical rigor, and make informed decisions about which features and changes drive the most value for your users. ## Use Confidence Experiments View the complete API reference for managing experiments. The Experiments API provides endpoints for creating and managing A/B tests and rollouts. See the API Reference section below for detailed endpoint documentation. # Flag Concepts Source: https://confidence-auth-testing.mintlify.io/docs/api/flags/concepts Understand the key concepts in Confidence Flags. This section explains the core concepts in Confidence Flags. These primitives work together to enable Confidence to flexibly support a broad range of applications where you need to remotely change an experience or behavior of your app. ## Flags A `Flag` is a mechanism to remotely configure different parts of an application. The configuration can either be deterministic such that, for example, all employees see a blue button and everyone else sees a red button. It can also be random such as if users are randomly assigned a blue or red button. ## Variants A `Variant` is a named configuration. For example, you could have a variant called `big red button` that configures a button to be big and red. You can have as many variants as you want, but a user (or service) can only resolve one variant at a time for a given flag. ```js Example variant value theme={null} { "color": "red", "size": 12 } ``` The value of a variant is a JSON object that conforms to a `Schema`. The schema describes the structure of the value. It ensures that the value is valid and that it conforms to the expectations of the application. ```js Example schema theme={null} { "schema": { "color": { "stringSchema": {} }, "size": { "intSchema": {} } } } ``` ## Segments A `Segment` is a mechanism to define a subpopulation of users. For example, you could have a segment that represents 10% of users from Sweden. A set of `Criteria` determines what users are in a segment. A `Criteria` is a mechanism to define a property of a user. For example, you could have a criteria that says that a user is an employee if they have the `employee` attribute set to `true`. Segments have two key parts: * **Targeting**: A set of criteria that filter users based on attributes * **Allocation**: What percentage (0% to 100%) of the targeted users should be in the segment Segments can be mutually exclusive or overlapping. For example, you could have a segment that represents users from Sweden, and another segment that represents users from the United States. These two segments are mutually exclusive, meaning that no user can be in both segments. You could also have a segment that represents 10% of users from Sweden and another segment that represents 10% of users from Sweden that are also employees. These two segments are overlapping, meaning that some users can be in both segments. With coordination and exclusivity tags it's possible to create exclusive segments that would naturally be overlapping. ## Targeting Criteria Targeting criteria allow you to filter users based on attributes in the evaluation context. You define named criteria and compose them into expressions using logical operators. Targeting has two parts: * **Criteria**: Named conditions that define individual filters * **Expression**: Logical composition of criteria using operators ### Attribute Criteria Attribute criteria match a value in the evaluation context against a specified value using an operator. You can use different value types (Boolean, Number, String, Timestamp, Version) and matching operators (equality, set, range). You can reference nested fields using dot notation (for example, `device.model` to access `{device: {model: "iPhone14"}}`). ### Segment Criteria Segment criteria check if a user is part of another segment, allowing for composing sophisticated targeting logic by combining multiple segments. ## Randomization and Allocation Confidence randomizes users based on a field in the evaluation context (defaults to `targeting_key`). The randomization is: * **Consistent**: The same user always gets the same allocation * **Distributed**: On average, Confidence allocates the specified percentage of users to the segment If the randomization field is missing or `null` in the evaluation context, the segment doesn't match. ## Coordination Coordination makes segments mutually exclusive, ensuring users can only be in one experiment at a time. This uses two sets of tags on each segment: * **Exclusivity tags**: Incoming tags that identify what this segment is (for example, `ranking-experiment`, `checkout-flow`) * **Exclusive to tags**: Outgoing tags that specify which other segments to exclude from Two segments are mutually exclusive if there's an overlap between one segment's exclusivity tags and another segment's exclusive-to tags. For example: * Segment A has `exclusivityTags: ["ranking"]` and `exclusiveTo: ["ranking"]` * Segment B has `exclusivityTags: ["ranking"]` and `exclusiveTo: ["ranking"]` * These segments are exclusive because A's exclusivity tags overlap with B's exclusive-to tags (and vice versa) When allocating a segment with coordination tags, Confidence verifies there's enough available space. The allocation fails if: * Too many coordinating segments already exist * The combined allocations exceed 100% * There's insufficient space for the requested proportion If allocation fails, you must reduce the proportion, archive other segments, or adjust coordination tags. ## Rules A `Rule` combines a segment (who is eligible) with variant assignments (what they receive). Rules are the mechanism that determines which variant a user gets. Rules evaluate in priority order, with lower priority numbers evaluated first. The first rule that matches determines the variant. Newly created rules start disabled—you must explicitly enable them. ## Evaluation Context The evaluation context is how clients give contextual data for rule evaluation. It's a schema-less key-value map (JSON object) containing any data needed for targeting, such as: * User IDs or identifiers * User attributes (country, device, browser, etc.) * Session or environment information Example: ```json theme={null} { "user_id": "rosling", "country": "SE", "device": { "vendor": "apple", "os": "ios" } } ``` ## Variant Assignment When a rule matches, Confidence assigns a variant using bucket-based randomization. This ensures consistent, stable assignments while distributing users across variants. Here's how it works: 1. **Hash computation**: Computes a hash of the field value specified by `targetingKeySelector` (defaults to `targeting_key`) from the evaluation context 2. **Bucket calculation**: Normalizes the hash to a bucket number: `hash % bucketCount` 3. **Variant selection**: Assigns the variant whose bucket range includes the calculated bucket number The `targetingKeySelector` specifies which field from the evaluation context to use for randomization. Common patterns include using `targeting_key` for general user identification, `user_id` for user-level randomization, `device_id` for device-level randomization, or `session_id` for session-level randomization. If the specified field is missing or `null`, the rule doesn't match. The empty string `""` is a valid value. ## Resolve a Flag Resolving a flag is the process of determining which variant a user should see for a given flag. The application passes in an evaluation context that has information about the user and other information that you can use to decide if a user should be eligible. If no rule matches the user, the application normally falls back to a default variant. The rules evaluate in order. The rule used is the first rule that matches the user. This means that you can have a rule that says that all employees should see the `big red button` variant, and a rule that says that 50% of users should see the `big red button` variant and 50% should see the `small blue button` variant. In this case, all employees would see the `big red button` variant, and the other 50% would be randomly assigned a variant. A rule can "fall through." This means that the rule matches, but instead of assigning a variant to the user, the user is assigned a variant from one of the following rules. ## Apply a Flag When you resolve a flag and use the value in your application, the flag is **applied**. You must report this back to Confidence using the apply operation. Confidence then writes "flag applied" events to your data warehouse via a configured connector. Apply events matter because they: * **Track exposure**: Compute who was exposed to which variants and how many times * **Enable analysis**: Enable accurate A/B test and experiment analysis * **Measure adoption**: Track how often features are actually used * **Aid debugging**: Help debug flag behavior and targeting issues Apply a flag when: * The user sees a UI element controlled by the flag * The application executes code controlled by the flag * A backend service makes a decision based on the flag value Do NOT apply a flag when: * You resolved it but didn't use the value * You cached the value but haven't displayed it yet * A conditional check prevented you from using the flag ## Flag Clients A flag client represents a single application that uses flags. The flag client authenticates with Confidence using a shared secret. You have to authenticate flags with a flag client before they are available for use by that client. ## Archive When flags and segments are no longer needed, archive them instead of deleting. Archiving preserves resources for historical reference and analysis while removing them from active use. Confidence uses archiving instead of deletion to: * Keep historical data for analysis * Keep references in experiment results * Prevent breaking changes to existing integrations * Keep audit trails intact * Allow potential restoration (contact support) When you archive a flag, resolve requests return the user-specified default value and you can't use the flag in new experiments. When you archive a segment, it enters the `ARCHIVED` state and you can't use it in new rules, but existing rules using the segment continue to work. # Flags Reference Source: https://confidence-auth-testing.mintlify.io/docs/api/flags/flags-reference Technical reference for Confidence Flags. This section provides technical specifications and reference information for Confidence Flags. For conceptual explanations of how flags work, see [Flag Concepts](./concepts). ## Rules ### Key Characteristics * **Priority-based evaluation**: Rules evaluate in priority order, with lower priority numbers evaluated first * **First match wins**: The first rule that matches determines the variant * **Required state**: Newly created rules start disabled—you must explicitly enable them * **Segment dependency**: Rules require an allocated segment to function ### Rule Composition * **Segment**: Defines who is eligible for the rule * **Assignment specification**: Defines variant assignments using bucket-based randomization * **Targeting key selector**: Specifies which field from evaluation context to use for randomization (defaults to `targeting_key`) * **Priority**: Determines evaluation order * **Enabled state**: Controls whether the rule is active ### Best Practices * Create rules in a disabled state, test thoroughly, then enable * Use meaningful segment names that clearly describe the target audience * Put more specific rules before general rules (using priority) * Use bucket count 100 for percentage-based splits (or 1000 for per-mille precision) * If the targeting key field is missing or `null` in the evaluation context, the rule doesn't match (empty string `""` is valid) ## Variant Assignment ### Bucket Ranges * `bucketCount` defines how many buckets to divide users into * Each assignment specifies one or more bucket ranges (for example, `{lower: 0, upper: 50}`) * Ranges are inclusive at lower bound, exclusive at upper bound * Common pattern: Use `bucketCount: 100` for percentage-based splits (50/50 = buckets 0-50, 50-100) ### Assignment Types 1. **Variant assignment**: Assigns a bucket range to a specific variant (most common use case) * Use for A/B tests, multivariate tests, rollouts 2. **Fall-through assignment**: Passes assignment to the next matching rule, but logs an assignment event. Suitable for logging which users matched a segment without changing their experience * Creates complex rule chains where different segments handle different aspects 3. **Client default assignment**: Returns the default values specified by each client. Allows clients to define their own fallback behavior. Suitable for gradual rollouts or feature toggles ### Targeting Key Selector The `targetingKeySelector` specifies which field from the evaluation context to use for randomization. Common patterns: * `targeting_key` (default): General user identifier * `user_id`: User-level randomization * `device_id`: Device-level randomization (same user, different devices get different variants) * `session_id`: Session-level randomization (new variant each session) ## Archive Flags ### Archive Behavior **When you archive a flag:** * Flag still exists and you can reference it * Resolve requests return the user-specified default value * Flag appears as archived in the UI * Historical data remains available * You can't use it in new experiments * SDKs return default values for all users **When you archive a segment:** * Segment enters the `ARCHIVED` state * You can't use it in new rules * Existing rules using the segment continue to work * Confidence preserves historical allocation data * Frees up coordination space for other segments ### When to Archive **Archive flags when:** * Feature has been fully rolled out to all users * Experiment has concluded and you chose a winner * Feature is being permanently removed * Flag is deprecated and no longer needed **Archive segments when:** * Experiment using the segment has ended * Targeting criteria is no longer relevant * Consolidating segments * You created the segment for testing only ### Before You Archive 1. Check that no active experiments depend on the resource 2. Consider removing archived segments from rules (optional) 3. Document why you're archiving the resource 4. Notify team members about the archival ### After You Archive 1. Verify the resource shows as archived 2. Check that the change doesn't affect active experiments 3. Update documentation to reflect the change 4. Remove feature flag code from application (if applicable) 5. Archive related resources (segments for a flag, flags using a segment) ### Find Archival Candidates List flags and segments, then review for: * Flags/segments with no recent activity * Resources from completed experiments * Flags with all rules disabled * Segments in ALLOCATED state with no active rules * Test resources no longer in use ### Clean Up Application Code After archiving a flag, remove the flag code from your application and use the winning variant's behavior directly. ### Best Practices * Archive promptly—don't let unused resources accumulate * Document reasons and timing of archival * Clean up in stages: archive first, then remove code later * Review regularly for archival candidates * Coordinate with team when archiving shared resources # Resolution Reference Source: https://confidence-auth-testing.mintlify.io/docs/api/flags/resolution-reference Technical reference for flag resolution and application. This section provides technical specifications and reference information for flag resolution and application. For conceptual explanations of flag resolution and application, see [Resolve a Flag](./concepts#resolve-a-flag) and [Apply a Flag](./concepts#apply-a-flag) in the Flag Concepts page. ## Apply a Flag ### Timestamps Each apply requires two timestamps using the client's local clock: * `appliedTime`: When the flag value was actually used in the application * `sentTime`: When the client reports the apply to Confidence These two timestamps allow accurate tracking without requiring synchronized clocks. The difference helps account for: * Network latency * Batching delays * Offline operation ### Batch Requests It's recommended to batch apply operations: * Reduces network overhead * Saves battery life on mobile devices * More efficient for the service Wait for opportune moments (like when doing other network requests) to report applies. ### Mobile and Offline Scenarios For mobile apps and offline scenarios: 1. Queue applies locally while offline 2. Send all queued applies when network is available 3. Piggyback applies on other API calls 4. Preserve the original `appliedTime` even if sent later ### Handle Errors Apply operations should be fire-and-forget: * Log errors for debugging but don't block application flow * Don't retry immediately to avoid overwhelming the service * Consider queuing for later retry * Applying is not critical to UX—the flag has already been resolved ### Monitoring Track apply metrics to ensure data quality: * **Apply rate**: How often flags are being applied * **Apply delay**: Time between `appliedTime` and `sentTime` * **Apply failures**: How many applies are failing * **Missing applies**: Flags that were resolved but never applied ### Best Practices * Apply only when the flag value is actually used * Batch applies together when possible * Use accurate timestamps (set `appliedTime` when flag is actually used) * Handle failures gracefully without breaking application flow * Queue applies when offline and send when connected * Monitor apply rates to ensure experiment data is complete # Segments Reference Source: https://confidence-auth-testing.mintlify.io/docs/api/flags/segments-reference Technical reference for Confidence Segments. This section provides technical specifications and reference information for Confidence Segments. For conceptual explanations of segments, see [Segments](./concepts#segments) in the Flag Concepts page. ## Segment States Segments have three lifecycle states: | State | Description | | :-------------- | :------------------------------------------------------ | | **UNALLOCATED** | Initial state after creation | | **ALLOCATED** | Active and ready to use in flag rules | | **ARCHIVED** | No longer in use but preserved for historical reference | You must allocate a segment before using it in a flag rule. ## Targeting Criteria ### Expression Operators Supported expression operators: | Operator | Description | | :------- | :--------------------------------- | | `ref` | Reference a named criterion | | `not` | Logical NOT of a nested expression | | `and` | Logical AND between expressions | | `or` | Logical OR between expressions | ### Attribute Value Types Available value types: | Type | Description | Example | | :-------- | :------------------------ | :----------------------- | | Boolean | Boolean value | `true`, `false` | | Number | Integer or floating point | `42`, `3.14` | | String | String value | `"HELLO"` | | Timestamp | ISO 8601 timestamp | `"2023-01-01T00:23:54Z"` | | Version | Semantic version | `"2.1.3"` | ### Match Operators * **Equality (`eqRule`)**: Match exact value * **Set (`setRule`)**: Match any value from a set * **Range (`rangeRule`)**: Match values within a range (supports inclusive/exclusive bounds and open-ended ranges) ## Coordination ### Common Coordination Patterns 1. **Mutual exclusion**: All experiments in a feature area exclude each other using the same tag Use `exclusivityTags: ["homepage"]` and `exclusiveTo: ["homepage"]` 2. **Hierarchical coordination**: Specific experiments exclude from broader categories * Specific: `exclusivityTags: ["ranking-v2"]` and `exclusiveTo: ["ranking-v2", "all-experiments"]` * Broad: `exclusivityTags: ["all-experiments"]` and `exclusiveTo: ["all-experiments"]` 3. **Cross-feature coordination**: Related features that shouldn't run simultaneously * Search: `exclusivityTags: ["search"]` and `exclusiveTo: ["search", "ui-changes"]` * UI: `exclusivityTags: ["ui-changes"]` and `exclusiveTo: ["search", "ui-changes"]` ### Best Practices * Use descriptive tag names that clearly indicate the feature or experiment type * Plan coordination strategy before creating segments * Monitor allocation space within each coordination group * Archive completed experiments to free up space * Document which tags represent which feature areas # Event Connectors Source: https://confidence-auth-testing.mintlify.io/docs/api/how-to-guides/connectors/events Export event data ingested through the Confidence event sender SDKs. Event connectors export event data ingested through the Confidence event sender SDKs. Export events to BigQuery. The connector writes each event type to a separate table in the configured dataset with an optional prefix. ### Required GCP Roles * BigQuery data owner for the destination dataset. ### Configuration * **Project** - The GCP project the destination table exists in * **Service account** - A GCP service account that has write access to the destination table. Configure the service account so that the Confidence service account can impersonate it. * **Dataset** - The dataset in which to create the destination tables * **Table prefix** - An optional prefix to use for the tables created by this connector Export events to tables in Redshift, by first writing the data as Parquet files to an S3 bucket, and then importing these files into Redshift tables, one per event type. ### Required AWS Permissions/Policies for Role * `s3:GetObject` * `s3:GetObjectAcl` * `s3:PutObject` * `s3:PutObjectAcl` * `AmazonRedshiftDataFullAccess` policy * `AmazonRedshiftAllCommandsFullAccess` policy The role also needs to have permissions to create tables and insert rows into those tables in the configured database. ### Configuration * **Table Prefix** - A prefix to use for all tables created by the connector. The connector loads each event type into its own table. * **Cluster** - The name of the Redshift cluster to use. * **Database** - The name of the Redshift database to use. * **Schema** - The name of the Redshift schema in which the connector creates the table. * **Redshift region** - The AWS region of the cluster. Because of AWS limitations, the region of the cluster needs to match the region of the S3 bucket. * **Redshift Role ARN** - The role the Redshift `COPY` jobs use. This role needs to have permission to create tables and copy data into tables in the configured schema, and load files from the S3 bucket. * **Bucket** - The S3 bucket to write the Parquet files to. * **Bucket Role ARN** - The role Confidence has when writing files to the S3 bucket. * **Bucket Region** - The AWS region of the bucket. The bucket needs to be in the same region as the Redshift cluster. * **Batch settings** - These settings control the size and max age of the Parquet files written to S3. Export events to Databricks tables, by first writing the data as Parquet files to an S3 bucket, and then importing these files into Databricks tables. Events are written to separate tables per event type in the configured schema/catalog. ### Required AWS Permissions for Role * `s3:GetObject` * `s3:GetObjectAcl` * `s3:PutObject` * `s3:PutObjectAcl` ### Configuration * **Databricks schema** - The name of the Databricks schema/catalog in which to create tables. * **Databricks host** - The hostname for the Databricks instance, for example `xx.x.gcp.databricks.com`. * **Databricks HTTP path** - The HTTP path to use for the Databricks JDBC connection, available in the [connection details](https://docs.gcp.databricks.com/integrations/jdbc-odbc-bi.html#get-connection-details-for-a-cluster) for the cluster. * **Databricks Access Token** - An access token that has write access to the configured table. * **Role ARN** - The ARN for the AWS Role that has read and write access to the S3 bucket. The role needs to have a trust relationship configured so that the Confidence service account can assume this role. * **Bucket** - The S3 bucket to write the Parquet files to. * **Batch settings** - These settings control the size of the Parquet files written to S3. If not set or 0, Confidence uses the default settings. # Export Data From Confidence Source: https://confidence-auth-testing.mintlify.io/docs/api/how-to-guides/connectors/export-data Learn how to export data from Confidence using connectors. To export data Confidence has the concept of *"Connectors."* A connector takes events generated inside the Confidence platform (for example events specifying who got assigned to what experience) and forwards them to a destination. Configure connectors in the **Admin** panel in [Confidence](https://app.confidence.spotify.com). Three types of connectors are available. Each connector forwards different kinds of data: * **Flag Applied Connectors** - These connectors export the assignment data. * **Event Connectors** - These connectors export event data ingested through the Confidence event sender SDKs. * **Platform Connectors** - These connectors forwards internal events to the customer's system. The events could for example be `MetricCalculationCompleted` or `WorkflowInstanceCreated`. The connector destination can be either a warehouse such as BigQuery or Databricks, or a Pub/Sub topic or a Kinesis Stream that exists in your environment. When the data is in your warehouse, Confidence can query it by defining assignment and fact tables on top of the data. ## Authentication Setup Confidence tries to avoid storing credentials for the connector destinations whenever possible. Instead, every Confidence account gets a unique GCP service account that's used to authenticate when writing to a destination. The procedure to configure the authentication differs between GCP and AWS. The next sections describe the authentication steps. * Create a service account with the required permissions * On the Permissions tab for the service account you just created in the GCP console, grant access to the principal `account-@spotify-confidence.iam.gserviceaccount.com` to impersonate the account by adding the "Workload Identify User" role to it. For AWS Confidence uses [AssumeRoleWithWebIdentity](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html) to securely authenticate without having to store any credentials. * Create a role with the required permissions in the AWS IAM Console. Specify the required permissions for each connector destination type. * Edit the trust relationship for the role, and allow the GCP Service Account to assume the role by using a definition that looks like this: ```json theme={null} { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Federated": "accounts.google.com" }, "Action": "sts:AssumeRoleWithWebIdentity", "Condition": { "StringEquals": { "accounts.google.com:sub": "" } } } ] } ``` # Flag Applied Connectors Source: https://confidence-auth-testing.mintlify.io/docs/api/how-to-guides/connectors/flag-applied Export assignment data from Confidence. Flag applied connectors export assignment data. Export assignment data to a table in BigQuery. ### Required GCP Roles * BigQuery data owner for the destination table. ### Configuration * **Project** - The GCP project the destination table exists in * **Service account** - A GCP service account that has write access to the destination table, and that you've configured so that the Confidence service account can impersonate this account. * **Dataset** - The dataset in which to create the destination table * **Table** - The table to write the data to. The connector automatically creates the table. If the table already exists, the connector verifies that the schema looks as expected, otherwise it attempts to create the required columns. Export assignment data to a table in Redshift, by first writing the data as Parquet files to a S3 bucket, and then import these files into the configured table. ### Required AWS Permissions/Policies for Role * `s3:GetObject` * `s3:GetObjectAcl` * `s3:PutObject` * `s3:PutObjectAcl` * `AmazonRedshiftDataFullAccess` policy * `AmazonRedshiftAllCommandsFullAccess` policy The role also needs to have permissions to create tables and insert rows into those tables in the configured database. ### Configuration * **Table** - The name of the Redshift table to use for writing assignment data. The connector creates the table automatically when the first import is done. * **Cluster** - The name of the Redshift cluster to use. * **Database** - The name of the Redshift database to use. * **Schema** - The name of the Redshift schema where the connector creates the preceding table. * **Redshift region** - The AWS region of the cluster. Because of AWS limitations, the region of the cluster needs to match the region of the S3 bucket. * **Redshift Role ARN** - The role to use for the Redshift `COPY` jobs. This role needs to have permission to create tables and copy data into tables in the configured schema, and load files from the S3 bucket. * **Bucket** - The S3 bucket to write the Parquet files to. * **Bucket Role ARN** - The role Confidence assumes when writing files to the S3 bucket. * **Bucket Region** - The AWS region of the bucket. The bucket needs to be in the same region as the Redshift cluster. * **Batch settings** - These settings control the size and max age of the Parquet files written to S3. Export assignment data to a table in Databricks, by first writing the data as Parquet files to a S3 bucket, and then import these files into the specified table. ### Required AWS Permissions for Role * `s3:GetObject` * `s3:GetObjectAcl` * `s3:PutObject` * `s3:PutObjectAcl` ### Configuration * **Table** - The name of the Databricks table to use for writing assignment data. The connector creates the table automatically when the first import is done. * **Schema** - The name of the Databricks Schema/Catalogue where the connector creates the preceding table. * **Databricks HTTP path** - The HTTP path to use for the Databricks JDBC connection, available in the [connection details](https://docs.gcp.databricks.com/integrations/jdbc-odbc-bi.html#get-connection-details-for-a-cluster) for the cluster. * **Databricks Access Token** - An access token that has write access to the configured table. * **Role ARN** - The ARN for the AWS Role that has read/write access to the S3 bucket. You need to configure the role to have a trust relationship so that the Confidence service account can to assume this role. * **Bucket** - The S3 bucket to write the parquet files to. * **Databricks host** - The hostname for the Databricks instance, for example `xx.x.gcp.databricks.com`. * **Batch settings** - These settings control the size of the Parquet files written to S3. Forward assignment data to a Pub/Sub topic. ### Required GCP Roles * Pub/Sub Editor ### Configuration * **Event Type** - The Event type to export to the stream * **Project** - The GCP project that the topic exists in. * **Service account** - A GCP service account that has publish permissions to the configured topic and that you've configured so that the Confidence service account can impersonate this account. * **Topic** - The name of the topic * **Output format** - if the connector should write events in JSON or Protobuf binary format. Regardless of the format chosen, it wraps the event in a [CloudEvents](https://cloudevents.io/) envelope. Forward assignment data to a Kinesis stream. ### Required AWS Permissions * `kinesis:PutRecord` * `kinesis:PutRecords` * `kinesis:PutRecordBatch` * `kinesis:DescribeStream` ### Configuration * **Event Type** - The Event type to export to the stream * **Role ARN** - The ARN for the AWS role that has read and write access to the Kinesis stream. * **Region** - The AWS region the Kinesis stream exists in * **Stream** - The Kinesis stream name. * **Output format** - if the connector should write events in JSON or Protobuf binary format. Regardless of the format chosen, the connector wraps the event in a [CloudEvents](https://cloudevents.io/) envelope. # Platform Connectors Source: https://confidence-auth-testing.mintlify.io/docs/api/how-to-guides/connectors/platform Forward internal events from Confidence to your system. Platform connectors forward internal events to your system. The events could, for example, be `MetricCalculationCompleted` or `WorkflowInstanceCreated`. Export platform events of a configurable type to a Google Pub/Sub topic. ### Required GCP Roles * Pub/Sub Editor ### Configuration * **Event Type** - The Event type to export to the stream * **Project** - The GCP project that the topic exists in. * **Service account** - A GCP service account that has publish permissions to the configured topic. Configure the account so that the Confidence service account can impersonate it. * **Topic** - The name of the topic * **Output format** - If the connector should write the events in JSON or Protobuf binary format. Regardless of the format chosen, the connector wraps the event in a [CloudEvents](https://cloudevents.io/) envelope. Export platform events of a configurable type to a Kinesis stream. ### Required AWS Permissions * `kinesis:PutRecord` * `kinesis:PutRecords` * `kinesis:PutRecordBatch` * `kinesis:DescribeStream` ### Configuration * **Event Type** - The Event type to export to the stream * **Role ARN** - The ARN for the AWS Role that has read and write access to the Kinesis stream. * **Region** - The AWS region the Kinesis stream exists in * **Stream** - The Kinesis stream name. * **Output format** - If the connector should write the events in JSON or Protobuf binary format. Regardless of the format chosen, the connector wraps the event in a [CloudEvents](https://cloudevents.io/) envelope. # Manage A/B Tests Source: https://confidence-auth-testing.mintlify.io/docs/api/how-to-guides/experiments/manage-abtests Learn how to create and manage A/B tests using the Confidence API. Use this API to create and manage A/B tests. For an introduction to A/B testing concepts, see the [A/B test workflows documentation](/docs/experiments/workflows/abtests). All requests require a bearer token in the `Authorization` header. See [Get Started with Confidence APIs](/docs/api/quickstart) for how to obtain one using your client ID and secret. ## Get an A/B Test Retrieve a specific A/B test by its name to view its configuration and current state. ```bash theme={null} curl -X GET "https://experiments.confidence.dev/v1/workflows/abtest/instances/dwimxjvyjsfno42agkl8" \ -H "Authorization: Bearer $TOKEN" ``` Response: ```json theme={null} { "name": "workflows/abtest/instances/dwimxjvyjsfno42agkl8", "displayName": "Checkout Flow Experiment", "owner": "identities/cc9yglwi8kpgh0glddnkz", "state": "live" } ``` ## List A/B Tests List all A/B tests in your account. You can filter by state or any other criteria in the response. Use `nextPageToken` for getting the next page of results. ```bash theme={null} curl -X GET "https://experiments.confidence.dev/v1/workflows/abtest/instances?pageSize=50&filter=state:live" \ -H "Authorization: Bearer $TOKEN" ``` Response: ```json theme={null} { "abtests": [ { "name": "workflows/abtest/instances/dwimxjvyjsfno42agkl8", "displayName": "Checkout Flow Experiment", "state": "live" }, { "name": "workflows/abtest/instances/eioavdylbf9idlembel5", "displayName": "Pricing Page Test", "state": "live" } ], "nextPageToken": "" } ``` ## Create an A/B Test Create a new A/B test with treatments and metrics configuration. ```bash theme={null} curl -X POST "https://experiments.confidence.dev/v1/workflows/abtest" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "displayName": "Checkout Flow Experiment", "flags": { "targetingKeySelector": "targeting_key" }, "stats": { "testHorizonStrategy": "SEQUENTIAL" }, "abtest": { "treatments": [ { "variant": "flags/checkout-flag/variants/control", "weight": "5000" }, { "variant": "flags/checkout-flag/variants/new-checkout", "weight": "5000" } ] }, "metrics": { "assignmentTable": "assignmentTables/my-assignment-table", "entity": "entities/user", "bucket": "DAYS", "metrics": [ { "metric": "metrics/conversion-rate", "metricRole": { "metricKind": "SUCCESS", "minimumDetectableEffect": 0.01 }, "preferredDirection": "INCREASE" } ] } }' ``` Response: ```json theme={null} { "name": "workflows/abtest/instances/checkout-experiment", "displayName": "Checkout Flow Experiment", "state": "draft", "createTime": "2025-11-01T10:00:00Z", "updateTime": "2025-11-01T10:00:00Z" } ``` ## Create an A/B Test with Exposure Filters You can create an A/B test with exposure filters to segment your analysis by different user behaviors or contexts. ```bash theme={null} curl -X POST "https://experiments.confidence.dev/v1/workflows/abtest" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "displayName": "A/B test with exposure filter", "flags": { "targetingKeySelector": "targeting_key" }, "stats": { "testHorizonStrategy": "SEQUENTIAL" }, "abtest": { "treatments": [ { "variant": "flags/page-feature-flag/variants/control", "weight": "5000" }, { "variant": "flags/page-feature-flag/variants/variant", "weight": "5000" } ] }, "metrics": { "assignmentTable": "assignmentTables/my-assignment-table", "entity": "entities/user", "bucket": "HOURS", "filters": [ { "displayName": "home", "filter": { "criteria": { "page-1": { "attribute": { "attribute": "page", "eqRule": { "value": { "stringValue": "home" } } } } }, "expression": { "and": { "operands": [{"ref": "page-1"}] } } }, "factTable": "factTables/my-fact-table" } ], "metrics": [ { "metric": "metrics/conversion-rate", "metricRole": { "metricKind": "SUCCESS", "minimumDetectableEffect": 0.01 }, "preferredDirection": "INCREASE" } ] } }' ``` Response: ```json theme={null} { "name": "workflows/abtest/instances/eioavdylbf9idlembel5", "displayName": "A/B test with exposure filter", "state": "draft", "createTime": "2025-11-13T10:00:00Z", "updateTime": "2025-11-13T10:00:00Z" } ``` ## Set Targeting on an A/B Test After creating an A/B test, call the `UpdateSegment` action with the desired targeting configuration. Include the `updateMask` field relative to `segment`. ```bash theme={null} curl -X POST "https://experiments.confidence.dev/v1/workflows/abtest/instances/pinxh4k3ekqmr2fltek0:updateSegment" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "parameters": { "updateMask": "targeting", "segment": { "name": "segments/pztjlarivt3tyfie5gsb", "targeting": { "criteria": { "country": { "attribute": { "attributeName": "country", "eqRule": { "value": { "stringValue": "SE" } } } } }, "expression": { "and": { "operands": [{"ref": "country"}] } } } } } }' ``` ## Update Allocation on an A/B Test Call the `UpdateSegment` action with the allocation proportion to update the traffic allocation for an A/B test. ```bash theme={null} curl -X POST "https://experiments.confidence.dev/v1/workflows/abtest/instances/pinxh4k3ekqmr2fltek0:updateSegment" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "parameters": { "updateMask": "allocation", "segment": { "name": "segments/pztjlarivt3tyfie5gsb", "allocation": { "proportion": { "value": "0.5" } } } } }' ``` ## Action Methods Action methods return immediately with an empty result and start the action in the background. Use the `GET` endpoint for the A/B test to monitor the progress by inspecting the `pendingTransition` field. ### Launch an A/B Test ```bash theme={null} curl -X POST "https://experiments.confidence.dev/v1/workflows/abtest/instances/dwimxjvyjsfno42agkl8:launch" \ -H "Authorization: Bearer $TOKEN" ``` ### End an A/B Test ```bash theme={null} curl -X POST "https://experiments.confidence.dev/v1/workflows/abtest/instances/dwimxjvyjsfno42agkl8:end" \ -H "Authorization: Bearer $TOKEN" ``` ### Archive an A/B Test ```bash theme={null} curl -X POST "https://experiments.confidence.dev/v1/workflows/abtest/instances/dwimxjvyjsfno42agkl8:archive" \ -H "Authorization: Bearer $TOKEN" ``` ## View Results for an A/B Test To view statistical results for your A/B test, use a two-step process. ### Step 1: Get the A/B Test First, get the A/B test to retrieve the `analysisResult` resource name from the `stats` field. ```bash theme={null} curl -X GET "https://experiments.confidence.dev/v1/workflows/abtest/instances/dwimxjvyjsfno42agkl8" \ -H "Authorization: Bearer $TOKEN" ``` Response: ```json theme={null} { "name": "workflows/abtest/instances/dwimxjvyjsfno42agkl8", "displayName": "Checkout Flow Experiment", "stats": { "analysisResult": "workflows/abtest/instances/dwimxjvyjsfno42agkl8/analysisResults/abc123" } } ``` If your A/B test uses multiple exposure filters, check the `stats.analysisResults[]` array instead. Each entry has an `analysisResult` resource name and the corresponding `exposureFilterName`. ### Step 2: Get the Analysis Result Use the `analysisResult` name from Step 1 to fetch the full statistical analysis from the [Analysis Results API](/api-reference/get-analysisresult). ```bash theme={null} curl -X GET "https://stats.confidence.dev/v2/workflows/abtest/instances/dwimxjvyjsfno42agkl8/analysisResults/abc123" \ -H "Authorization: Bearer $TOKEN" ``` Response: ```json theme={null} { "name": "workflows/abtest/instances/dwimxjvyjsfno42agkl8/analysisResults/abc123", "exposureFilter": "", "annotations": [ { "context": "OVERALL", "info": ["Analysis completed successfully"] } ], "results": [ { "id": "metrics/conversion-rate", "statsSettings": { "method": "METHOD_Z_TEST", "adjustedAlpha": 0.05 }, "result": { "status": { "status": "METRIC_RESULT_STATUS_SIGNIFICANT_POSITIVE", "metricType": "METRIC_TYPE_SUCCESS" } } } ] } ``` # Manage Rollouts Source: https://confidence-auth-testing.mintlify.io/docs/api/how-to-guides/experiments/manage-rollouts Learn how to create and manage rollouts using the Confidence API. Use this API to create and manage Rollouts. For an introduction to rollout concepts, see the [rollout workflows documentation](/docs/experiments/workflows/rollouts). ## Get a Rollout Retrieve a specific rollout by its name to view its configuration and current state. ```bash theme={null} curl -X GET "https://experiments.confidence.dev/v1/workflows/rollout/instances/brcdajvw7dfuod7cj9iq" \ -H "Authorization: Bearer $TOKEN" ``` Response: ```json theme={null} { "name": "workflows/rollout/instances/brcdajvw7dfuod7cj9iq", "displayName": "New Search Feature Rollout", "createTime": "2024-01-15T10:00:00Z", "updateTime": "2024-01-20T14:30:00Z" } ``` ## List Rollouts List all rollouts in your account. You can filter by state or any other criteria in the response. Use `nextPageToken` for getting the next page of results. ```bash theme={null} curl -X GET "https://experiments.confidence.dev/v1/workflows/rollout/instances?pageSize=50&filter=state:live" \ -H "Authorization: Bearer $TOKEN" ``` Response: ```json theme={null} { "rollouts": [ { "name": "workflows/rollout/instances/brcdajvw7dfuod7cj9iq", "displayName": "New Search Feature Rollout", "state": "live" }, { "name": "workflows/rollout/instances/bnkv2onacdpvxk8cmqbm", "displayName": "Mobile UI Update", "state": "live" } ], "nextPageToken": "" } ``` ## Create a Rollout Create a new rollout with initial exposure settings. ```bash theme={null} curl -X POST "https://experiments.confidence.dev/v1/workflows/rollout/instances" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "displayName": "New Search Feature Rollout", "flags": { "targetingKeySelector": "targeting_key" }, "rollout": { "flag": "flags/search-flag", "variant": "flags/search-flag/variants/enabled" }, "metrics": { "assignmentTable": "assignmentTables/my-assignment-table", "entity": "entities/user", "bucket": "DAYS", "metrics": [ { "metric": "metrics/conversion-rate", "metricRole": { "metricKind": "SUCCESS", "minimumDetectableEffect": 0.01 }, "preferredDirection": "INCREASE" } ] } }' ``` Response: ```json theme={null} { "name": "rollouts/new-search-feature", "displayName": "New Search Feature Rollout", "state": "draft", "createTime": "2024-01-15T10:00:00Z", "updateTime": "2024-01-15T10:00:00Z" } ``` ## Set Targeting on a Rollout After creating a rollout, call the `UpdateSegment` action with the desired targeting configuration. Include the `updateMask` field relative to `segment`. ```bash theme={null} curl -X POST "https://experiments.confidence.dev/v1/workflows/rollout/instances/brcdajvw7dfuod7cj9iq:updateSegment" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "updateMask": "targeting", "segment": { "name": "segments/pztjlarivt3tyfie5gsb", "targeting": { "criteria": { "country": { "attribute": { "attributeName": "country", "eqRule": { "value": { "stringValue": "SE" } } } } }, "expression": { "and": { "operands": [{"ref": "country"}] } } } } }' ``` ## Action Methods Action methods return immediately with an empty result and start the action in the background. Use the `GET` endpoint for the rollout to monitor the progress by inspecting the `pendingTransition` field. ### Launch a Rollout ```bash theme={null} curl -X POST "https://experiments.confidence.dev/v1/workflows/rollout/instances/brcdajvw7dfuod7cj9iq:launch" \ -H "Authorization: Bearer $TOKEN" ``` ### Increase Reach Update the rollout to increase the reach (percentage of users exposed to the feature). ```bash theme={null} curl -X PATCH "https://experiments.confidence.dev/v1/workflows/rollout/instances/brcdajvw7dfuod7cj9iq?updateMask=rollout" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "rollout": { "flag": "flags/search-flag", "reach": "0.5", "variant": "flags/search-flag/variants/enabled" } }' ``` Response: ```json theme={null} { "name": "rollouts/new-search-feature", "displayName": "New Search Feature Rollout" } ``` ## View Results for a Rollout To view statistical results for your rollout, use a two-step process. ### Step 1: Get the Rollout First, get the rollout to retrieve the `analysisResult` resource name from the `stats` field. ```bash theme={null} curl -X GET "https://experiments.confidence.dev/v1/workflows/rollout/instances/brcdajvw7dfuod7cj9iq" \ -H "Authorization: Bearer $TOKEN" ``` Response: ```json theme={null} { "name": "workflows/rollout/instances/brcdajvw7dfuod7cj9iq", "displayName": "New Search Feature Rollout", "stats": { "analysisResult": "workflows/rollout/instances/brcdajvw7dfuod7cj9iq/analysisResults/abc123" } } ``` If your rollout uses multiple exposure filters, check the `stats.analysisResults[]` array instead. Each entry has an `analysisResult` resource name and the corresponding `exposureFilterName`. ### Step 2: Get the Analysis Result Use the `analysisResult` name from Step 1 to fetch the full statistical analysis from the [Analysis Results API](/api-reference/get-analysisresult). ```bash theme={null} curl -X GET "https://stats.confidence.dev/v2/workflows/rollout/instances/brcdajvw7dfuod7cj9iq/analysisResults/abc123" \ -H "Authorization: Bearer $TOKEN" ``` Response: ```json theme={null} { "name": "workflows/rollout/instances/brcdajvw7dfuod7cj9iq/analysisResults/abc123", "exposureFilter": "", "annotations": [ { "context": "OVERALL", "info": ["Analysis completed successfully"] } ], "results": [ { "id": "metrics/conversion-rate", "statsSettings": { "method": "METHOD_Z_TEST", "adjustedAlpha": 0.05 }, "result": { "status": { "status": "METRIC_RESULT_STATUS_SIGNIFICANT_POSITIVE", "metricType": "METRIC_TYPE_SUCCESS" } } } ] } ``` # Apply Flags Source: https://confidence-auth-testing.mintlify.io/docs/api/how-to-guides/flags/apply-flags Learn how to track flag usage by applying flags. Report when your application uses flags by applying them. See [Apply a Flag](../../flags/resolution-reference#apply-a-flag) in the reference for details on why applies matter, when to apply, batching strategies, and best practices. ## Before You Begin Before applying flags, you must: 1. [Resolve flags](./resolve-flags) to get variant values and a resolve token 2. Save the `resolveToken` from the resolve response 3. Use the flag value in your application ## Apply a Single Flag Report that a flag was applied: ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/flags:apply" \ -H "Content-Type: application/json" \ -d '{ "clientSecret": "YOUR_CLIENT_SECRET", "resolveToken": "", "flags": [ { "flag": "flags/image-size", "appliedTime": "2023-03-06T19:45:07.436Z", "sentTime": "2023-03-06T19:45:08.002Z" } ] }' ``` ## Apply Multiple Flags Batch multiple applies together (recommended): ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/flags:apply" \ -H "Content-Type: application/json" \ -d '{ "clientSecret": "YOUR_CLIENT_SECRET", "resolveToken": "", "flags": [ { "flag": "flags/image-size", "appliedTime": "2023-03-06T19:45:07.436Z", "sentTime": "2023-03-06T19:45:08.002Z" }, { "flag": "flags/button-colors", "appliedTime": "2023-03-06T19:45:09.123Z", "sentTime": "2023-03-06T19:45:10.002Z" } ] }' ``` ## Complete Workflow Here's the full workflow from resolve to apply: ```bash theme={null} # Step 1: Resolve flags RESPONSE=$(curl -X POST "https://flags.confidence.dev/v1/flags:resolve" \ -H "Content-Type: application/json" \ -d '{ "clientSecret": "YOUR_CLIENT_SECRET", "evaluationContext": { "user_id": "user123" } }') # Step 2: Extract resolve token RESOLVE_TOKEN=$(echo $RESPONSE | jq -r '.resolveToken') # Step 3: Use flag values in your application # (Your application code here) # Step 4: Report that flags were applied curl -X POST "https://flags.confidence.dev/v1/flags:apply" \ -H "Content-Type: application/json" \ -d "{ \"clientSecret\": \"YOUR_CLIENT_SECRET\", \"resolveToken\": \"$RESOLVE_TOKEN\", \"flags\": [ { \"flag\": \"flags/my-flag\", \"appliedTime\": \"$(date -u +"%Y-%m-%dT%H:%M:%S.%3NZ")\", \"sentTime\": \"$(date -u +"%Y-%m-%dT%H:%M:%S.%3NZ")\" } ] }" ``` ## Next Steps After applying flags: 1. Monitor flag applied data in your data warehouse 2. Use the data to analyze experiments 3. Review apply patterns to optimize flag usage # Archive Flags and Segments Source: https://confidence-auth-testing.mintlify.io/docs/api/how-to-guides/flags/archive-flag Learn how to archive flags and segments when they're no longer needed. Archive flags and segments when they're no longer needed instead of deleting them. See [Archiving Flags](/docs/flags/create-flags#archiving-flags) in the reference for details on what happens when you archive, when to archive, and best practices. ## Archive a Flag Archive a flag that's no longer needed: ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/flags/example-flag:archive" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` ## Archive a Segment Archive a segment that's no longer needed: ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/segments/my-segment:archive" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` ## Verify Archive Status Check if a flag is archived: ```bash theme={null} curl -X GET "https://flags.confidence.dev/v1/flags/example-flag" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` The response includes an `archived` field set to `true`. ## Archive Multiple Resources Archive multiple flags or segments in sequence: ```bash theme={null} #!/bin/bash # Archive multiple flags for flag in "old-feature" "test-flag" "deprecated-config"; do curl -X POST "https://flags.confidence.dev/v1/flags/$flag:archive" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" echo "Archived flag: $flag" done # Archive multiple segments for segment in "experiment-1" "experiment-2" "test-segment"; do curl -X POST "https://flags.confidence.dev/v1/segments/$segment:archive" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" echo "Archived segment: $segment" done ``` ## Find Archival Candidates List all flags to find archival candidates: ```bash theme={null} curl -X GET "https://flags.confidence.dev/v1/flags" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` List all segments to find archival candidates: ```bash theme={null} curl -X GET "https://flags.confidence.dev/v1/segments" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` ## Next Steps After archiving resources: 1. Remove feature flag code from your application 2. Update documentation to reflect production behavior 3. Review analytics from the archived experiment 4. Plan next experiments based on learnings # Coordinate Segments Source: https://confidence-auth-testing.mintlify.io/docs/api/how-to-guides/flags/coordinate-segments Learn how to make segments mutually exclusive using coordination tags. Use coordination to make segments mutually exclusive, ensuring users can only be in one experiment at a time. See [Coordination](../../flags/segments-reference#coordination) in the reference for details on how coordination works, common patterns, and best practices. ## Set Up Basic Coordination Create segments that exclude each other using matching tags: ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/segments?segmentId=ranking-exp-1" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "displayName": "Ranking Experiment 1", "targeting": {}, "allocation": { "proportion": {"value": "0.1"}, "exclusivityTags": ["ranking"], "exclusiveTo": ["ranking"] } }' ``` Create a second segment with the same coordination: ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/segments?segmentId=ranking-exp-2" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "displayName": "Ranking Experiment 2", "targeting": {}, "allocation": { "proportion": {"value": "0.1"}, "exclusivityTags": ["ranking"], "exclusiveTo": ["ranking"] } }' ``` These segments are now mutually exclusive—no user can be in both. ## Coordinate Across Multiple Groups Exclude a segment from multiple coordination groups: ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/segments?segmentId=mixed-experiment" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "displayName": "Mixed Experiment", "targeting": {}, "allocation": { "proportion": {"value": "0.05"}, "exclusivityTags": ["search"], "exclusiveTo": ["search", "ranking", "mixer"] } }' ``` This segment doesn't overlap with any segment that has `search`, `ranking`, or `mixer` as exclusivity tags. ## Update Coordination Tags Change coordination tags on an existing segment: ```bash theme={null} curl -X PATCH "https://flags.confidence.dev/v1/segments/ranking-exp-1?updateMask=allocation.exclusivityTags,allocation.exclusiveTo" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "allocation": { "exclusivityTags": ["ranking", "search"], "exclusiveTo": ["ranking", "search", "mixer"] } }' ``` Changing coordination tags on an allocated segment may require re-allocating it, which can affect which users are in the segment. ## Allocate with Coordination Allocate a segment with coordination tags: ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/segments/ranking-exp-1:allocate" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` If successful, the segment is allocated and guaranteed to be mutually exclusive with coordinating segments. If allocation fails due to insufficient space: * Reduce the allocation proportion * Archive some existing segments * Change coordination tags ## Check Available Space List all segments to check available space in a coordination group: ```bash theme={null} curl -X GET "https://flags.confidence.dev/v1/segments" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` Filter the results for segments with overlapping coordination tags and sum their allocation proportions to see how much space the segments use. ## Next Steps After setting up coordination: 1. [Create flag rules](./create-flag-rule) to use your coordinated segments 2. [Allocate segments](./create-segment#allocate-a-segment) to activate them 3. [Resolve flags](./resolve-flags) to test your coordination logic # Create a Flag Source: https://confidence-auth-testing.mintlify.io/docs/api/how-to-guides/flags/create-flag Learn how to create a flag using the Confidence API. You identify flags by a string called the flag key. This key is unique within the account. All you have to do to create a new flag is specify the flag key using the `flagId` query parameter. ## Create a Basic Flag To create a flag with just a flag key: ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/flags?flagId=example-flag" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" ``` Use a name that is understandable and memorable. For example, `new-navbar`. Avoid too long names, and don't include the configuration in the name itself. For example, don't use `new-navbar-mobile-experience` or `new-navbar-enabled` as the flag name. ## Create a Flag with Clients You can associate the flag with clients when creating it to control which applications can resolve it: ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/flags?flagId=example-flag" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "clients": ["clients/my-client"] }' ``` Not all clients should have access to all flags. Associate a flag with as few clients as possible to: * Limit the number of resolved flags in batch operations * Reduce network payload and costs * Prevent sensitive flags from being available in untrusted environments (like mobile apps) ## Retrieve a Flag To retrieve an existing flag and see its configuration: ```bash theme={null} curl -X GET "https://flags.confidence.dev/v1/flags/example-flag" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` ## Associate with Additional Clients You can add more clients to a flag after creation using the `addFlagClient` operation: ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/flags/example-flag:addFlagClient" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "client": "clients/another-client" }' ``` Or update the entire list of clients using the PATCH operation: ```bash theme={null} curl -X PATCH "https://flags.confidence.dev/v1/flags/example-flag?updateMask=clients" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "clients": ["clients/my-client", "clients/another-client"] }' ``` ## Next Steps After creating a flag: 1. [Define the flag schema](./define-flag-schema) 2. [Create variants](./create-flag-variants) 3. [Set up flag clients](./setup-flag-clients) if you haven't already 4. [Create segments and rules](./create-segment) to control who sees what 5. [Resolve the flag](./resolve-flags) in your application # Create Flag Rules Source: https://confidence-auth-testing.mintlify.io/docs/api/how-to-guides/flags/create-flag-rule Learn how to create rules that assign variants to users based on segments. Create rules to assign variants to users in a segment. See [Rules](/docs/flags/define-rules) and [Variant Assignment](/docs/flags/define-rules#general-rules) in the reference for details on how rules work, assignment types, and best practices. ## Before You Begin Before creating a rule, you need: 1. A flag with a defined [schema](./define-flag-schema) and [variants](./create-flag-variants) 2. An [allocated segment](./create-segment) that defines your target audience ## Create a Basic Rule Assign all users in a segment to a single variant: ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/flags/example-flag/rules" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "segment": "segments/all-users", "assignmentSpec": { "bucketCount": 100, "assignments": [ { "variant": { "variant": "flags/example-flag/variants/enabled" }, "bucketRanges": [{"lower": 0, "upper": 100}] } ] }, "targetingKeySelector": "user_id" }' ``` ## Create an A/B Test Rule Randomly assign users to control or treatment (50/50 split): ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/flags/example-flag/rules" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "segment": "segments/experiment-segment", "assignmentSpec": { "bucketCount": 100, "assignments": [ { "variant": { "variant": "flags/example-flag/variants/control" }, "bucketRanges": [{"lower": 0, "upper": 50}] }, { "variant": { "variant": "flags/example-flag/variants/treatment" }, "bucketRanges": [{"lower": 50, "upper": 100}] } ] }, "targetingKeySelector": "user_id" }' ``` ## Create a Multi-Variant Rule Assign users across three variants (40/30/30 split): ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/flags/example-flag/rules" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "segment": "segments/multivariate-test", "assignmentSpec": { "bucketCount": 100, "assignments": [ { "variant": {"variant": "flags/example-flag/variants/option-a"}, "bucketRanges": [{"lower": 0, "upper": 40}] }, { "variant": {"variant": "flags/example-flag/variants/option-b"}, "bucketRanges": [{"lower": 40, "upper": 70}] }, { "variant": {"variant": "flags/example-flag/variants/option-c"}, "bucketRanges": [{"lower": 70, "upper": 100}] } ] }, "targetingKeySelector": "user_id" }' ``` ## Create a Fall-Through Rule Create a rule that matches but passes to the next rule: ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/flags/example-flag/rules" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "segment": "segments/logging-segment", "assignmentSpec": { "bucketCount": 100, "assignments": [ { "fallthrough": {}, "bucketRanges": [{"lower": 0, "upper": 100}] } ] }, "targetingKeySelector": "user_id" }' ``` ## Create a Client Default Rule Assign users to their client-specified default values: ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/flags/example-flag/rules" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "segment": "segments/default-segment", "assignmentSpec": { "bucketCount": 100, "assignments": [ { "clientDefault": {}, "bucketRanges": [{"lower": 0, "upper": 100}] } ] }, "targetingKeySelector": "user_id" }' ``` ## Enable a Rule Newly created rules start disabled. Enable a rule to activate it: ```bash theme={null} curl -X PATCH "https://flags.confidence.dev/v1/flags/example-flag/rules/RULE_ID?updateMask=enabled" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "enabled": true }' ``` ## Update a Rule Change variant assignments or the segment: ```bash theme={null} curl -X PATCH "https://flags.confidence.dev/v1/flags/example-flag/rules/RULE_ID?updateMask=assignmentSpec" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "assignmentSpec": { "bucketCount": 100, "assignments": [ { "variant": {"variant": "flags/example-flag/variants/control"}, "bucketRanges": [{"lower": 0, "upper": 30}] }, { "variant": {"variant": "flags/example-flag/variants/treatment"}, "bucketRanges": [{"lower": 30, "upper": 100}] } ] } }' ``` ## Reorder Rules Change rule evaluation order by updating priority (lower numbers evaluate first): ```bash theme={null} curl -X PATCH "https://flags.confidence.dev/v1/flags/example-flag/rules/RULE_ID?updateMask=priority" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "priority": 1 }' ``` ## Delete a Rule Remove a rule from a flag: ```bash theme={null} curl -X DELETE "https://flags.confidence.dev/v1/flags/example-flag/rules/RULE_ID" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` ## Use a Custom Targeting Key Specify a different field for randomization (for example, device instead of user): ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/flags/example-flag/rules" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "segment": "segments/all-users", "assignmentSpec": { "bucketCount": 100, "assignments": [ { "variant": {"variant": "flags/example-flag/variants/enabled"}, "bucketRanges": [{"lower": 0, "upper": 100}] } ] }, "targetingKeySelector": "device_id" }' ``` ## Next Steps After creating rules: 1. [Resolve flags](./resolve-flags) to test your rules with different evaluation contexts 2. [Apply flags](./apply-flags) to track which users see which variants 3. Monitor your experiments and adjust rules as needed # Create Flag Variants Source: https://confidence-auth-testing.mintlify.io/docs/api/how-to-guides/flags/create-flag-variants Learn how to create and manage flag variants. Create variants to define the different values a flag can return. ## Create a Control Variant ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/flags/example-flag/variants" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "flags/example-flag/variants/control", "value": { "enabled": false, "color": "blue", "size": 10 }, "description": "Control variant" }' ``` ## Create a Treatment Variant ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/flags/example-flag/variants" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "flags/example-flag/variants/treatment", "value": { "enabled": true, "color": "red", "size": 20 }, "description": "Treatment variant" }' ``` Variant values don't need to include all schema fields - only set the fields you need. ## Create More Variants For multi-variant tests, create as many variants as needed: ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/flags/example-flag/variants" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "flags/example-flag/variants/option-c", "value": { "enabled": true, "color": "green", "size": 15 }, "description": "Third variant" }' ``` ## Update a Variant Change an existing variant's value or description: ```bash theme={null} curl -X PATCH "https://flags.confidence.dev/v1/flags/example-flag/variants/control?updateMask=value,description" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "value": { "enabled": false, "color": "navy", "size": 12 }, "description": "Updated control variant" }' ``` ## List All Variants Get all variants for a flag: ```bash theme={null} curl -X GET "https://flags.confidence.dev/v1/flags/example-flag/variants" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` ## Get a Specific Variant Retrieve a single variant: ```bash theme={null} curl -X GET "https://flags.confidence.dev/v1/flags/example-flag/variants/control" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` ## Next Steps After creating variants: 1. [Create segments](./create-segment) to target audiences 2. [Create rules](./create-flag-rule) to assign variants to segments 3. [Resolve flags](./resolve-flags) to get variant values # Create Materialized Segments Source: https://confidence-auth-testing.mintlify.io/docs/api/how-to-guides/flags/create-materialized-segment Learn how to create materialized segments that load units from BigQuery. A materialized segment is a segment that loads its list of units from your BigQuery instance using a SQL query. Materialized segments are only available for BigQuery. ## Create a Materialized Segment To create a materialized segment: ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/materializedSegments?materializationId=my-mat-segment" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "materializedSegment": { "displayName": "My Materialized Segment" } }' ``` ## Create a Load Job After creating the segment, create a load job to populate it with data from your SQL query: ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/materializedSegments/my-mat-segment/loadJobs" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "materializedSegmentJob": { "entityIdColumn": "user_id", "sql": "SELECT user_id FROM your_dataset.your_table WHERE your_criteria" } }' ``` The `entityIdColumn` specifies which column in your query results contains the entity IDs to include in the segment. ## Get a Materialized Segment To retrieve a materialized segment's configuration: ```bash theme={null} curl -X GET "https://flags.confidence.dev/v1/materializedSegments/my-mat-segment" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` ## List Load Jobs To see the load jobs for a materialized segment: ```bash theme={null} curl -X GET "https://flags.confidence.dev/v1/materializedSegments/my-mat-segment/loadJobs" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` ## Delete a Materialized Segment To delete a materialized segment: ```bash theme={null} curl -X DELETE "https://flags.confidence.dev/v1/materializedSegments/my-mat-segment" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` ## Next Steps After creating materialized segments: 1. Use the segment in [flag rules](./create-flag-rule) to target specific users 2. Set up [coordination](./coordinate-segments) to make segments mutually exclusive # Create Segments Source: https://confidence-auth-testing.mintlify.io/docs/api/how-to-guides/flags/create-segment Learn how to create segments to define target audiences. A segment is a cohort of users. Targeting and allocation define the cohort: * **Targeting**: A set of criteria that filter users based on attributes * **Allocation**: What percentage (0% to 100%) of the targeted users should be in the segment Confidence makes no assumptions about the entity that you target or randomize on. Usually, the entity is a type of user (represented by an identifier). Because of this, the examples on this page involve users. Your unit could be something else. ## Create a Basic Segment To create a segment that targets 100% of all users: ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/segments?segmentId=all-users" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "displayName": "All Users", "targeting": {}, "allocation": { "proportion": { "value": "1.0" } } }' ``` ## Create a Segment with Targeting To create a segment that targets users from Sweden with 10% allocation: ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/segments?segmentId=sweden-10pct" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "displayName": "10% of users from Sweden", "targeting": { "criteria": { "sweden": { "attribute": { "attributeName": "country", "eqRule": { "value": { "stringValue": "SE" } } } } }, "expression": { "ref": "sweden" } }, "allocation": { "proportion": { "value": "0.1" } } }' ``` ## Set the Randomization Unit By default, Confidence randomizes based on the `targeting_key` field in the evaluation context. You can specify a different field using `targetingKeySelector`: ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/segments?segmentId=device-based" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "displayName": "Device-based segment", "targeting": {}, "allocation": { "proportion": { "value": "0.5" }, "targetingKeySelector": "device_id" } }' ``` If the randomization field is missing from the evaluation context or is `null`, the segment doesn't match. The empty string (`""`) is a valid value for randomization. ## Allocate a Segment Segments start in an `UNALLOCATED` state. To use a segment in a flag rule, you must first allocate it: ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/segments/sweden-10pct:allocate" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` When coordinating with other segments, the allocation operation may fail if there's not enough space to make the segment mutually exclusive with overlapping segments. See [Coordinate Segments](./coordinate-segments) for more details. ## Get a Segment To retrieve a segment's configuration: ```bash theme={null} curl -X GET "https://flags.confidence.dev/v1/segments/sweden-10pct" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` ## Update a Segment You can update a segment's targeting or allocation using the PATCH endpoint: ```bash theme={null} curl -X PATCH "https://flags.confidence.dev/v1/segments/sweden-10pct?updateMask=allocation.proportion" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "allocation": { "proportion": { "value": "0.2" } } }' ``` Updating an allocated segment may require re-allocating it. Make changes carefully to avoid disrupting active experiments. ## Archive a Segment When a segment is no longer needed, archive it: ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/segments/sweden-10pct:archive" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` You can no longer use archived segments in new rules, but existing rules continue to work. ## Next Steps After creating segments: 1. [Add targeting criteria](./target-with-criteria) for more sophisticated audience targeting 2. [Set up coordination](./coordinate-segments) to make segments mutually exclusive 3. [Create flag rules](./create-flag-rule) to assign variants to segments # Define a Flag Schema Source: https://confidence-auth-testing.mintlify.io/docs/api/how-to-guides/flags/define-flag-schema Learn how to define the schema for a flag. After creating a flag, define its schema to specify what fields the flag value can contain. ## Define the Schema Set the schema on your flag: ```bash theme={null} curl -X PATCH "https://flags.confidence.dev/v1/flags/example-flag?updateMask=schema" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "schema": { "schema": { "enabled": { "boolSchema": {} }, "color": { "stringSchema": {} }, "size": { "intSchema": {} } } } }' ``` Available schema types: `boolSchema`, `stringSchema`, `intSchema`, `doubleSchema`, `listSchema`, `structSchema`. See [Variants](../../flags/concepts#variants) for details on how schemas work. ## Add Fields to an Existing Schema To add new fields, include them in the schema: ```bash theme={null} curl -X PATCH "https://flags.confidence.dev/v1/flags/example-flag?updateMask=schema" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "schema": { "schema": { "enabled": { "boolSchema": {} }, "color": { "stringSchema": {} }, "size": { "intSchema": {} }, "opacity": { "doubleSchema": {} } } } }' ``` ## Define a Nested Schema Use `structSchema` for nested fields: ```bash theme={null} curl -X PATCH "https://flags.confidence.dev/v1/flags/example-flag?updateMask=schema" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "schema": { "schema": { "button": { "structSchema": { "schema": { "color": { "stringSchema": {} }, "size": { "intSchema": {} } } } } } } }' ``` ## Define a List Schema Use `listSchema` for array fields: ```bash theme={null} curl -X PATCH "https://flags.confidence.dev/v1/flags/example-flag?updateMask=schema" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "schema": { "schema": { "colors": { "listSchema": { "elementSchema": { "stringSchema": {} } } } } } }' ``` ## Remove a Field To remove a field, first update all variants to remove that field, then update the schema: ```bash theme={null} curl -X PATCH "https://flags.confidence.dev/v1/flags/example-flag?updateMask=schema" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "schema": { "schema": { "enabled": { "boolSchema": {} }, "color": { "stringSchema": {} } } } }' ``` The request will fail if any variant still uses the field you're trying to remove. ## Next Steps After defining your schema: 1. [Create variants](./create-flag-variants) with values matching the schema 2. [Create segments](./create-segment) to target audiences 3. [Create rules](./create-flag-rule) to assign variants # Resolve Flags Source: https://confidence-auth-testing.mintlify.io/docs/api/how-to-guides/flags/resolve-flags Learn how to resolve flags to get variant values for users. Resolving flags means getting the value of a flag for a given evaluation context. The evaluation context contains information about the user, device, or other contextual data that Confidence uses to determine which variant to return. ## Before You Begin Before resolving flags, you need: 1. A [flag client with credentials](./setup-flag-clients) 2. Flags [associated with the client](./create-flag#associate-with-additional-clients) 3. [Rules defined](./create-flag-rule) on your flags While you can resolve flags directly using the API as shown here, the most efficient way is using one of the Confidence SDKs. The SDKs handle caching, batching, and other optimizations automatically. ## Authentication Resolve operations use client secrets for authentication, not Bearer tokens: ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/flags:resolve" \ -H "Content-Type: application/json" \ -d '{ "clientSecret": "YOUR_CLIENT_SECRET", "evaluationContext": { ... } }' ``` ## Evaluation Context The evaluation context specifies contextual data that Confidence uses to evaluate rules. It's a schema-less key-value map (JSON object) containing any data needed for rule evaluation, such as: * User identifiers * User attributes (country, age, plan level) * Device information (OS, model, browser) * Session data (URL, referrer, timestamp) Example evaluation context: ```json theme={null} { "user_id": "rosling", "country": "SE", "device": { "vendor": "apple", "os": "ios" } } ``` Do not pass sensitive data in the keys of the evaluation context. Values are never stored, but keys are temporarily stored to help derive the schema for targeting. ## Batch Resolve (Recommended) The recommended approach is to batch resolve all flags for a client. This returns values for all flags associated with the client: ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/flags:resolve" \ -H "Content-Type: application/json" \ -d '{ "clientSecret": "YOUR_CLIENT_SECRET", "evaluationContext": { "user_id": "rosling", "country": "SE", "device": { "vendor": "apple", "os": "ios" } } }' ``` Response: ```json theme={null} { "resolvedFlags": [ { "flag": "flags/button-colors", "variant": "", "value": {}, "flagSchema": { "schema": {} }, "reason": "RESOLVE_REASON_NO_SEGMENT_MATCH" }, { "flag": "flags/image-size", "variant": "flags/image-size/variants/control", "value": { "name": "costello", "img-size": 42 }, "flagSchema": { "schema": { "name": { "stringSchema": {} }, "img-size": { "intSchema": {} } } }, "reason": "RESOLVE_REASON_MATCH" } ], "resolveToken": "" } ``` Keep the `resolveToken` from the response. You'll need it when [applying flags](./apply-flags) to track usage. ## Resolve Specific Flags You can limit the resolve operation to specific flags using the `flags` parameter: ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/flags:resolve" \ -H "Content-Type: application/json" \ -d '{ "clientSecret": "YOUR_CLIENT_SECRET", "flags": ["flags/image-size", "flags/button-colors"], "evaluationContext": { "user_id": "rosling", "country": "SE" } }' ``` This returns only the specified flags, which can reduce response size and processing time. ## Understand Resolve Reasons Each resolved flag includes a `reason` field explaining why it resolved the way it did: | Reason | Description | | :-------------------------------- | :------------------------------------- | | `RESOLVE_REASON_MATCH` | A rule matched and assigned a variant | | `RESOLVE_REASON_NO_SEGMENT_MATCH` | No rule matched the evaluation context | | `RESOLVE_REASON_FLAG_ARCHIVED` | The flag is archived | | `RESOLVE_REASON_ERROR` | An error occurred during resolution | ## Test Resolve Logic To test your resolve logic with different evaluation contexts: 1. **Vary the context**: Try different user IDs, countries, device types 2. **Check reasons**: Look at the `reason` field to understand why each flag resolved as it did 3. **Verify variants**: Ensure the returned variants match your expectations 4. **Test edge cases**: Try missing fields, null values, unexpected data types Example testing different contexts: ```bash theme={null} # Test user from Sweden curl -X POST "https://flags.confidence.dev/v1/flags:resolve" \ -H "Content-Type: application/json" \ -d '{ "clientSecret": "YOUR_CLIENT_SECRET", "evaluationContext": { "user_id": "user123", "country": "SE" } }' # Test user from US curl -X POST "https://flags.confidence.dev/v1/flags:resolve" \ -H "Content-Type: application/json" \ -d '{ "clientSecret": "YOUR_CLIENT_SECRET", "evaluationContext": { "user_id": "user456", "country": "US" } }' ``` ## Handle No Match When no rule matches, the flag returns with `RESOLVE_REASON_NO_SEGMENT_MATCH` and empty values: ```json theme={null} { "flag": "flags/my-flag", "variant": "", "value": {}, "reason": "RESOLVE_REASON_NO_SEGMENT_MATCH" } ``` Your application should handle this case by: * Using a default value specified in your code * Falling back to the original behavior * Logging the no-match event for debugging ## Best Practices 1. **Batch resolve**: Always resolve all flags in one call to minimize network overhead 2. **Cache locally**: Cache resolved values to avoid repeated API calls 3. **Provide complete context**: Include all relevant fields that your targeting rules might use 4. **Handle failures gracefully**: Have fallback values if the resolve call fails 5. **Use consistent keys**: Ensure the `targeting_key` (or custom field) is stable for each user ## Next Steps After resolving flags: 1. Use the variant values in your application 2. [Apply the flags](./apply-flags) to track usage and enable experiment analysis 3. Monitor resolve patterns and optimize your rules as needed # Set Up Flag Clients Source: https://confidence-auth-testing.mintlify.io/docs/api/how-to-guides/flags/setup-flag-clients Learn how to create flag clients and manage their credentials. Clients resolve flags into values. A client could be a mobile app, website, or backend service. These clients often run in an untrusted environment and authenticate with a different mechanism than service APIs of Confidence. The calling client authenticates using a shared secret between the caller and Confidence. This secret, called "client secret," belongs to a client resource in Confidence. ## Create a Flag Client To create a client, provide a display name that identifies the application: ```bash theme={null} curl -X POST "https://iam.confidence.dev/v1/clients" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "displayName": "My client" }' ``` Response: ```json theme={null} { "name": "clients/1bhq4c2zqigdzqg6ufni", "displayName": "My client", "createTime": "2023-08-29T09:36:57.163017Z", "updateTime": "2023-08-29T09:36:57.163017Z" } ``` ## Create Client Credentials After creating a client, generate credentials (client secret) for authentication: ```bash theme={null} curl -X POST "https://iam.confidence.dev/v1/clients/1bhq4c2zqigdzqg6ufni/credentials" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" ``` Response: ```json theme={null} { "name": "clients/1bhq4c2zqigdzqg6ufni/credentials/abc123", "secret": "ZXhhbXBsZV9zZWNyZXRfa2V5X3RoYXRfeW91X3Nob3VsZF9rZWVwX3NhZmU", "createTime": "2023-08-29T09:40:12.456789Z" } ``` Make note of the client secret. It's only returned once, from the create operation. If you lose it, you have to create a new one. Store the client secret securely. Anyone with this secret can resolve flags on behalf of this client. ## Use Client Secrets The client secret authenticates when resolving and applying flags. Unlike other API operations that use Bearer tokens, resolve and apply operations use the client secret directly: ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/flags:resolve" \ -H "Content-Type: application/json" \ -d '{ "clientSecret": "YOUR_CLIENT_SECRET", "evaluationContext": { "user_id": "example-user" } }' ``` ## List Clients To view all clients in your account: ```bash theme={null} curl -X GET "https://iam.confidence.dev/v1/clients" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` ## Get a Specific Client To retrieve details about a specific client: ```bash theme={null} curl -X GET "https://iam.confidence.dev/v1/clients/1bhq4c2zqigdzqg6ufni" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` ## Rotate Client Secrets For security best practices, periodically rotate client secrets: 1. Create a new credential for the client 2. Update your application to use the new secret 3. Delete the old credential after the migration is complete To delete a credential: ```bash theme={null} curl -X DELETE "https://iam.confidence.dev/v1/clients/1bhq4c2zqigdzqg6ufni/credentials/abc123" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` ## Next Steps After setting up flag clients: 1. [Create flags](./create-flag) and associate them with clients 2. [Resolve flags](./resolve-flags) using the client secret 3. [Apply flags](./apply-flags) to track usage # Target with Criteria Source: https://confidence-auth-testing.mintlify.io/docs/api/how-to-guides/flags/target-with-criteria Learn how to use targeting criteria to filter users in segments. Add targeting criteria to your segments to filter users based on attributes from the evaluation context. See [Targeting Criteria](../../flags/segments-reference#targeting-criteria) in the reference for details on operators, value types, and how criteria work. ## Use Equality Matching Match users where a field equals a specific value: ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/segments?segmentId=sweden-users" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "displayName": "Users from Sweden", "targeting": { "criteria": { "sweden": { "attribute": { "attributeName": "country", "eqRule": { "value": {"stringValue": "SE"} } } } }, "expression": {"ref": "sweden"} }, "allocation": {"proportion": {"value": "1.0"}} }' ``` ## Use Set Matching Match users where a field equals any value from a set: ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/segments?segmentId=nordic-users" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "displayName": "Nordic users", "targeting": { "criteria": { "nordics": { "attribute": { "attributeName": "country", "setRule": { "values": [ {"stringValue": "SE"}, {"stringValue": "DK"}, {"stringValue": "NO"}, {"stringValue": "FI"}, {"stringValue": "IS"} ] } } } }, "expression": {"ref": "nordics"} }, "allocation": {"proportion": {"value": "1.0"}} }' ``` ## Use Range Matching Match users where a field falls within a range: ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/segments?segmentId=age-40-49" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "displayName": "Users aged 40-49", "targeting": { "criteria": { "age-range": { "attribute": { "attributeName": "age", "rangeRule": { "startInclusive": {"numberValue": 40}, "endExclusive": {"numberValue": 50} } } } }, "expression": {"ref": "age-range"} }, "allocation": {"proportion": {"value": "1.0"}} }' ``` ## Match Against Another Segment Check if a user is in another segment: ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/segments?segmentId=premium-sweden" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "displayName": "Premium users from Sweden", "targeting": { "criteria": { "sweden": { "attribute": { "attributeName": "country", "eqRule": {"value": {"stringValue": "SE"}} } }, "premium": { "segment": {"segment": "segments/premium-users"} } }, "expression": { "and": { "operands": [ {"ref": "sweden"}, {"ref": "premium"} ] } } }, "allocation": {"proportion": {"value": "0.1"}} }' ``` ## Combine Multiple Criteria Use AND, OR, and NOT to create complex logic: ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/segments?segmentId=nordic-android" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "displayName": "Nordic Android users", "targeting": { "criteria": { "nordics": { "attribute": { "attributeName": "country", "setRule": { "values": [ {"stringValue": "SE"}, {"stringValue": "DK"}, {"stringValue": "NO"}, {"stringValue": "FI"} ] } } }, "ios": { "attribute": { "attributeName": "device.os", "eqRule": {"value": {"stringValue": "ios"}} } } }, "expression": { "and": { "operands": [ {"ref": "nordics"}, {"not": {"ref": "ios"}} ] } } }, "allocation": {"proportion": {"value": "1.0"}} }' ``` ## Use Nested Fields Reference nested fields with dot notation: ```bash theme={null} curl -X POST "https://flags.confidence.dev/v1/segments?segmentId=iphone-users" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "displayName": "iPhone users", "targeting": { "criteria": { "iphone": { "attribute": { "attributeName": "device.model", "eqRule": {"value": {"stringValue": "iPhone14"}} } } }, "expression": {"ref": "iphone"} }, "allocation": {"proportion": {"value": "1.0"}} }' ``` This matches against evaluation context like: ```json theme={null} { "user_id": "123", "device": { "model": "iPhone14", "os": "ios" } } ``` ## Next Steps After setting up targeting criteria: 1. [Coordinate segments](./coordinate-segments) to make them mutually exclusive 2. [Create flag rules](./create-flag-rule) to assign variants 3. [Resolve flags](./resolve-flags) with the appropriate evaluation context # OAuth Apps Source: https://confidence-auth-testing.mintlify.io/docs/api/how-to-guides/iam/create-oauth-apps Learn about Confidence and third-party apps. OAuth Apps is a way for third-party applications to access Confidence on behalf of a user. With an OAuth App, you can, for example, develop your own application that accesses Confidence. ## Create an OAuth App To create an OAuth App, pass a name, description, and callback URLs. ```bash theme={null} curl -X POST "https://iam.confidence.dev/v1/oauthApps" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "displayName": "My OAuth App", "description": "Test app", "logoUri": "https://confidence.spotify.com/logo.png", "allowedCallbackUrls": [ "https://confidence.spotify.com" ], "allowedLogoutUrls": [ "https://confidence.spotify.com" ], "allowedWebOrigins": [ "https://confidence.spotify.com", "http://localhost:3000" ] }' ``` Response: ```json theme={null} { "name": "oauthApps/vkq6qw3qp6nbefxgbkr0", "displayName": "My OAuth App", "clientId": "vrBQfwAz8qesNWE84BAImPzCnkAhql7u", "clientSecret": "PWySgGDYi5gnxCRTNEI29UFalrlF_m2fhZOiiEw_YFVeCxoPHeQlE5m4kid-WtNB", "description": "Test app", "logoUri": "https://confidence.spotify.com/logo.png", "allowedCallbackUrls": [ "https://confidence.spotify.com" ], "allowedLogoutUrls": [ "https://confidence.spotify.com" ], "allowedWebOrigins": [ "https://confidence.spotify.com", "http://localhost:3000" ], "createdBy": "users/xa8cecs2cc9xsz8jvgmc", "updatedBy": "users/xa8cecs2cc9xsz8jvgmc", "labels": {}, "createTime": "2023-08-31T11:25:11.536748Z", "updateTime": "2023-08-31T11:25:11.536748Z" } ``` After you've created the OAuth App, you receive a `clientId` and `clientSecret` that you can use to get an access token from the OAuth API at `https://auth.confidence.dev/oauth/token`. You may only use one of the following grant types: `implicit`, `authorization_code`, or `refresh_token`. For more information on grant types, see the [Auth0 grant types guide](https://auth0.com/docs/get-started/applications/application-grant-types). For details on obtaining access tokens, see the [Auth0 access token guide](https://auth0.com/docs/secure/tokens/access-tokens/get-access-tokens). ## Get an OAuth App You can get an OAuth App by passing the name of the app to the following endpoint. ```bash theme={null} curl -X GET "https://iam.confidence.dev/v1/oauthApps/vkq6qw3qp6nbefxgbkr0" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` Response: ```json theme={null} { "name": "oauthApps/vkq6qw3qp6nbefxgbkr0", "displayName": "My OAuth App", "clientId": "vrBQfwAz8qesNWE84BAImPzCnkAhql7u", "clientSecret": "PWySgGDYi5gnxCRTNEI29UFalrlF_m2fhZOiiEw_YFVeCxoPHeQlE5m4kid-WtNB", "description": "Test app", "logoUri": "https://confidence.spotify.com/logo.png", "allowedCallbackUrls": [ "https://confidence.spotify.com" ], "allowedLogoutUrls": [ "https://confidence.spotify.com" ], "allowedWebOrigins": [ "https://confidence.spotify.com", "http://localhost:3000" ], "createdBy": "users/xa8cecs2cc9xsz8jvgmc", "updatedBy": "users/xa8cecs2cc9xsz8jvgmc", "labels": {}, "createTime": "2023-08-31T11:25:11.536748Z", "updateTime": "2023-08-31T11:25:11.536748Z" } ``` ## Delete an OAuth App You can delete an OAuth App by calling the delete endpoint. This does not revoke any already-issued access tokens. ```bash theme={null} curl -X DELETE "https://iam.confidence.dev/v1/oauthApps/vkq6qw3qp6nbefxgbkr0" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` # Manage API Clients Source: https://confidence-auth-testing.mintlify.io/docs/api/how-to-guides/iam/manage-api-clients Learn how to create API clients. API Clients are machine users that can interact with the Confidence APIs. Confidence has APIs for managing API clients programmatically. ## Create an API Client To create an API client you need to specify the name and desired permissions. You can either specify each permission separately or specify a role. In this example, you create an API client for managing flags. Give it a `Flag editor` role. ```bash theme={null} curl -X POST "https://iam.confidence.dev/v1/apiClients" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "displayName": "My API Client", "description": "Client for setting up flags in GHE repos", "permissions": [], "roles": [ "roles/726f6c5f68386b6c46596c4a335350384e6a7377" ] }' ``` Response: ```json theme={null} { "name": "apiClients/donlangsbyz6iiksdt4c", "displayName": "My API Client", "description": "Client for setting up flags in GHE repos", "clientId": "k9KkmxZfQtG6ZPqk9wyQfe7G5EzZsjza", "clientSecret": "4wvbCSdF7wlTdn8HJEqSkcuSqyndjwcHzQ3KEwxRcqvkfLeEG4eFapHQUIrRuDxr", "permissions": [], "roles": [ "roles/726f6c5f68386b6c46596c4a335350384e6a7377" ], "createdBy": "users/xa8cecs2cc9xsz8jvgmc", "updatedBy": "users/xa8cecs2cc9xsz8jvgmc", "labels": {}, "createTime": "2023-08-29T09:36:57.163017Z", "updateTime": "2023-08-29T09:36:57.163017Z" } ``` ## Get an API Client You can get an API client by passing the name of the client to the following endpoint. ```bash theme={null} curl -X GET "https://iam.confidence.dev/v1/apiClients/donlangsbyz6iiksdt4c" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` Response: ```json theme={null} { "name": "apiClients/donlangsbyz6iiksdt4c", "displayName": "My API Client", "description": "Client for setting up flags in GHE repos", "clientId": "k9KkmxZfQtG6ZPqk9wyQfe7G5EzZsjza", "clientSecret": "4wvbCSdF7wlTdn8HJEqSkcuSqyndjwcHzQ3KEwxRcqvkfLeEG4eFapHQUIrRuDxr", "permissions": [], "roles": [ "roles/726f6c5f68386b6c46596c4a335350384e6a7377" ], "createdBy": "users/xa8cecs2cc9xsz8jvgmc", "updatedBy": "users/xa8cecs2cc9xsz8jvgmc", "labels": {}, "createTime": "2023-08-29T09:36:57.163017Z", "updateTime": "2023-08-29T09:36:57.163017Z" } ``` ## List API Clients You can list all API clients in the organization using the following endpoint. ```bash theme={null} curl -X GET "https://iam.confidence.dev/v1/apiClients" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` Response: ```json theme={null} { "apiClients": [ { "name": "apiClients/donlangsbyz6iiksdt4c", "displayName": "My API Client", "description": "Client for setting up flags in GHE repos", "clientId": "k9KkmxZfQtG6ZPqk9wyQfe7G5EzZsjza", "clientSecret": "4wvbCSdF7wlTdn8HJEqSkcuSqyndjwcHzQ3KEwxRcqvkfLeEG4eFapHQUIrRuDxr", "permissions": [], "roles": [ "roles/726f6c5f68386b6c46596c4a335350384e6a7377" ], "createdBy": "users/xa8cecs2cc9xsz8jvgmc", "updatedBy": "users/xa8cecs2cc9xsz8jvgmc", "labels": {}, "createTime": "2023-08-29T09:36:57.163017Z", "updateTime": "2023-08-29T09:36:57.163017Z" } ], "nextPageToken": "" } ``` # Manage Users Source: https://confidence-auth-testing.mintlify.io/docs/api/how-to-guides/iam/manage-users Learn how to fetch and list users. Confidence has endpoints for fetching and listing users that are part of your Confidence organization. ## Get a User You can get a user by passing the name of the user to the following endpoint. ```bash theme={null} curl -X GET "https://iam.confidence.dev/v1/users/xa8cecs2cc9xsz8jvgmc" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` Response: ```json theme={null} { "name": "users/xa8cecs2cc9xsz8jvgmc", "fullName": "John Doe", "email": "johndoe@confidence.dev", "pictureUri": "https://lh3.googleusercontent.com/a/AAcHTtxy1zIWynFKa3DWtaQAy4VAXOMnIj0SBwwzviO05YTvpD=s96-c", "blocked": false, "labels": {}, "lastLoginTime": "2023-08-29T08:48:16.266Z", "createTime": "2022-12-08T12:12:58.332Z", "updateTime": "2023-08-29T08:48:16.266Z" } ``` ## List Users You can list all users in the organization using the following endpoint. ```bash theme={null} curl -X GET "https://iam.confidence.dev/v1/users" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` Response: ```json theme={null} { "users": [ { "name": "users/xa8cecs2cc9xsz8jvgmc", "fullName": "John Doe", "email": "johndoe@confidence.dev", "pictureUri": "https://lh3.googleusercontent.com/a/AAcHTtxy1zIWynFKa3DWtaQAy4VAXOMnIj0SBwwzviO05YTvpD=s96-c", "blocked": false, "labels": {}, "lastLoginTime": "2023-08-29T08:48:16.266Z", "createTime": "2022-12-08T12:12:58.332Z", "updateTime": "2023-08-29T08:48:16.266Z" } ], "nextPageToken": "MjAyMy0wOC0yNCAxMjo1OToyMy4wMjcwMDBVVEMsZ29vZ2xlLW9hdXRoMnwxMDQzMTQwODE5OTM2Mjk5NjgyNDE" } ``` # Create Assignment Tables Source: https://confidence-auth-testing.mintlify.io/docs/api/how-to-guides/metrics/create-assignment-table Learn how to create assignment tables using the API. Create assignment tables that store records of what entities have been assigned what configuration. ## Before You Begin Before creating an assignment table, ensure you have: * An API access token with appropriate permissions * Created the entity you want to track assignments for * Prepared a SQL query that selects assignment rows from your data warehouse * Identified the columns for timestamp, entity ID, exposure key, and variant key ## Create an Assignment Table Create an assignment table with automatic data delivery: ```bash theme={null} curl -X POST "https://metrics.confidence.dev/v1/assignmentTables" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "displayName": "My Assignment Table", "dataDeliveredUntilUpdateStrategyConfig": { "strategy": "AUTOMATIC", "automaticUpdateConfig": { "incrementDuration": "P13H", "commitDelay": "P13H" } }, "sql": "SELECT * FROM my_table", "entityColumnMapping": { "column": { "name": "user_id" }, "entity": "entities/user" }, "timestampColumn": { "name": "timestamp" }, "exposureKeyColumn": { "name": "experiment_id" }, "variantKeyColumn": { "name": "group" } }' ``` ## Column Mapping Fields * **entityColumnMapping**: Maps the column containing entity IDs to the entity resource * `column.name`: Name of the column in your query results * `entity`: Resource name of the entity (for example, `entities/user`) * `timestampColumn`: Column containing the assignment timestamp * `exposureKeyColumn`: Column identifying which experiment the assignment belongs to * `variantKeyColumn`: Column identifying which variant was assigned ## Data Delivery Strategy Configure how Confidence updates data from your warehouse: ```json theme={null} "dataDeliveredUntilUpdateStrategyConfig": { "strategy": "AUTOMATIC", "automaticUpdateConfig": { "incrementDuration": "P13H", "commitDelay": "P13H" } } ``` * **incrementDuration**: How frequently to check for new data * **commitDelay**: Buffer time before considering data complete ```json theme={null} "dataDeliveredUntilUpdateStrategyConfig": { "strategy": "DAILY", "dailyUpdateConfig": {} } ``` Updates once per day at a scheduled time. ## Next Steps After creating an assignment table: * [Create fact tables](./create-fact-table) to measure outcomes * [Create metrics](./create-metric) using your assignment and fact tables * Configure experiments to use this assignment table # Create Dimension Tables Source: https://confidence-auth-testing.mintlify.io/docs/api/how-to-guides/metrics/create-dimension-table Learn how to create dimension tables using the API. Create dimension tables that let you segment your entities for analysis. ## Before You Begin Before creating a dimension table, ensure you have: * An API access token with appropriate permissions * Created the entities you want to segment * Prepared a SQL query that selects dimension data from your data warehouse * Identified entity and dimension columns ## Create a Dimension Table Create a dimension table with a country dimension: ```bash theme={null} curl -X POST "https://metrics.confidence.dev/v1/dimensionTables" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "displayName": "User Location", "sql": "SELECT * FROM confidence.user_data.location", "timestampColumn": { "name": "date", "type": "COLUMN_TYPE_STRING", "repeated": false }, "entityColumnMapping": [ { "column": { "name": "user_id", "type": "COLUMN_TYPE_STRING", "repeated": false }, "entity": "entities/user" } ], "dimensions": [ { "name": "country", "type": "COLUMN_TYPE_STRING", "repeated": false } ], "dataDeliveredUntilUpdateStrategyConfig": { "dailyUpdateConfig": {} } }' ``` ## Create a Dimension Table with Multiple Dimensions Track multiple attributes for segmentation: ```bash theme={null} curl -X POST "https://metrics.confidence.dev/v1/dimensionTables" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "displayName": "User Demographics", "sql": "SELECT * FROM user_demographics", "timestampColumn": { "name": "updated_at", "type": "COLUMN_TYPE_STRING", "repeated": false }, "entityColumnMapping": [ { "column": { "name": "user_id", "type": "COLUMN_TYPE_STRING", "repeated": false }, "entity": "entities/user" } ], "dimensions": [ { "name": "country", "type": "COLUMN_TYPE_STRING", "repeated": false }, { "name": "age_group", "type": "COLUMN_TYPE_STRING", "repeated": false }, { "name": "is_premium", "type": "COLUMN_TYPE_BOOLEAN", "repeated": false } ], "dataDeliveredUntilUpdateStrategyConfig": { "dailyUpdateConfig": {} } }' ``` ## Dimension Types Supported dimension types: * `COLUMN_TYPE_STRING`: Categorical values (country, platform, etc.) * `COLUMN_TYPE_BOOLEAN`: Binary attributes (`is_premium`, `is_active`, etc.) * `COLUMN_TYPE_INTEGER`: Numeric categories (age group codes, tier levels, etc.) ## Data Delivery After creation, the dimension table enters the `CREATING` state. Confidence runs a sample query to verify the SQL produces the expected columns, then transitions to either `ACTIVE` or `FAILED`. ## Next Steps After creating dimension tables: * Use dimensions to segment metrics in experiment analysis * [Create metrics](./create-metric) that you can break down by these dimensions * Configure experiments to analyze results by dimension # Create Entities Source: https://confidence-auth-testing.mintlify.io/docs/api/how-to-guides/metrics/create-entity Learn how to create entities using the API. Create entities that can be uniquely identified and randomized, like users or sessions. ## Before You Begin Before creating entities, ensure you have: * An API access token with appropriate permissions * Determined the data type of your entity identifier (string, integer, etc.) ## Create an Entity To create an entity of type string called `User`: ```bash theme={null} curl -X POST "https://metrics.confidence.dev/v1/entities" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "displayName": "User", "primaryKeyType": "COLUMN_TYPE_STRING" }' ``` The response includes the entity resource name you can use to reference it: ```json theme={null} { "name": "entities/user", "displayName": "User", "primaryKeyType": "COLUMN_TYPE_STRING" } ``` ## Create an Integer Entity For entities with integer identifiers: ```bash theme={null} curl -X POST "https://metrics.confidence.dev/v1/entities" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "displayName": "Session", "primaryKeyType": "COLUMN_TYPE_INTEGER" }' ``` ## Supported Primary Key Types * `COLUMN_TYPE_STRING`: String identifiers (UUIDs, usernames, etc.) * `COLUMN_TYPE_INTEGER`: Integer identifiers * `COLUMN_TYPE_BOOLEAN`: Boolean values * `COLUMN_TYPE_DOUBLE`: Floating point numbers ## Next Steps After creating entities: * [Create an assignment table](./create-assignment-table) to track assignments * [Create fact tables](./create-fact-table) to measure entity behaviors * [Create dimension tables](./create-dimension-table) to segment entities # Create Fact Tables Source: https://confidence-auth-testing.mintlify.io/docs/api/how-to-guides/metrics/create-fact-table Learn how to create fact tables using the API. Create fact tables that contain measurements describing your entities. ## Before You Begin Before creating a fact table, ensure you have: * An API access token with appropriate permissions * Created the entities you want to measure * Prepared a SQL query that selects measurement rows from your data warehouse * Identified timestamp, entity, and measurement columns ## Create a Fact Table Create a fact table with a boolean measurement: ```bash theme={null} curl -X POST "https://metrics.confidence.dev/v1/factTables" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "checkouts", "displayName": "Checkouts", "sql": "SELECT * FROM confidence.analysis.checkouts", "timestampColumn": { "name": "date", "type": "COLUMN_TYPE_STRING", "repeated": false }, "entities": [ { "column": { "name": "user_id", "type": "COLUMN_TYPE_STRING", "repeated": false }, "entity": "entities/user" } ], "measurements": [ { "name": "completed_checkout", "type": "COLUMN_TYPE_BOOLEAN", "repeated": false } ], "dataDeliveredUntilUpdateStrategyConfig": { "dailyUpdateConfig": {} } }' ``` ## Create a Fact Table with Numeric Measurements For tables with numeric measurements like revenue: ```bash theme={null} curl -X POST "https://metrics.confidence.dev/v1/factTables" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "purchases", "displayName": "Purchases", "sql": "SELECT * FROM purchases", "timestampColumn": { "name": "purchase_date", "type": "COLUMN_TYPE_STRING", "repeated": false }, "entities": [ { "column": { "name": "user_id", "type": "COLUMN_TYPE_STRING", "repeated": false }, "entity": "entities/user" } ], "measurements": [ { "name": "purchase_amount", "type": "COLUMN_TYPE_DOUBLE", "repeated": false }, { "name": "item_count", "type": "COLUMN_TYPE_INTEGER", "repeated": false } ], "dataDeliveredUntilUpdateStrategyConfig": { "dailyUpdateConfig": {} } }' ``` ## Create a Fact Table with Multiple Entities Track measurements across multiple entities: ```bash theme={null} curl -X POST "https://metrics.confidence.dev/v1/factTables" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "sessions", "displayName": "User Sessions", "sql": "SELECT * FROM sessions", "timestampColumn": { "name": "session_start", "type": "COLUMN_TYPE_STRING", "repeated": false }, "entities": [ { "column": { "name": "user_id", "type": "COLUMN_TYPE_STRING", "repeated": false }, "entity": "entities/user" }, { "column": { "name": "session_id", "type": "COLUMN_TYPE_STRING", "repeated": false }, "entity": "entities/session" } ], "measurements": [ { "name": "duration_seconds", "type": "COLUMN_TYPE_INTEGER", "repeated": false } ], "dataDeliveredUntilUpdateStrategyConfig": { "dailyUpdateConfig": {} } }' ``` ## Column Types Supported measurement types: * `COLUMN_TYPE_BOOLEAN`: True/false values * `COLUMN_TYPE_INTEGER`: Whole numbers * `COLUMN_TYPE_DOUBLE`: Decimal numbers * `COLUMN_TYPE_STRING`: Text values ## Data Delivery After creation, the fact table enters the `CREATING` state. Confidence runs a sample query to verify the SQL produces the expected columns, then transitions to either `ACTIVE` or `FAILED`. ## Next Steps After creating fact tables: * [Create metrics](./create-metric) to aggregate measurements * [Create dimension tables](./create-dimension-table) to segment analysis * Configure experiments to track these measurements # Create Metrics Source: https://confidence-auth-testing.mintlify.io/docs/api/how-to-guides/metrics/create-metric Learn how to create metrics using the API. Create metrics that aggregate measurements across instances of an entity. ## Before You Begin Before creating a metric, ensure you have: * An API access token with appropriate permissions * Created the entity you want to measure * Created a fact table with the measurements to aggregate * Determined the aggregation type and time windows ## Create an Average Metric Create an average metric that measures the average sales amount per user: ```bash theme={null} curl -X POST "https://metrics.confidence.dev/v1/metrics" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "displayName": "Average sales amount per user during the first week after exposure", "entity": "entities/user", "factTable": "factTables/my-fact-table", "aggregationWindow": "604800s", "exposureOffset": "0s", "typeSpec": { "averageMetricSpec": { "measurement": { "name": "sales_amount", "repeated": false }, "aggregation": { "type": "AGGREGATION_TYPE_SUM" } } }, "varianceReductionConfig": { "disabled": false } }' ``` ## Create a Ratio Metric Create a ratio metric like conversion rate: ```bash theme={null} curl -X POST "https://metrics.confidence.dev/v1/metrics" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "displayName": "Conversion rate in first week", "entity": "entities/user", "factTable": "factTables/conversions", "aggregationWindow": "604800s", "exposureOffset": "0s", "typeSpec": { "ratioMetricSpec": { "numerator": { "measurement": { "name": "converted", "repeated": false }, "aggregation": { "type": "AGGREGATION_TYPE_SUM" } }, "denominator": { "measurement": { "name": "eligible", "repeated": false }, "aggregation": { "type": "AGGREGATION_TYPE_SUM" } } } }, "varianceReductionConfig": { "disabled": false } }' ``` ## Aggregation Types For average metrics, choose how to aggregate data within units: * `AGGREGATION_TYPE_SUM`: Sum all measurements * `AGGREGATION_TYPE_COUNT`: Count occurrences * `AGGREGATION_TYPE_COUNT_DISTINCT`: Count unique values * `AGGREGATION_TYPE_MAX`: Maximum value * `AGGREGATION_TYPE_MIN`: Minimum value * `AGGREGATION_TYPE_UNIQUE`: Single unique value (fails if multiple values exist) ## Time Windows ### Aggregation Window The `aggregationWindow` defines how long after exposure to aggregate measurements: ```json theme={null} "aggregationWindow": "604800s" // 7 days ``` Common windows: * `86400s`: 1 day * `604800s`: 7 days * `2592000s`: 30 days ### Exposure Offset The `exposureOffset` defines how long to wait after exposure before starting measurement: ```json theme={null} "exposureOffset": "0s" // Start immediately ``` Example with delay: ```json theme={null} "exposureOffset": "86400s" // Wait 1 day before measuring ``` ## Variance Reduction (CUPED) Enable or disable variance reduction to improve statistical power: ### Enabled (Default) ```json theme={null} "varianceReductionConfig": { "disabled": false } ``` ### Disabled ```json theme={null} "varianceReductionConfig": { "disabled": true } ``` ## Next Steps After creating metrics: * Configure experiments to track these metrics * Analyze experiment results using these metrics * Create additional metrics to measure different aspects of user behavior # Configure Multiple Comparisons Adjustment Source: https://confidence-auth-testing.mintlify.io/docs/api/how-to-guides/stats/configure-multiple-comparisons Use decision rules in the Stats API to control false positive rates across multiple metrics. When analyzing experiments with multiple metrics, adjustments control the overall false positive rate. The Stats API uses decision rules to determine how to adjust alpha and power levels for each metric. ## Decision Rules The analysis plan contains a `decisionRule` object that specifies how metrics combine to form an overall shipping decision. The decision rule uses `AND` and `OR` operators between hypotheses. ### Structure ```json theme={null} { "decisionRule": { "items": [ { "hypothesis": "success-metric" }, { "hypothesis": "guardrail-metric" } ], "operator": "AND" } } ``` This example encodes: "Ship if success-metric is significant AND guardrail-metric is significant." ### How Adjustments Work The multiple comparison adjustments control the false positive rate of the overall decision rule using: * **Union-intersection testing** for OR conditions (at least one must be significant) * **Intersection-union testing** for AND conditions (all must be significant) The adjustment depends on each metric's role within the decision rule. Metrics joined by OR receive stricter alpha adjustments, while metrics joined by AND receive power adjustments. ## Default Behavior If you don't specify a decision rule, the API applies a Bonferroni multiple testing correction. This divides the alpha level by the number of hypotheses. ```json theme={null} { "alpha": 0.05, "power": 0.8, "hypotheses": [ { "id": "metric-1", "..." }, { "id": "metric-2", "..." }, { "id": "metric-3", "..." } ] } ``` With three hypotheses and alpha = 0.05, each hypothesis uses alpha = 0.0167. ## Example: Success and Guardrail Metrics A common pattern tests for improvement in a success metric while ensuring guardrails pass: ```json theme={null} { "alpha": 0.05, "power": 0.8, "hypotheses": [ { "id": "consumption", "type": { "superiority": { "preferredDirection": "INCREASE", "minimumDetectableEffect": 0.03 } }, "segments": [ { "dimensions": {}, "params": { "zTest": {} } } ] }, { "id": "crashes", "type": { "nonInferiority": { "preferredDirection": "DECREASE", "nonInferiorityMargin": 0.01 } }, "segments": [ { "dimensions": {}, "params": { "gstZTest": { "maxSampleSize": 1000 } } } ] } ], "decisionRule": { "items": [ { "hypothesis": "consumption" }, { "hypothesis": "crashes" } ], "operator": "AND" } } ``` This tests: "Ship if consumption improves AND crashes don't degrade beyond the margin." ## Related Resources Learn about multiple comparison concepts Set up your analysis plan Understand test types Understand decision rules # Configure Sequential Testing Source: https://confidence-auth-testing.mintlify.io/docs/api/how-to-guides/stats/configure-sequential-testing Use sequential testing methods in the Stats API to analyze experiments during data collection. Sequential tests allow you to analyze experiment results during data collection without invalidating statistical conclusions. The Stats API uses the group sequential test method (`gstZTest`) for sequential analysis. ## Fixed Horizon vs Sequential Tests The Stats API supports two testing approaches: | Method | Description | When to Use | | ---------- | ----------------------- | -------------------------------------------------------------------- | | `zTest` | Fixed horizon z-test | When you analyze results once at the end of the experiment | | `gstZTest` | Group sequential z-test | When you want to analyze results continuously during data collection | ## Configure a Group Sequential Test Group sequential tests provide valid statistical conclusions even when you analyze results multiple times during data collection. You need to specify the expected maximum sample size upfront. In your analysis plan, specify `gstZTest` in the hypothesis segments: ```json theme={null} { "hypotheses": [ { "id": "my-metric", "type": { "superiority": { "preferredDirection": "INCREASE", "minimumDetectableEffect": 0.03 } }, "segments": [ { "dimensions": {}, "params": { "gstZTest": { "maxSampleSize": 10000 } } } ] } ] } ``` The `maxSampleSize` parameter helps the test allocate the false positive rate optimally across analyses. Your estimate doesn't need to be exact, but a reasonable estimate improves power. ## Configure a Fixed Horizon Test For metrics you only analyze once at the end of the experiment, use the standard `zTest`: ```json theme={null} { "hypotheses": [ { "id": "my-metric", "type": { "superiority": { "preferredDirection": "INCREASE", "minimumDetectableEffect": 0.03 } }, "segments": [ { "dimensions": {}, "params": { "zTest": {} } } ] } ] } ``` ## Provide Time-Series Data Sequential tests require time-series data to track how results evolve. Structure your data with `timeLabel` values containing cumulative statistics up to each time point: ```json theme={null} { "id": "my-metric", "segments": [ { "dimensions": {}, "groups": [ { "group": "control", "data": { "gstZTest": { "summary": { "data": [ { "timeLabel": "2024-01-01", "value": { "mean": 2.0, "variance": 2.28, "count": 100 } }, { "timeLabel": "2024-01-02", "value": { "mean": 1.99, "variance": 2.29, "count": 200 } } ] } } } } ] } ] } ``` ## Related Resources Learn about sequential testing concepts Complete analysis tutorial Set up your analysis plan Understand test types # Configure Variance Reduction Source: https://confidence-auth-testing.mintlify.io/docs/api/how-to-guides/stats/configure-variance-reduction Use pre-exposure data in the Stats API to reduce variance and increase experiment precision. Variance reduction uses pre-exposure data to reduce noise in your experiment metrics. This allows you to detect effects with fewer samples or detect smaller effects with the same sample size. ## How It Works The Stats API applies regression adjustment to reduce variance. You provide pre-exposure measurements alongside your post-exposure data, and the API uses the correlation between them to produce more precise estimates. ## Configure Variance Reduction for Analysis Include pre-exposure data in the `adjustment` field within your summary data: ```json theme={null} { "id": "my-metric", "segments": [ { "dimensions": {}, "groups": [ { "group": "control", "data": { "zTest": { "summary": { "mean": 10.5, "variance": 25.0, "count": 1000, "adjustment": { "mean": 9.8, "variance": 22.0, "covariance": 15.2 } } } } }, { "group": "treatment", "data": { "zTest": { "summary": { "mean": 11.2, "variance": 26.0, "count": 1000, "adjustment": { "mean": 9.9, "variance": 21.5, "covariance": 14.8 } } } } } ] } ] } ``` ### Adjustment Fields The `adjustment` object contains: | Field | Description | | ------------ | -------------------------------------------------------- | | `mean` | Mean of the pre-exposure measurements | | `variance` | Variance of the pre-exposure measurements | | `covariance` | Covariance between pre-exposure and post-exposure values | ## Configure Variance Reduction for Power Analysis For power analysis, include the expected covariance adjustment in your power data: ```json theme={null} { "hypotheses": [ { "id": "my-metric", "segments": [ { "dimensions": {}, "powerData": { "zTest": { "baselineMean": 10.0, "baselineVariance": 25.0, "adjustment": { "baselineVariance": 22.0, "baselineCovariance": 15.0 } } } } ] } ] } ``` ### Power Analysis Adjustment Fields | Field | Description | | -------------------- | ------------------------------------------------------------- | | `baselineVariance` | Variance of the pre-exposure covariate | | `baselineCovariance` | Covariance between the pre-exposure covariate and the outcome | ## Interpret Results The API returns both adjusted and unadjusted estimates. The treatment effect estimate benefits from the reduced variance, providing tighter confidence intervals. The response includes a `varianceReductionRate` field showing the achieved reduction. ## Related Resources Learn about variance reduction concepts Complete analysis tutorial Calculate required sample sizes # Create an Analysis Plan Source: https://confidence-auth-testing.mintlify.io/docs/api/how-to-guides/stats/create-analysis-plan Learn how to create an analysis plan for your experiment. The first step when setting up the analysis plan is to decide on the risk management parameters alpha and power, which control the overall false positive and false negative rates of the analysis. For this example, use a false positive rate of `0.05` and a statistical power of `0.8`, implying a false negative rate of `1 - 0.8 = 0.2`. With these parameters, the analysis plan looks like: ```json theme={null} { "alpha": 0.05, "power": 0.8 } ``` ## Create the Groups In this analysis, you only have two groups: a `control` group and a `treatment` group. Both have the same number of samples on average, so set both of their weights to 1. ```json theme={null} { "groups": [ { "id": "control", "weight": 1 }, { "id": "treatment", "weight": 1 } ] } ``` ## Set Up the Comparisons To compare the treatment group to the control group, use a `oneVsAll` comparison specification. ```json theme={null} { "comparisons": { "oneVsAll": { "baseline": "control" } } } ``` ## Set Up the Hypotheses The hypotheses consist of two metrics: a crash rate metric and a consumption metric. Use a non-inferiority hypothesis for the crash rate metric to accept a slight increase. Set the margin to 1%. To avoid waiting until the end of the experiment to learn about increased crash rates, analyze the crash rate sequentially. Use a group sequential test to analyze the data sequentially. For the consumption metric, use a superiority hypothesis with a minimum detectable effect of 3%. Anything less than 3% is not practically meaningful in this case, so you want to design the test for this effect size. You want to analyze the consumption at the end of the experiment, so select a regular z-test. Add a single segment entry with an empty dimensions map to signal that the test has no segmentation. Your analysis plan at this stage is: ```json theme={null} { "hypotheses": [ { "id": "crashes", "type": { "nonInferiority": { "preferredDirection": "DECREASE", "nonInferiorityMargin": 0.01 } }, "segments": [ { "dimensions": {}, "params": { "gstZTest": { "maxSampleSize": 1000 } } } ] }, { "id": "consumption", "type": { "superiority": { "preferredDirection": "INCREASE", "minimumDetectableEffect": 0.03 } }, "segments": [ { "dimensions": {}, "params": { "zTest": {} } } ] } ] } ``` ## Create the Decision Rule Your decision rule is to ship the experiment if the guardrail is significantly non-inferior and the success metric is significantly superior. The decision rule is logically `crashes AND consumption`. You write it as: ```json theme={null} { "decisionRule": { "items": [ { "hypothesis": "consumption" }, { "hypothesis": "crashes" } ], "operator": "AND" } } ``` ## Bring It All Together Your analysis plan is now ready! The full plan is: ```json theme={null} { "alpha": 0.05, "power": 0.8, "groups": [ { "id": "control", "weight": 1 }, { "id": "treatment", "weight": 1 } ], "comparisons": { "oneVsAll": { "baseline": "control" } }, "decisionRule": { "items": [ { "hypothesis": "consumption" }, { "hypothesis": "crashes" } ], "operator": "AND" }, "hypotheses": [ { "id": "consumption", "type": { "superiority": { "preferredDirection": "INCREASE", "minimumDetectableEffect": 0.03 } }, "segments": [ { "dimensions": {}, "params": { "zTest": {} } } ] }, { "id": "crashes", "type": { "nonInferiority": { "preferredDirection": "DECREASE", "nonInferiorityMargin": 0.01 } }, "segments": [ { "dimensions": {}, "params": { "gstZTest": { "maxSampleSize": 1000 } } } ] } ] } ``` # Run an Analysis Source: https://confidence-auth-testing.mintlify.io/docs/api/how-to-guides/stats/run-analysis Learn how to analyze your experiment. In this section, you go through the steps to run an analysis. You set up the request for the following example where you analyze an experiment with two metrics: a crash metric used as a guardrail that you analyze sequentially, and a consumption metric that you analyze once. To go through this tutorial you need to first [create an analysis plan](./create-analysis-plan). ## Run the Analysis To run an analysis, send a POST request to the analysis endpoint with both the analysis plan and the data: ```bash theme={null} curl -X POST "https://stats.confidence.dev/v1/analysis:run" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "plan": { ... }, "data": { ... } }' ``` ## Create the Analysis Data When you've set up the analysis plan, you only have to add the data for analysis. The format must match what you specified in the analysis plan. For your crash metric, you have two days of data. The data for your hypothesis looks like: ```json theme={null} { "id": "crashes", "segments": [ { "dimensions": {}, "groups": [ { "group": "control", "data": { "gstZTest": { "summary": { "data": [ { "timeLabel": "2020-01-01", "value": { "mean": 2, "variance": 2.282828, "count": 100 } }, { "timeLabel": "2020-01-02", "value": { "mean": 1.99, "variance": 2.291357, "count": 200 } } ] } } } }, { "group": "treatment", "data": { "gstZTest": { "summary": { "data": [ { "timeLabel": "2020-01-01", "value": { "mean": 2.95, "variance": 2.45202, "count": 100 } }, { "timeLabel": "2020-01-02", "value": { "mean": 2.97, "variance": 2.702613, "count": 200 } } ] } } } } ] } ] } ``` Your consumption data is for the whole period, and looks like: ```json theme={null} { "id": "consumption", "segments": [ { "dimensions": {}, "groups": [ { "group": "control", "data": { "zTest": { "summary": { "mean": 0.25, "variance": 0.1893939, "count": 100 } } } }, { "group": "treatment", "data": { "zTest": { "summary": { "mean": 0.3133333, "variance": 0.2165996, "count": 150 } } } } ] } ] } ``` This completes the data needed for your analysis. See the API reference for full request and response examples. # Run a Power Analysis Source: https://confidence-auth-testing.mintlify.io/docs/api/how-to-guides/stats/run-power-analysis Learn how to run a power analysis. In this section, you go through the steps to run a power analysis. You set up the request for the following example where you analyze an experiment with two metrics: a crash metric used as a guardrail that you analyze sequentially, and a consumption metric that you analyze once. To go through this tutorial you need to first [create an analysis plan](./create-analysis-plan). ## Run the Power Analysis To run a power analysis, send a POST request to the power analysis endpoint with both the analysis plan and the power data: ```bash theme={null} curl -X POST "https://stats.confidence.dev/v1/powerAnalysis:run" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "plan": { ... }, "data": { ... } }' ``` ## Data for the Power Analysis To run the power analysis, you need to add power parameters to the analysis plan. For both the z-test and group sequential z-test, you need to include the mean and variance estimates. Pass the following data for the consumption metric together with the analysis plan: ```json theme={null} { "hypotheses": [ { "id": "consumption", "segments": [ { "dimensions": {}, "powerData": { "zTest": { "baselineMean": 0.3, "baselineVariance": 0.63 } }, "expected_sample_size": 1000 } ] } ] } ``` For the crash rate metric, include the following data: ```json theme={null} { "hypotheses": [ { "id": "crashes", "segments": [ { "dimensions": {}, "powerData": { "zTest": { "baselineMean": 2.5, "baselineVariance": 1.3 } }, "expected_sample_size": 1000 } ] } ] } ``` This completes the data needed for the power analysis. See the API reference for full request and response examples. # Add Metrics to a Surface Source: https://confidence-auth-testing.mintlify.io/docs/api/how-to-guides/surfaces/add-metrics-to-surface Learn how to add required and associated metrics to a surface using the API. Add [metrics to a surface](/docs/surfaces/surface-settings#metrics) to make them easier to find for experimenters, or enforce that all experiments on the surface check this metric for regressions. ## Add a Required Metric Confidence enforces required metrics for all experiments on the surface. Use the following to add a required metric `metrics/` to a surface with resource name `surfaces/`: ```bash theme={null} curl -X PATCH "https://workflow.confidence.dev/v1/surfaces/?updateMask=metricConfig.mandatoryMetrics" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "metricConfig": { "mandatoryMetrics": [{ "metric": "metrics/", "guardrailMetric": {}, "preferredDirection": "INCREASE" }] } }' ``` The `preferredDirection` can be `INCREASE` or `DECREASE`, indicating which direction the metric should move in for a successful experiment. ## Add an Associated Metric Confidence suggests associated metrics for experiments on the surface but doesn't enforce them. Use the following to add an associated metric: ```bash theme={null} curl -X PATCH "https://workflow.confidence.dev/v1/surfaces/?updateMask=metricConfig.associatedMetrics" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "metricConfig": { "associatedMetrics": [{ "metric": "metrics/" }] } }' ``` ## Related Resources Console guide for adding metrics Deep dive into surface configuration API reference for creating metrics # IAM Source: https://confidence-auth-testing.mintlify.io/docs/api/iam Confidence IAM is a service for identity and access management. Confidence IAM is a service for identity and access management of the users and API clients that are part of your Confidence organizations. Confidence IAM provides endpoints for setting roles and permissions of your users and creating API clients for directly accessing the APIs. All use of the Confidence IAM API is free of charge. ## Use Confidence IAM Learn how to fetch and list users. Learn how to create API clients. Learn about Confidence and third-party apps. # Metrics Concepts Source: https://confidence-auth-testing.mintlify.io/docs/api/metrics/concepts Understand the key concepts in Confidence Metrics. This section overviews Confidence Metrics key concepts, and should give you a broad understanding of which building blocks exists, and what they can do. The metric subsystem centers around a `Metric`, which is a description of how to compute a metric. A metric is an aggregation over measurements performed on an `Entity`. The entity is typically a user but can also be something a user interacts with, like an ad. A `ScheduledMetricCalculation` performs the actual computation of the metrics by tying together the entity measurements from a `FactTable` with exposures from an `ExposureTable`. Confidence calculates exposures from a `AssignmentTable` that either Confidence Flags, the customer or some third party system provides. A `ScheduledExposureCalculation` computes exposure by periodically creating a job that takes the assignments and summarizes them into a first exposure for each entity. The rest of this section goes through each key concept in more detail, but still on a high level. ## Key Concepts ### Data Warehouse The `Data Warehouse` is where you store your data and run your queries. Confidence connects to your data warehouse to run queries, but all the data is in your data warehouse. Confidence supports integration with BigQuery, Databricks, Snowflake and Redshift. ### Entity An `Entity` is an abstract term for some part of your business that can be uniquely identified, measured and experimented on. The canonical example is a user, but it can also be something your customers interact with, like an ad. In Confidence, both measurements and assignments relate to an entity. ### Tables Tables describe the structure of the data in your data warehouse so that Confidence can understand it. Three important tables in Confidence are: `AssignmentTable`, `ExposureTable` and `FactTable`. The `AssignmentTable` points to a table in your data warehouse that stores information on when and which variant was assigned to one of your entities. Either Confidence Flags, your internal feature flagging, or some third party service provides this table. The only requirement is that you map out its columns in the `AssignmentTable`. The `ExposureTable` points to a table that is an aggregation over the assignments table. It takes the assignments for each entity and determines the point of time of the first assignment of each variant. The time of the first assignment is called first exposure. In Confidence, the `ExposureTable` belongs to a single experiment, meaning that it filters out the assignments from the `AssignmentTable` that originates from the experiment before it aggregates them. The `FactTable` represents a collection of measurements of an entity involved in some business process. It points to a table in your data warehouse that has the events relating to that business process. It could, for example, be the sales amount and checkout time of each user that placed an order on an ecommerce site. To define a fact table, you need the 1) the timestamp when the event occurred, 2) the entities involved in the event, and 3) a measurement of those entities. ### Metrics A `Metric` is a description of how to aggregate a measurement across entities. In essence, it consists of a type, an aggregation and a time window. Two types of metrics exist in Confidence: *average* and *ratio* metrics. The average metric takes average of a measurement across entities, and a ratio separately aggregates a numerator and denominator and divides them. The metric aggregation determines how to aggregate values within an entity, typically, an entity has more than one event associated with them in the fact table. Finally, the time window specifies when to measure the metric relative to exposure. For example, sum all sales that occurred during the second week since first exposure. The metric is also computed on a set of dimensions like date, variant group and one or more dimensions of the entity itself. ### Schedules The metric itself doesn't perform any calculation. A metric is only an abstract representation of how to compute it. A schedule defines from which data source and at what frequency to calculate a metric. Two schedules exist in Confidence: `ScheduledExposureCalculation` to calculate first exposures, and `ScheduledMetricCalculation` to calculate metrics. These schedules operate at a given, possibly variable, rate, and trigger `MetricCalculation`s and `ExposureCalculation`s that represent the calculation of the metric or exposure table within a specific time window. # Entities Reference Source: https://confidence-auth-testing.mintlify.io/docs/api/metrics/entities-reference Technical reference for entities in Confidence Metrics. This section provides technical specifications and reference information for entities. For conceptual explanations of entities, see [Entities](./concepts#entity) in the Metrics Concepts page. ## Primary Key Types Available primary key types for entities: | Type | Description | Use Case | | :-------------------- | :--------------------- | :---------------------------------------------- | | `COLUMN_TYPE_STRING` | String identifiers | UUIDs, usernames, session IDs | | `COLUMN_TYPE_INTEGER` | Integer identifiers | Autoincrementing user IDs, numeric keys | | `COLUMN_TYPE_BOOLEAN` | Boolean values | Binary entity identifiers (rarely used) | | `COLUMN_TYPE_DOUBLE` | Floating point numbers | Numeric identifiers with decimals (rarely used) | ## Entity Constraints * **Unique names**: Entity display names must be unique within a project * **Immutable key type**: You cannot change the primary key type after creation * **Referenced entities**: You cannot delete entities used in fact tables, dimension tables, or metrics * **Case sensitivity**: Entity names are case-sensitive ## Entity Resource Name Format Reference entities using the resource name format: ```text theme={null} entities/{entity_id} ``` Example: `entities/user`, `entities/session` # Metrics Reference Source: https://confidence-auth-testing.mintlify.io/docs/api/metrics/metrics-reference Technical reference for metrics in Confidence Metrics. This section provides technical specifications and reference information for metrics. For conceptual explanations of metrics, see [Metrics](./concepts#metrics) in the Metrics Concepts page. ## Metric Types ### Average Metrics Aggregate a single measurement across entities: ```json theme={null} { "typeSpec": { "averageMetricSpec": { "measurement": { "name": "purchase_amount", "repeated": false }, "aggregation": { "type": "AGGREGATION_TYPE_SUM" } } } } ``` ### Ratio Metrics Compute a ratio of two aggregated measurements: ```json theme={null} { "typeSpec": { "ratioMetricSpec": { "numerator": { "measurement": { "name": "converted", "repeated": false }, "aggregation": { "type": "AGGREGATION_TYPE_SUM" } }, "denominator": { "measurement": { "name": "eligible", "repeated": false }, "aggregation": { "type": "AGGREGATION_TYPE_SUM" } } } } } ``` ## Aggregation Types | Type | Description | Use Case | | :-------------------------------- | :-------------------------------------- | :--------------------------------------- | | `AGGREGATION_TYPE_SUM` | Sum all values | Total revenue, total conversions | | `AGGREGATION_TYPE_COUNT` | Count all occurrences | Number of events, session count | | `AGGREGATION_TYPE_COUNT_DISTINCT` | Count unique values | Unique items viewed, distinct categories | | `AGGREGATION_TYPE_MAX` | Maximum value | Highest price, longest session | | `AGGREGATION_TYPE_MIN` | Minimum value | Lowest price, shortest session | | `AGGREGATION_TYPE_UNIQUE` | Single unique value (fails if multiple) | Latest status, final state | ## Time Windows ### Aggregation Window Duration after exposure to aggregate measurements: ```json theme={null} "aggregationWindow": "604800s" // 7 days in seconds ``` Common windows: * `86400s`: 1 day * `604800s`: 7 days (1 week) * `1209600s`: 14 days (2 weeks) * `2592000s`: 30 days (\~1 month) ### Exposure Offset Delay before starting measurement: ```json theme={null} "exposureOffset": "0s" // Start immediately ``` Use cases: * `0s`: Immediate effect (UI changes, performance) * `86400s`: 1-day delay (email campaigns) * `604800s`: 1-week delay (long-term behavior) ## Variance Reduction (CUPED) Variance reduction improves statistical power by reducing noise in metric estimates: ```json theme={null} { "varianceReductionConfig": { "disabled": false } } ``` Recommended for most metrics. Requires pre-exposure data. ```json theme={null} { "varianceReductionConfig": { "disabled": true } } ``` Use when: * No pre-exposure data available * Metric is new user only * Testing CUPED impact ## Metric Resource Name Format Reference metrics using the resource name format: ```text theme={null} metrics/{metric_id} ``` Example: `metrics/conversion-rate`, `metrics/average-revenue` ## Required Fields | Field | Type | Description | | :------------------ | :----- | :-------------------------------------------------- | | `displayName` | string | Human-readable metric name | | `entity` | string | Entity resource name (for example, `entities/user`) | | `factTable` | string | Fact table resource name | | `aggregationWindow` | string | Duration in seconds (ISO 8601) | | `exposureOffset` | string | Duration in seconds (ISO 8601) | | `typeSpec` | object | Average or ratio metric specification | ## Best Practices ### Choose Metric Types * **Average metrics**: Use for continuous values (revenue, duration, ratings) * **Ratio metrics**: Use for rates and percentages (conversion rate, CTR, success rate) ### Aggregation Selection * **SUM**: Default for most measurements (revenue, clicks, conversions) * **COUNT**: When you only care about occurrence, not value * **COUNT\_DISTINCT**: When each unique value matters (unique products, categories) * **MAX/MIN**: When extremes are important (peak load, worst performance) ### Time Window Considerations * **Shorter windows** (1-7 days): Faster results, earlier decisions * **Longer windows** (14-30 days): Capture long-term effects, slower to significance * **Match business cycle**: Align with purchase cycles, subscription periods ### Variance Reduction * Enable CUPED for most metrics to improve sensitivity * Disable for new user metrics or when no historical data exists * Monitor CUPED effectiveness in analysis results # Tables Reference Source: https://confidence-auth-testing.mintlify.io/docs/api/metrics/tables-reference Technical reference for tables in Confidence Metrics. This section provides technical specifications and reference information for assignment tables, fact tables, and dimension tables. For conceptual explanations of tables, see [Tables](./concepts#tables) in the Metrics Concepts page. ## Column Types All tables use these column type specifications: | Type | Description | Example Use | | :---------------------- | :---------------- | :------------------------------------- | | `COLUMN_TYPE_STRING` | Text values | User IDs, country codes, product names | | `COLUMN_TYPE_INTEGER` | Whole numbers | Count values, age, quantity | | `COLUMN_TYPE_DOUBLE` | Decimal numbers | Revenue, ratings, percentages | | `COLUMN_TYPE_BOOLEAN` | True/false values | Conversion flags, feature enabled | | `COLUMN_TYPE_TIMESTAMP` | Date and time | Event timestamps, created dates | | `COLUMN_TYPE_DATE` | Date only | Birth dates, enrollment dates | ## Assignment Tables ### Required Fields | Field | Type | Description | | :-------------------- | :------------ | :-------------------------------- | | `timestampColumn` | Column | When the assignment occurred | | `entityColumnMapping` | ColumnMapping | Which entity was assigned | | `exposureKeyColumn` | Column | Identifies the experiment/feature | | `variantKeyColumn` | Column | Which variant was assigned | ### Data Delivery Strategies Continuously updates data based on incremental checks: ```json theme={null} { "strategy": "AUTOMATIC", "automaticUpdateConfig": { "incrementDuration": "P13H", "commitDelay": "P13H" } } ``` * **incrementDuration**: How frequently to check for new data (ISO 8601 duration) * **commitDelay**: Buffer time before considering data complete Updates once per day at a scheduled time: ```json theme={null} { "strategy": "DAILY", "dailyUpdateConfig": {} } ``` ## Fact Tables ### Required Fields | Field | Type | Description | | :---------------- | :--------------- | :------------------------------------------ | | `name` | string | Unique identifier for the table | | `displayName` | string | Human-readable name | | `sql` | string | SQL query selecting fact rows | | `timestampColumn` | Column | When the measurement occurred | | `entities` | ColumnMapping\[] | Entity columns (at least one required) | | `measurements` | Column\[] | Measurement columns (at least one required) | ### Column Specifications Each column requires: * `name`: Column name in query results * `type`: Column type (from table above) * `repeated`: Boolean indicating if column contains arrays ### Table States | State | Description | | :--------- | :-------------------------------------- | | `CREATING` | Initial validation in progress | | `ACTIVE` | Ready for use in metrics | | `FAILED` | Validation failed, check error messages | ## Dimension Tables ### Required Fields | Field | Type | Description | | :-------------------- | :--------------- | :---------------------------------------- | | `displayName` | string | Human-readable name | | `sql` | string | SQL query selecting dimension rows | | `timestampColumn` | Column | When the dimension value applies | | `entityColumnMapping` | ColumnMapping\[] | Entity columns (at least one required) | | `dimensions` | Column\[] | Dimension columns (at least one required) | ### Dimension Column Types Dimensions typically use: * **STRING**: Categorical values (country, platform, tier) * **BOOLEAN**: Binary attributes (`is_premium`, `is_active`) * **INTEGER**: Numeric categories (`age_group_code`, `tier_level`) ### Table States Same as fact tables: `CREATING`, `ACTIVE`, `FAILED` ## Column Mapping Structure Column mappings connect query results to entities: ```json theme={null} { "column": { "name": "user_id", "type": "COLUMN_TYPE_STRING", "repeated": false }, "entity": "entities/user" } ``` ## Best Practices ### SQL Queries * **Use SELECT \* sparingly**: Explicitly specify columns for better performance * **Add WHERE clauses**: Filter data at query time to reduce processing * **Use partitioning**: Leverage data warehouse partitioning for efficiency * **Test queries**: Validate SQL in your data warehouse before creating tables ### Data Quality * **Validate timestamps**: Ensure timestamp columns are in the correct format * **Handle NULLs**: Decide how to handle NULL values in measurements * **Check data types**: Verify column types match your schema expectations * **Monitor failures**: Review failed tables and fix SQL or schema issues # Get Started with Confidence APIs Source: https://confidence-auth-testing.mintlify.io/docs/api/quickstart This tutorial helps you make your first Confidence API call by retrieving a list of existing feature flags. The steps to take are the following: 1. Create an API client if you haven't done so 2. Request an access token 3. Use the access token to request a list of flags ## Before You Begin * This tutorial assumes you have a Confidence account. * Use cURL to make API calls. You can install cURL using the package manager of your choice. ## Create an API Client An API client provides a client ID and client secret needed to request an access token by implementing any of the authorization flows. On the bottom of the left sidebar, select **Admin > API Clients**. Enter `API client` as the **Display name**. ## Request an Access Token The access token is a string which has the credentials and permissions that you can use to access a given resource (for example, flags, events, and metrics). To request the access token you first need your client ID and client secret: On the bottom of the left sidebar, select **Admin > API Clients**. Select the API client you just created. You find the client ID immediately on the page. The client secret is available behind the **View client secret** link. With the credentials in hand, you are ready to request an access token. This tutorial uses the client credentials flow, so you must: Set to the `application/json` value. Include the `clientId` and `clientSecret`, along with the `grantType` parameter set to `client_credentials`. ```bash Request theme={null} curl -X POST "https://iam.confidence.dev/v1/oauth/token" \ -H "Content-Type: application/json" \ -d '{ "grantType": "client_credentials", "clientId": "clientId", "clientSecret": "clientSecret" }' ``` The response returns an access token valid for 1 hour: ```json Response theme={null} { "accessToken": "eyJraWQiOi...zWyvwvtz_oEU1x", "expiresIn": "86400" } ``` ## Example: Request a List of Flags For this example, use the list flags endpoint in the Flags API to request information about existing feature flags. Your API call must include the access token you have just generated using the `Authorization` header as follows: ```bash Request theme={null} curl -X GET "https://flags.confidence.dev/v1/flags" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` The API returns the following JSON response: ```json Response theme={null} { "flags": [...] } ``` Congratulations! You made your first API call to Confidence. Since you probably have not created any flags yet, the response is empty. ## Summary The Confidence platform provides different APIs depending on the functionality you want to access. The API calls must include the Authorization header along with a valid access token. This tutorial makes use of the client credentials grant type to retrieve the access token. That works fine in scenarios where you control the API call to Confidence, for example where your backend is connecting to the API. It does not work in cases where your app connects on behalf of a specific user, for example when getting private playlist or profile data. ## What's Next? * The tutorial used the Flags API to retrieve a list of flags. An interesting exercise would be to extend the example by trying to create a flag. Do you accept the challenge? * The [API basics](./api-basics) page provides more information on how to work with Confidence platform APIs. # Analysis Reference Source: https://confidence-auth-testing.mintlify.io/docs/api/stats/analysis-reference Technical reference for statistical analysis in Confidence Stats. This section provides technical specifications and reference information for analysis plans and statistical testing. For conceptual explanations of analysis, see [Stats Concepts](./concepts). ## Comparison Specifications Define how to compare groups in an analysis: ### All to Baseline Compare all treatment groups to a designated control: ```json theme={null} { "comparisonSpec": { "allToBaseline": { "baseline": "control" } } } ``` **Use when:** Standard A/B test with one control and multiple treatments ### All Pairs Compare every group to every other group: ```json theme={null} { "comparisonSpec": { "allPairs": {} } } ``` **Use when:** exploring all possible differences, no clear control group ### Specific Pairs Define exactly which groups to compare: ```json theme={null} { "comparisonSpec": { "pairs": [ { "baseline": "control", "treatment": "variant_a" }, { "baseline": "control", "treatment": "variant_b" } ] } } ``` **Use when:** complex designs with specific comparisons of interest ## Hypothesis Types ### Superiority Hypothesis Test if a treatment improves a metric by a meaningful amount: ```json theme={null} { "superiority": { "preferredDirection": "INCREASE", "minimumDetectableEffect": 0.03 } } ``` **Fields:** * `preferredDirection`: `INCREASE` or `DECREASE` * `minimumDetectableEffect`: Relative change considered meaningful (for example, 0.03 = 3%) **Use for:** success metrics, primary outcomes ### Non-Inferiority Hypothesis Test if a treatment doesn't harm a metric beyond an acceptable margin: ```json theme={null} { "nonInferiority": { "preferredDirection": "INCREASE", "nonInferiorityMargin": 0.01 } } ``` **Fields:** * `preferredDirection`: `INCREASE` or `DECREASE` * `nonInferiorityMargin`: Maximum acceptable degradation (for example, 0.01 = 1%) **Use for:** guardrail metrics, cost metrics, performance metrics ## Preferred Direction | Value | Meaning | Example Metrics | | :--------- | :--------------- | :----------------------------------- | | `INCREASE` | Higher is better | Revenue, conversion rate, engagement | | `DECREASE` | Lower is better | Load time, error rate, bounce rate | ## Decision Rules Combine multiple hypotheses into a single decision: ### AND Rule All hypotheses must be significant: ```json theme={null} { "operator": "AND", "items": ["metric1", "metric2", "metric3"] } ``` ### OR Rule At least one hypothesis must be significant: ```json theme={null} { "operator": "OR", "items": ["metric1", "metric2", "metric3"] } ``` ### Complex Rule Combine AND/OR logic: ```json theme={null} { "operator": "AND", "items": [ { "rule": { "operator": "AND", "items": ["guardrail1", "guardrail2"] } }, { "rule": { "operator": "OR", "items": ["success1", "success2", "success3"] } } ] } ``` **Translates to**: `(guardrail1 AND guardrail2) AND (success1 OR success2 OR success3)` ## Group Structure Define groups with allocation weights: ```json theme={null} { "groups": [ { "id": "control", "weight": 1 }, { "id": "treatment", "weight": 1 } ] } ``` **Fields:** * `id`: Unique identifier for the group * `weight`: Relative allocation (typically proportional to traffic split) **Common patterns:** * Equal split: All weights = 1 * 50/25/25: Weights = 2, 1, 1 * 90/10: Weights = 9, 1 ## Statistical Parameters ### Significance Level (Alpha) Probability of false positive: ```json theme={null} "alpha": 0.05 // 5% false positive rate ``` Common values: * `0.05`: Standard significance level * `0.01`: Stricter threshold * `0.10`: More lenient threshold ### Statistical Power Probability of detecting a true effect: ```json theme={null} "power": 0.80 // 80% power ``` Common values: * `0.80`: Standard power level * `0.90`: Higher power (larger sample needed) * `0.70`: Lower power (smaller sample enough) ## Data Types ### Binary Data For conversion-like metrics: ```json theme={null} { "binaryData": { "successes": [100, 110], "trials": [1000, 1000] } } ``` **Use for:** conversion rates, click-through rates, success/failure outcomes ### Continuous Data For numeric measurements: ```json theme={null} { "continuousData": { "means": [42.5, 43.2], "variances": [12.3, 11.8], "counts": [1000, 1000] } } ``` **Use for:** revenue, duration, ratings, counts ## Analysis Methods Different methods have different assumptions and use cases: | Method | Sequential | Data Type | Use Case | | :------------ | :--------- | :-------- | :-------------------------------------- | | Fixed horizon | No | Both | Final analysis only | | Sequential | Yes | Both | Continuous monitoring | | Bayesian | Yes | Both | Continuous updates with prior knowledge | ### Method Assumptions All methods assume: * **Random assignment**: Users randomly assigned to groups * **Independence**: User outcomes are independent * **Stable variance**: Variance doesn't change over time * **No spillover**: Treatment doesn't affect control group Sequential methods additionally assume: * **Data arrives continuously**: New data added over time * **Stopping rules followed**: Don't peek without accounting for it ## Best Practices ### Hypothesis Design * Set MDE/NIM based on business impact, not statistical convenience * Use superiority for metrics you want to improve * Use non-inferiority for metrics you want to protect * Define hypotheses before looking at data ### Decision Rules * Require all guardrails to pass (use AND) * Allow any success metric to trigger (use OR) * Be explicit about what defines success * Consider multiple testing adjustments ### Power Analysis * Run power analysis before experiment * Ensure adequate sample size for MDE * Consider seasonal effects on sample collection * Account for multiple comparisons in power calculation # Stats Concepts Source: https://confidence-auth-testing.mintlify.io/docs/api/stats/concepts Understand the key concepts in Confidence Stats. This section covers the key concepts in Confidence Stats. The primitives defined by the stats service allow you to both plan and analyze experiments. An analysis consists of an `AnalysisPlan` which is a planning phase description of how you plan to analyze the data, and `AnalysisData` which is the data that you've collected so far. ## Analysis Plan An `AnalysisPlan` is a description of how to compare a set of groups (for example, treatments) to each other, a set of hypotheses about these groups, and a decision rule that encodes how you plan to make a decision on the combined set of results from all hypotheses. The API uses `AnalysisPlan` in the planning phase to calculate power, and in the analysis phase to decide how to analyze the data. ## Comparisons and Groups A `Group` is a unique identifier and an integer weight. The weight is proportional to the group allocation. In an analysis, the `ComparisonSpec` defines how to compare the groups to each other. It has three options: 1) compare all groups to the group designated as baseline, 2) compare all pairs of groups to each other, or 3) compare all listed group pairs. The most common setup is to compare all groups to the control group. ## Hypothesis and Method A `Hypothesis` represents a testable belief about a metric. For example, the change *A* leads to an increase by *X%* in metric *M*. In more technical terms, a hypothesis is a belief about a specific parameter in a statistical model. You test your hypothesis by constructing a model of the data, estimating its parameters and evaluating whether the estimated parameters are consistent with the hypothesis. The analysis method defines these steps. Depending on how your data arises and your experiment design, different analysis methods are appropriate. For example, if you collect new data every day, a sequential analysis is appropriate, whereas a non-sequential method would result in an increased number of false positives. You should carefully select which method to apply. All methods come with a set of assumptions. If some of these assumptions are not satisfied, you shouldn't trust the results. Two common categories of hypotheses are superiority and non-inferiority hypotheses. A superiority hypothesis states that a metric changes in a given direction by some practically meaningful amount set by the experimenter, called the minimum detectable effect (MDE). A non-inferiority hypothesis states that a metric doesn't change more, in a given direction, than some acceptable margin, called the non-inferiority margin (NIM). You define a superiority hypothesis for a relative increase of `3%` as: ```json theme={null} { "superiority": { "preferred_direction": "INCREASE", "minimum_detectable_effect": 0.03 } } ``` You define a non-inferiority hypothesis for a situation where you could accept a relative decrease of `1%` but not more as: ```json theme={null} { "non_inferiority": { "preferred_direction": "INCREASE", "non_inferiority_margin": 0.01 } } ``` ## Decision Rule A decision rule is a logical expression of the significance of a set of hypotheses that determines when you view an analysis as a success. A typical example would be that at least one success metric is significant, while all guardrails are significantly non-inferior. You encode that rule as: ```json theme={null} { "operator": "AND", "items": [ { "rule": { "operator": "AND", "items": ["guardrail1", "guardrail2"] } }, { "rule": { "operator": "OR", "items": ["success1", "success2"] } } ] } ``` That translates to the decision rule `(guardrail1 AND guardrail2) AND (success1 OR success2)`. The decision rule requires you to be explicit about the decision that you aim to take. The rule is the basis for adjusting both the false positive rate and statistical power per hypothesis so that you get the desired overall false positive rate and statistical power. ## Analysis Data The data passed to the analysis differs depending on the method used for analysis. The data also has a certain type that may require a change in the method used for analysis, the two most common data types are binary and continuous. See more in [Run an Analysis](/docs/api/how-to-guides/stats/run-analysis). # Confidence as a Platform (APIs) Source: https://confidence-auth-testing.mintlify.io/docs/confidence-as-a-platform Use Confidence as a true platform and build what you need on top of it. At the foundational level, Confidence provides a set of independent APIs for performing experimentation-related tasks. These APIs are modular and extensible, allowing you to build your own experimentation platform on top of Confidence. Confidence platform APIs with warehouse-native or managed warehouse storage The APIs write events, assignments, and metrics to a data warehouse. You can connect your existing warehouse (warehouse-native), or use a managed warehouse that Confidence provides. With a managed warehouse, Confidence takes care of storage for you. The main APIs are: * **Flags**: Control experiences using feature flags. * **Events**: Collect data from your users and store it in a data warehouse. * **Metrics**: Define and compute metrics. * **Stats**: Perform statistical testing and analysis. * **Workflows**: Implement workflows to orchestrate experimentation designs. ## Highlights of the Confidence APIs * **Extensible**: Confidence is by design extensible. You can build your own experimentation platform on top of Confidence by using the APIs. Leverage the parts of Confidence that makes sense for you, and build the rest yourself. * **Warehouse-centric**: Use your existing warehouse, or a managed warehouse that Confidence provides and operates. Warehouse-native keeps data in your infrastructure. A managed warehouse lets Confidence take care of storage for you. * **Usage-based pricing**: You only pay for what you use. The price you pay depends on what features you use and how much you consume. You can start small and scale up as your experimentation program grows, without having to worry about upfront costs. * **Built for scale**: Confidence supports large-scale experimentation programs, helping you with coordination and planning of experiments across teams and products. Use it with hundreds of teams to run thousands of experiments. ## Learn More Read more about the independent APIs that allow you to integrate Confidence with your existing tooling and infrastructure: You can follow the [API quickstart](../docs/api/quickstart) tutorial to learn how to make your first API call. Read more about how the APIs work in the [API basics](../docs/api/api-basics) section. # Warehouse-Native Confidence Source: https://confidence-auth-testing.mintlify.io/docs/data-warehouse-native Warehouse-Native Confidence is a modern experimentation platform that runs on top of your warehouse. Data integrity is a core value of Confidence. Warehouse-Native Confidence runs on top of your data warehouse, so you can be confident that your data is safe, right, and up to date. You have full transparency into what Confidence does with your data, and you can audit and reproduce calculations. ## How Confidence Interacts With Your Data Warehouse Depending on the functionality you want to use, Confidence needs access to read from and write to your data warehouse. Confidence needs write access to write: * general events that you log using the events service * assignments when you resolve flags * exposure tables calculated from assignment events Confidence needs read access to read: * assignments to calculate exposure * data you want to use to calculate metrics The figure below gives a high-level overview of how the events, metrics, and flags services in Confidence read and write to your data warehouse. You can use only a subset of these services. In that case, only the relevant parts of the diagram apply. Overview of how Confidence connects to your data warehouse ## Queries in Your Data Warehouse To calculate exposure and metrics, Confidence runs queries in your data warehouse. You can read more on the [metrics page](./metrics/introduction#how-confidence-computes-metrics). ### Permissions You can grant Confidence access only to the relevant tables in your data warehouse. You don't need to grant global access to your entire data warehouse. ### Data Cache Confidence caches aggregated results of metrics in its database to improve performance. The cache only includes the aggregated results of metrics, not the underlying data. For basic metrics, this means that Confidence stores the daily count, mean and variance for each treatment group. ## Transient Data in Confidence Flags With Confidence Flags and the managed resolver, data temporarily passes through Confidence. The information that Confidence persists is: * The number of resolves and the timestamp of the last resolve. * The number of applies and the timestamp of the last apply. * The names of the fields available in the context. The values of the fields in the context are never stored. Read more on the [data transfer page](./flags/introduction#data-transfer). # Analyze Results Source: https://confidence-auth-testing.mintlify.io/docs/experiments/analyze-results Understand what your results mean and what to do next. Confidence provides metric results by comparing the treatments using hypothesis tests to see if the differences are statistically significant. The exact nature of the tests vary depending on the type and role of the metrics. Ultimately, Confidence gives an overall shipping recommendation that summarizes the multidimensional results to one single recommendation. ## Spotlight For both running and ended experiments, you need to make a decision—whether a tested feature was good enough to reach the full market or if an ongoing experiment should continue or if you should stop it. When deciding what to do, you should always take a step back and consider all the pros and cons of the decisions you are making. Involve people with different roles in these decisions. To help you in deciding what to do, Confidence provides a recommendation in the **Spotlight** section on the **Result** tab. The recommendation summarizes the outcomes for the multiple metrics used in the experiment. For an experiment that is live and configured to display results continuously, the possible recommendations are: * **Ship**. Confidence recommends to ship the change if: * at least one success metric has evidence of improvement * all guardrail metrics meet their tolerance levels if you use a non-inferiority margin; if not, they should show no evidence of deterioration * no evidence of a deterioration in any metric or of a sample ratio mismatch In this case, there is conclusive evidence that the change you are testing improves at least one metric without doing so while guardrails are acceptable. * **Continue**. If there's no evidence that you should ship, Confidence recommends to continue the experiment as long as there are no signs of deterioration or sample ratio mismatch. * **End**. Confidence recommends to end the experiment if you use success metrics with minimum detectable effects and all success metrics have reached powered but none is significant. * **Abort**. Confidence recommends to stop the experiment if there is evidence of deterioration or a sample ratio mismatch. When you end an experiment, the recommendations focus on what to do next. The **Continue**, **End** and **Abort** recommendations change into a **Don't ship** recommendation, as there is no evidence of an improvement that would suggest shipping. For ended experiments, the Spotlight section includes an **Explore** option. Click it to create an [Exploration](./exploration) directly from the Spotlight recommendation. This lets you dig deeper into the results that informed the recommendation. ## Health Checks Confidence provides health checks to help you understand the quality of your experiment. ### Incoming Traffic The incoming traffic health check verifies that your experiment receives traffic. The check confirms that the flag rule your experiment controls receives resolves from clients, that these resolves are also applied, and that all groups in the experiment have exposure calculated. ### Balanced Traffic The balanced traffic health check verifies that the proportion of exposure attributed to each group follows the allocation that you set up for the experiment. If there is an imbalance, the results are not reliable. This check uses what is commonly referred to as a sample ratio mismatch test. ### No Metric Deterioration The no metric deterioration health check verifies that the metrics you track, including both success and guardrail metrics, do not show any evidence of deterioration. If a metric deteriorates, you have a clear sign that the treatment isn't working as intended. ## Metrics Confidence presents the results for individual metrics in various ways to help you learn as much as possible from your tests. ### Significance Significant means that if there is no effect, then it's unlikely that the observed result is accidental due to the natural variation in the data. Alpha specifies the threshold for significance, and thus the expected rate of false positives. Default alpha for Confidence is 5%, which is further adjusted to account for [multiple comparisons](/docs/experiments/statistical-settings). You should interpret significance differently for success and guardrail metrics: | | Significant | Not significant | | :----------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------- | | Success metric | You have statistical evidence for a change/increase/decrease due to the treatment. | You lack statistical evidence for a change/increase/decrease due to the treatment. | | Guardrail metric (with NIM) | You have statistical evidence that the metric has not increased more than/not decreased more than the specified non-inferior margin (NIM). | You lack statistical evidence that the metric has not increased more than/not decreased more than NIM. | | Guardrail metric (without NIM) | You have statistical evidence that the metric deteriorates. | You lack statistical evidence that the metric deteriorates. | ### Results Estimates and Confidence Intervals The results for the comparisons between treatment and control give a point estimate and a confidence interval. The point estimate always lies in the middle of the confidence interval. The estimated effect of the treatment is uncertain, and the confidence interval describes the degree of uncertainty. If you would repeat the experiment 100 times, the confidence interval should cover the true effect of the treatment in 95% of the experiments if alpha is 5%. With the same alpha, a given experiment's confidence interval covers the true effect of the treatment with 95% confidence. Confidence displays the point estimate and confidence interval on the *relative* scale. The effects are always reported as a % change relative to the control group. This makes it easier to compare and visualize effect sizes across metrics. ### Result Visualization You can view the difference between treatments and control on the **Result** tab of the experiment. For each comparison between a treatment and control, you see the results visualized using a confidence interval. If you're analyzing the results sequentially, you can click the expand icon to see a timeline graph. ### Detailed Results If you click **Detailed results**, you can see more details about the analysis of the metrics in your experiment. Here you can find the following information: * **Powered effect** shows the effect size that you have the power to detect with the current sample size. For example, if you set the power for the experiment to 80%, then a powered effect of 10% means that based on the users that have been exposed to the experiment so far, you have a 80% power to detect a 10% effect size. Note here that the 10% is *relative* to the control group. * **Sample size** the number of exposed users in each group. * **Time** the last time point Confidence analyzes the metric. * **Adjusted alpha** the multiple testing corrected alpha for the metric. * **Adjusted power** the decision rule corrected power for the metric. * **Variance reduction** the percentage of variance that pre-exposure data was able to reduce (Confidence displays `N/A` if you disable variance reduction). ### Learn More To learn more about your results, use an [Exploration](./exploration). Here you can add more metrics and split the results by various dimensions. You can also click **Detailed results** to get more details about the metrics in your experiment. Choose between different types of visualizations, and add more columns to see more details. ## Record Your Decision After an experiment ends, you should record the outcome and reasoning. This creates an institutional record of experiment learnings that your team can reference later. On the **Result** tab of an ended experiment, the **Decision** section appears at the top of the page. It contains: * **Outcome**—a dropdown list where you select what you decided to do based on the results (for example, ship or don't ship). By default, this shows "Not selected". * **Conclusion**—a text field where you write a brief summary of the decision and the reasoning behind it. ## Roll Out a Successful Variant When your results show a clear winner, you can roll out the winning variant directly from the experiment. This option is available for A/B tests with two treatments (control and one treatment variant). Click **Roll out** in the actions section of a live A/B test to convert it to a [rollout](./workflows/rollouts). This distributes the winning variant to all users without manually configuring the flag. The rollout preserves the experiment's metrics and configuration so you can continue to monitor the impact as you scale up. ## Related Resources Deep dive into results analysis Understand the statistics Step-by-step exploration guide # Audience Source: https://confidence-auth-testing.mintlify.io/docs/experiments/audience The audience is the set of users or other units that you want to make eligible for an experiment. An audience definition uses: * inclusion criteria that decide what units to include * allocation that sets the percentage of the included population to run the experiment on * a targeting key that specifies the field in the evaluation context to randomize traffic based on * exclusivity to control the behavior of the experiment in relation to other experiments, rules, and segments ## Inclusion Criteria Inclusion criteria define which units are eligible for the experiment. You can combine multiple criteria types: * **Attributes**: Target users based on evaluation context fields like country, platform, or version. * **Segments**: Target users who belong to a pre-defined [segment](/docs/flags/segments), letting you reuse the same audience across experiments. * **Holdbacks**: Include or exclude a random subset of users defined by a [holdback](/docs/surfaces/surface-settings#holdbacks) on a surface. * **Groups**: Combine multiple criteria with `AND` or `OR` operators to build complex targeting logic. Learn how to configure these criteria in the [Define the Audience](/docs/how-to-guides/define-audience-criteria) guide. For more details about allocation, randomization, and the targeting key, go to the [audience](/docs/flags/audience) page for flags. ## Randomization Confidence uses randomization to assign variants to users. To randomize, Confidence needs to know which field in the evaluation context it should take the value from. Read more in the [flag documentation](/docs/flags/audience#randomization). ## Sticky Assignment Under **advanced options** in the **audience section** you can enable sticky assignments. When you enable sticky assignments, Confidence writes all assignments to a storage that is accessible at resolve time with low latency. Read more about sticky assignment in the [flags documentation](/docs/flags/audience#sticky-assignments). ## Related Resources Deep dive into audience configuration Configure targeting criteria Set up mutual exclusion Configure experiment variants # Comments Source: https://confidence-auth-testing.mintlify.io/docs/experiments/comments With comments you can work together on your experiment with team mates. Add comments to the experiment design or its results. Comments Get pinged on Slack when someone mentions you or replies to your comment by [connecting your personal Slack account with Confidence](/docs/how-to-guides/connect-personal-slack). ## Overview Comments and reviews are a great way to work together on your experiment with teammates. You can comment on "comment zones" on the experiment pages or by submitting a review. To see which comment zones are available, click the comment icon in the top right and you see the zones highlight for a brief second. As you hover over comment zones on the page, they highlight and you can click to add a comment. To comment by submitting a review, click the thumbs up and down icon on the sidebar. If a comment zone already has a comment, it has a badge with the number of threads on it. Clicking on the badge opens the comment sidebar and selects the thread so that you can add a comment to it. ## Add a Comment To add a comment to the experiment, click the comment icon in the top right corner of the experiment design. To add a comment: 1. Go to a workflow such as an A/B test or rollout. 2. Click on the comment icon next to the experiment name. The comment sidebar opens on the right side of the page. 3. Click on a comment zone on the workflow where you want to add a comment. The zones flash briefly when you open the sidebar to indicate where you can add comments. 4. Type your comment and press Shift + Enter to post. Mention a team mate in a comment by typing @ and selecting their name from the list. A mentioned team mate can be assigned to the thread. Assigned threads shows up on the user's home page under the "Your to-do list" section. ## Comment on a Thread Threads organize comments for you. A thread is a group of related comments. You can add a comment to a thread by selecting it, which reveals an input field where you can type your comment. ## Resolve Threads You can resolve a thread by clicking the checkmark icon in the top right corner of the thread. Resolved threads are by default hidden. You can show resolved threads by toggling the `Show resolved threads` switch in the top right corner of the comments section. ## Comments in Reviews When you review an experiment, you can add a comment with [the review](./reviews). This comment shows up in the comment section like all other comments. ## Related Resources Request and give reviews Get comment notifications Share experiment findings Configure notification settings # Minimum Detectable Effects and Non-Inferiority Margins Source: https://confidence-auth-testing.mintlify.io/docs/experiments/design/effect-sizes Use minimum detectable effects for your success metrics to run power analyses and understand how much traffic you need. Set non-inferiority margins for your guardrail metrics to define acceptable tolerance levels for potential metric degradation. When planning an experiment, [power analyses](./power) help you find the sample size needed for your metrics to reach the desired power. Power is a function of effect size. All power analyses calculate the required sample size for the effect sizes you want to detect. Smaller effects are harder to detect and require larger sample sizes. ## Minimum Detectable Effects For success metrics, the effect size is the minimum detectable effect (MDE), which represents the smallest effect you want to be able to detect. Use the MDE to design your experiment so that it has enough statistical power to detect meaningful effects. Picking the MDE is a trade-off between: * The smallest effect that is still relevant for the business * The smallest effect that is practically measurable As an experimenter, use your domain expertise and discuss with stakeholders to decide the smallest effect you would consider meaningful. Then, calculate the required sample size. If the sample size needed to detect your chosen MDE is unrealistically large, you need to increase the MDE. Note: the MDE is a required input to the power analysis, but does not impact the calculation of results. Set the minimum detectable effect size to the smallest effect that you and your stakeholders care about. This ensures your A/B test can detect effects that are meaningful to the business. In other words, if the true effect is smaller than the MDE and you fail to detect it, it doesn't matter because the improvement would be too small to justify shipping anyway. Larger effects are easier to detect than smaller effects, while a smaller MDE requires a larger sample size. ## Non-Inferiority Margins Confidence uses a different statistical test for guardrail metrics than for success metrics. These tests, called [non-inferiority tests](/docs/experiments/stats/stat-tests), verify that the metric performs better than a specified non-inferiority margin (NIM). The non-inferiority margin is essentially a tolerance level—you accept a small amount of degradation in the guardrail metric, but it must not worsen beyond the NIM. The non-inferiority margin (NIM) is a tolerance threshold that helps you gather evidence to rule out the possibility that the metric deteriorates by more than the NIM. This choice affects both the power analysis and the results calculations. Unlike the MDE for success metrics, the statistical tests for guardrail metrics directly use the NIMs in the hypothesis tests. Because of this, the NIM serves dual purposes: it's both an effect size for the power analysis and a tolerance threshold in the statistical test itself. Smaller NIMs require larger sample sizes because it becomes harder to gather enough evidence that the metric stays within a tighter tolerance range. ## How to Find the Smallest Practically Measurable Effect Follow these steps to quickly understand what effect sizes are practically measurable in your experiments. 1. **Assess how large your experiments can be.** * Do you need to run multiple experiments in parallel? For example, if you need to run 4 experiments simultaneously on the same population, each experiment can only use 100/4=25% of users. * Do you want to limit exposure to a new variant because the changes are risky? For example, if your experiments typically have 10,000 users, calculate what effect size you have enough power to detect with this sample size. 2. **Decide if the detectable effect size is small enough for your business needs.** * If the smallest detectable effect is small enough, select a value slightly larger than the smallest effect you can detect with enough power. Remember that sample size calculations are estimates with inherent uncertainty. * If the smallest detectable effect is too large, consider these options: * **Change the metric.** Variance can vary widely between metrics measuring similar aspects of user behavior. A lower-variance metric is more sensitive, giving you a higher chance of detecting effects. * **Adjust alpha and power.** You can detect smaller effect sizes with the same sample size if you can tolerate more risk. Increase alpha to accept increased false positive results (shipping changes with no real effect). Decrease power to accept increased false negative results (failing to ship changes with positive effects). ## Related Resources Understand statistical power Calculate required sample sizes Configure success and guardrail metrics Configure alpha and power # Hypothesis Source: https://confidence-auth-testing.mintlify.io/docs/experiments/design/hypothesis Formulate a clear hypothesis that you can test with an experiment. You should start the design of an experiment by specifying a clear hypothesis that can be quantitatively tested to inform your decision-making. ## How to Set Up a Hypothesis A well-formulated hypothesis is a specific assumption that can be conclusively tested through an experiment. Not all hypotheses are equally effective. An effective hypothesis should be: * a statement, not a question * clear about what experiment outcomes would support or weaken it * clear about the key variables * grounded in past research/learnings * written with as few assumptions as possible It's also important to consider what decision you make based on the experiment results. By articulating the decision you want to make, you ensure that your hypothesis statement reflects the intentions of your team and drives actionable outcomes. To convert your idea into a testable hypothesis, use the following template as a starting point: > **Doing this/building this feature/creating this experience** for > **these people/personas** should result in a change in their behavior, as measured by > **success metrics**. The data supports the hypothesis if the **success metrics** > change by **the minimum detectable effect**. You can read more about minimum detectable effects (MDE) on the [effect sizes page](./effect-sizes). ## Example Hypothesis Imagine your team is building an autoplay feature for the Spotify mobile app. Your team's goals are: 1. Make it easier for people to continue listening when their content ends. 2. Lead users to listen to more content curated by Spotify. The autoplay feature depends on Radio, which is one type of curated content. There happens to be a company objective to increase the percentage of content hours curated by Spotify, so your team decides to choose this as the success metric for your experiment. Your team would decide to roll out this feature if it increases the success metric without harming some general guardrail metrics. Here's an example hypothesis statement: > **Continuing to play music or podcasts when a play context ends** for > **all users** should result in **users listening to more of Spotify's > curated content rather than searching for something else to play themselves**, > as measured by **percent programmed content**. The data supports the hypothesis if > the **change in percent programmed content** increases by **2.5pp**. ## Composite Hypothesis Many experiments use one or two success metrics and a few guardrail metrics. In this scenario you should write a hypothesis statement for each success metric, while for the guardrails it's generally enough to just state the hypothesis that the treatment does not deteriorate the guardrail metrics more than the acceptable margins (known as non-inferiority margins). Consider the earlier example of the Autoplay experiment. The guardrail metrics are the skip rate of programmed content and the app crash rate. To also include the guardrail metrics, change the hypothesis statement as follows: > Continuing to play music or podcasts when a play context ends for all > users should result in users listening to more of Spotify's curated > content rather than searching for something else to play themselves, as > measured by percent programmed content. The data supports the hypothesis if > the percent programmed content increases by 2.5pp, while the app crash rate > and the programmed content skip rate don't increase by more than the acceptable margins. The hypothesis statements for the success metrics intend to capture a change in user behavior that is measurable by some metric. For guardrail metrics, expect no change, or only a small one. In settings like this, you need to define the decision rule for a successful experiment upfront. For example, if the treatment significantly improves one success metric, but there is no evidence of non-inferiority on the guardrail metrics, should you ship this variant or not? Have you found enough evidence that this variant is better than the current default version? Read more about the [decision rules](/docs/experiments/analyze-results). ## Related Resources Configure MDE and NIM settings Configure success and guardrail metrics Understand decision rules Run your experiment # Alpha and Power Source: https://confidence-auth-testing.mintlify.io/docs/experiments/design/power Understand risks, how to control them, and what affects your chances of finding effects. Experimentation is about understanding and controlling risks. Two concepts are central to managing risk in experimentation: alpha and power. ## Alpha Alpha is the false positive rate, which describes how often false positives occur. A false positive happens when you conclude an effect exists when in reality it doesn't. For example, suppose you run an experiment and the results show that conversion has increased. If the truth is that there is no real effect and conversion didn't actually increase because of the treatment, you have observed a false positive result. Because data is inherently noisy, the false positive rate can never be completely zero, so you must choose an acceptable level of risk. Alpha is commonly set to 5% in many sciences, which is also the default for Confidence. The alpha you choose determines the rate at which you are willing to accept false positives across repeated experiments. Depending on the consequences of shipping a feature that truly has no effect, you may want to decrease (more conservative) or increase (less conservative) this value. In an ideal world, you don't want any false positive results at all, but setting a low alpha makes it harder to detect effects that truly exist. Setting alpha is a balancing act between the risk of finding effects when there are none (false positives) and missing effects that really do exist (false negatives). Common values for alpha are 1%, 5%, and 10%. Higher alphas are often used in early stage experiments that seek to identify promising variants for more rigorous testing later. ## Power Statistical power describes the probability of detecting an effect when there truly *is* an effect of a particular size. It determines your ability to separate signal from noise, with higher power meaning better chances of finding effects when they exist. Power is also known as the true positive rate, and equals 1 minus the false negative rate. Power is commonly set to 80% in many sciences, which is also the default for Confidence. Depending on the consequences of missing a true effect, you may want to adjust this value. The power level relates to the risks of magnitude (type-M) and sign (type-S) errors. When an experiment has low power, there is a higher risk that significant effects it detects are either overestimated or even have the wrong sign (positive vs. negative). ## Power Analysis Power analysis is the process of determining the minimum number of users required to reach a desired level of statistical power. While it's often called "sample size calculation," this represents the minimum number of users needed to detect a desired effect size with a given level of confidence, not necessarily the total number of users exposed in an experiment. The analysis takes several inputs as outlined below, and outputs the minimum number of users required to achieve the desired level of power. ### Alpha and Power You set alpha and power according to your tolerance for false positive or false negative errors. By default, Confidence sets alpha (the false positive rate) to 5% and the power level to 80%, but you can adjust them based on your risk tolerance. Lowering alpha or increasing the power level increases your confidence in your measured results and your ability to detect significant effects, but it also increases the number of users required for your experiment. ### Experiment Intake Experiment intake is the number of days at the start of an experiment during which you include newly exposed users in metric calculations. For example, if you run your experiment for 14 days and want to measure "Consumption during Week 1," your intake is 7 days. The intake period is typically determined by how long the experiment can feasibly run. To avoid seasonality effects, the intake period should ideally be a multiple of 7 days. A longer experiment duration delays decision-making, but enables the experiment to expose more users and helps achieve the desired statistical power. ### Metrics You should select your metrics according to the [hypothesis](./hypothesis) of the experiment. The variance of your selected metrics significantly affects the required sample size—high-variance metrics require many more users to detect small effect sizes. The number of metrics also affects the required sample size because [multiple testing corrections](../stats/adjustment-multiple-comparisons) impact the adjusted levels of alpha and power in the experiment. The minimum detectable effect (MDE) is the smallest effect size you want to be able to measure to make a decision. The sample size calculation uses the MDE to decide how many users you need to detect this effect with a probability equal to the power level. The number of users required is inversely proportional to the square of the MDE, which means measuring small changes requires many more users. The MDE should be both meaningful and realistic. If you set the MDE too high, you may miss effects that would impact your decision. If you set the MDE too low, it may be impossible to achieve the desired power with a realistic number of users in reasonable time. You should ideally set the MDE based on product requirements for decision-making and a meta-analysis of effect sizes observed in prior experiments. As a last resort, consider Cohen's Recommendations: * Small effect: 1% of the variance ("too small to detect other than statistically; lower limit of what is clinically relevant") * Medium effect: 6% of the variance ("clear with careful observation") * Large effect: 15% of the variance ("clear with a superficial glance; unlikely to be the focus of research because it's too obvious") The minimum detectable effect (MDE) is the effect size used for success metrics. For guardrail metrics, the effect size is the non-inferiority margin (NIM). ### Number of Variants Each variant you add increases the multiple testing correction and, as a result, the number of users required. The probability of observing a significant result by chance increases with the number of comparisons, which requires adjustments for multiple comparisons. For example, with 2 variants you have 1 comparison, but with 3 variants you have 2 comparisons (each compared to control). It's important to carefully consider the number of variants before running your experiment— only include variants you're genuinely interested in testing. ### Treatment Sizes An equal split between treatment and control minimizes the number of required users, but carries higher risk because the experiment exposes more users to the new, unproven variant. ## Related Resources Calculate required sample sizes Configure MDE and NIM settings Configure alpha and power Step-by-step sample size guide # Mutually Exclusive Experiments Source: https://confidence-auth-testing.mintlify.io/docs/experiments/exclusive-experiments Use exclusivity groups to prevent users from being exposed to multiple conflicting experiments at the same time. Make experiments exclusive to other experiments by ensuring that they have at least one exclusivity group in common. For example, make two A/B tests exclusive to each other by adding the same exclusivity group to both A/B tests. No overlap means that no user or other entity is in both of these experiments at the same time. See the [audience](./audience) page on experiments for more information about exclusivity when running experiments. Using exclusivity groups, you can coordinate experiments that change the same or similar parts of an experience and make them exclusive to each other. For example, use exclusivity if you want to run multiple related experiments, but you want to only expose users to one of the experiments. If you don't make the experiments exclusive to each other, all the multiple experiments can expose a given user. Watch this video to get a quick overview of how to use exclusivity groups to coordinate experiments in Confidence.