statsig Layers API
Manage layers that enable sharing parameters across multiple experiments while maintaining mutual exclusivity.
Manage layers that enable sharing parameters across multiple experiments while maintaining mutual exclusivity.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/statsig-layers-api"
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Statsig Layers API
contact:
name: Statsig Support
url: https://statsig.com/support
termsOfService: https://statsig.com/terms
version: '1.0'
description: 'Operations tagged Layers across 2 of this provider''s published API definitions: statsig-console-api-openapi.yml, statsig-http-api-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://statsigapi.net/console/v1
description: Statsig Console API Server
- url: https://api.statsig.com/v1
description: Statsig API Server
tags:
- name: Layers
description: Manage layers that enable sharing parameters across multiple experiments while maintaining mutual exclusivity.
paths:
/layers:
get:
operationId: listLayers
summary: List all layers
description: Retrieves a list of all layers in the project.
tags:
- Layers
parameters:
- $ref: '#/components/parameters/ApiVersion'
- $ref: '#/components/parameters/Limit'
- $ref: '#/components/parameters/Page'
responses:
'200':
description: List of layers
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Layer'
pagination:
$ref: '#/components/schemas/Pagination'
'401':
$ref: '#/components/responses/Unauthorized'
security:
- consoleApiKey: []
post:
operationId: createLayer
summary: Create a layer
description: Creates a new layer in the project for sharing parameters across multiple experiments.
tags:
- Layers
parameters:
- $ref: '#/components/parameters/ApiVersion'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/LayerCreate'
responses:
'201':
description: Layer created successfully
content:
application/json:
schema:
$ref: '#/components/schemas/Layer'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
security:
- consoleApiKey: []
servers:
- url: https://statsigapi.net/console/v1
description: Statsig Console API Server
/layers/{id}:
get:
operationId: getLayer
summary: Get a layer
description: Retrieves the full configuration of a specific layer including its parameters and associated experiments.
tags:
- Layers
parameters:
- $ref: '#/components/parameters/ApiVersion'
- name: id
in: path
required: true
schema:
type: string
description: The name or identifier of the layer.
responses:
'200':
description: Layer details
content:
application/json:
schema:
$ref: '#/components/schemas/Layer'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
security:
- consoleApiKey: []
delete:
operationId: deleteLayer
summary: Delete a layer
description: Permanently deletes a layer from the project.
tags:
- Layers
parameters:
- $ref: '#/components/parameters/ApiVersion'
- name: id
in: path
required: true
schema:
type: string
description: The name or identifier of the layer.
responses:
'200':
description: Layer deleted successfully
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
security:
- consoleApiKey: []
servers:
- url: https://statsigapi.net/console/v1
description: Statsig Console API Server
/layers/{id}/experiments:
get:
operationId: listLayerExperiments
summary: List experiments in a layer
description: Retrieves the list of experiments associated with a specific layer.
tags:
- Layers
parameters:
- $ref: '#/components/parameters/ApiVersion'
- name: id
in: path
required: true
schema:
type: string
description: The name or identifier of the layer.
responses:
'200':
description: List of experiments in the layer
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Experiment'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
security:
- consoleApiKey: []
servers:
- url: https://statsigapi.net/console/v1
description: Statsig Console API Server
/get_layer:
post:
operationId: getLayer
summary: Get layer parameters
description: Fetches parameter values from a layer for the specified user. Layers allow sharing parameters across multiple experiments. An exposure event is logged only when a specific parameter is accessed.
tags:
- Layers
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- user
- layerName
properties:
user:
$ref: '#/components/schemas/StatsigUser'
layerName:
type: string
description: The name of the layer to retrieve.
responses:
'200':
description: Layer parameter values
content:
application/json:
schema:
type: object
properties:
name:
type: string
description: The name of the layer.
value:
type: object
description: The JSON object containing the layer parameter values for this user.
rule_id:
type: string
description: The identifier of the rule that was matched.
group_name:
type: string
description: The name of the group the user was assigned to.
'401':
$ref: '#/components/responses/Unauthorized'
security:
- statsigApiKey: []
servers:
- url: https://api.statsig.com/v1
description: Statsig API Server
components:
responses:
BadRequest:
description: Invalid request parameters
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: Error message describing what was wrong with the request.
NotFound:
description: Resource not found
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: Error message indicating the resource was not found.
Unauthorized:
description: Missing or invalid API key
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: Error message describing the authentication failure.
parameters:
Page:
name: page
in: query
required: false
schema:
type: integer
minimum: 1
description: Page number for paginated results.
Limit:
name: limit
in: query
required: false
schema:
type: integer
minimum: 1
maximum: 100
description: Maximum number of items to return per page.
ApiVersion:
name: STATSIG-API-VERSION
in: header
required: false
schema:
type: string
default: '20240601'
description: The Console API version. Currently the only version is 20240601.
schemas:
LayerCreate:
type: object
description: Request body for creating a new layer.
required:
- name
properties:
name:
type: string
description: The name of the layer to create.
description:
type: string
description: A human-readable description.
parameters:
type: object
description: The default parameter values for the layer.
ExperimentGroup:
type: object
description: An experiment group defining parameter values for a set of users.
properties:
name:
type: string
description: The name of the group (e.g., control, test).
size:
type: number
minimum: 0
maximum: 100
description: The percentage of allocated users assigned to this group.
parameterValues:
type: object
description: The parameter key-value pairs for this group.
Layer:
type: object
description: A layer that enables sharing parameters across multiple experiments while maintaining mutual exclusivity.
properties:
id:
type: string
description: The unique identifier of the layer.
name:
type: string
description: The name of the layer.
description:
type: string
description: A human-readable description of the layer.
parameters:
type: object
description: The default parameter values for the layer.
experiments:
type: array
items:
type: string
description: The IDs of experiments associated with this layer.
createdTime:
type: integer
format: int64
description: Timestamp when the layer was created.
Experiment:
type: object
description: An A/B test experiment with defined groups, parameters, and analysis configuration.
properties:
id:
type: string
description: The unique identifier of the experiment.
name:
type: string
description: The name of the experiment.
description:
type: string
description: A human-readable description of the experiment.
hypothesis:
type: string
description: The hypothesis being tested by this experiment.
status:
type: string
enum:
- setup
- active
- decision_made
- abandoned
description: The current status of the experiment.
groups:
type: array
items:
$ref: '#/components/schemas/ExperimentGroup'
description: The experiment groups and their parameter configurations.
allocation:
type: number
minimum: 0
maximum: 100
description: The percentage of eligible users allocated to the experiment.
layerID:
type: string
description: The layer this experiment belongs to, if any.
targetingGateID:
type: string
description: The gate used to filter eligible users for the experiment.
tags:
type: array
items:
type: string
description: Tags associated with the experiment.
createdTime:
type: integer
format: int64
description: Timestamp when the experiment was created.
lastModifiedTime:
type: integer
format: int64
description: Timestamp when the experiment was last modified.
Pagination:
type: object
description: Pagination metadata for list responses.
properties:
total:
type: integer
description: Total number of items available.
page:
type: integer
description: Current page number.
limit:
type: integer
description: Number of items per page.
hasMore:
type: boolean
description: Whether more pages are available.
StatsigUser:
type: object
description: The user object representing the end user being evaluated. At minimum, a userID should be provided. Additional properties enable more sophisticated targeting.
properties:
userID:
type: string
description: A unique identifier for the user.
email:
type: string
format: email
description: The email address of the user, used for email-based targeting.
ip:
type: string
description: The IP address of the user, used for IP-based targeting.
userAgent:
type: string
description: The user agent string, used for browser or device targeting.
country:
type: string
description: The two-letter country code of the user.
locale:
type: string
description: The locale identifier for the user.
appVersion:
type: string
description: The version of the application the user is using.
custom:
type: object
additionalProperties: true
description: Custom properties for the user, used for custom targeting rules.
privateAttributes:
type: object
additionalProperties: true
description: Private user attributes used for evaluation but stripped before logging to Statsig servers.
customIDs:
type: object
additionalProperties:
type: string
description: Custom identifier mappings for the user, such as companyID or teamID.
securitySchemes:
consoleApiKey:
type: apiKey
in: header
name: STATSIG-API-KEY
description: Console API Key created in Project Settings > API Keys tab. Required for all Console API requests.
statsigApiKey:
type: apiKey
in: header
name: statsig-api-key
description: API key for authentication. Use a Server Secret Key for secure server-side requests or a Client-SDK Key for client-side applications.
x-refined-from:
- statsig-console-api-openapi.yml
- statsig-http-api-openapi.yml