For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Sign inTry it free
DocsGuidesSDKsIntegrationsAPI docsTutorialsFlagship blog
DocsGuidesSDKsIntegrationsAPI docsTutorialsFlagship blog
  • REST API overview
    • Access Tokens
    • Account Members
    • Account Usage Beta
    • AI Configs
    • Announcements
    • Applications Beta
    • Approvals
    • Approvals Beta
    • Audit Log
    • Code References
    • Contexts
    • Context Settings
    • Custom Roles
    • Data Export Destinations
    • Environments
    • Experiments
    • Feature Flags
    • Feature Flags Beta
    • Flag Import Configurations Beta
    • Flag Links Beta
    • Flag Triggers
    • Follow Flags
    • Holdouts Beta
    • Insights Charts Beta
    • Insights Deployments Beta
    • Insights Flag Events Beta
    • Insights Pull Requests Beta
    • Insights Repositories Beta
    • Insights Scores Beta
    • Integration Audit Log Subscriptions
    • Integration Delivery Configurations Beta
    • Integrations Beta
    • Layers
      • POSTCreate layer
      • GETGet layers
      • PATCHUpdate layer
    • Metrics
    • Metrics Beta
    • OAuth2 Clients
    • Persistent Store Integrations Beta
    • Projects
    • Relay Proxy Configurations
    • Release Pipelines Beta
    • Releases Beta
    • Scheduled Changes
    • Segments
    • Tags
    • Teams
    • Teams Beta
    • Users
    • Users Beta
    • User Settings
    • Views Beta
    • Webhooks
    • Workflows
    • Workflow Templates
    • Other
Sign inTry it free
LogoLogo
REST API overviewLayers

Create layer

POST
/api/v2/projects/:projectKey/layers
POST
/api/v2/projects/:projectKey/layers
$curl -X POST https://app.launchdarkly.com/api/v2/projects/projectKey/layers \
> -H "Authorization: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "key": "checkout-flow",
> "name": "Checkout Flow",
> "description": "string"
>}'
1{
2 "key": "checkout-flow",
3 "name": "Checkout Flow",
4 "description": "The checkout flow for the application",
5 "createdAt": 1,
6 "randomizationUnit": "user",
7 "environments": {}
8}

Create a layer. Experiments running in the same layer are granted mutually-exclusive traffic.

Was this page helpful?
Previous

Get layers

Next
Built with

Authentication

Authorizationstring
API Key authentication via header

Path parameters

projectKeystringRequiredformat: "string"
The project key

Request

This endpoint expects an object.
keystringRequired
Unique identifier for the layer
namestringRequired
Layer name
descriptionstringRequired
The checkout flow for the application

Response

Layer response
keystring
The key of the layer
namestring
The name of the layer
descriptionstring
The description of the layer
createdAtlong
The date and time when the layer was created
randomizationUnitstring
The unit of randomization for the layer
environmentsmap from strings to objects
The layer configurations for each requested environment

Errors

400
Bad Request Error
403
Forbidden Error
404
Not Found Error
429
Too Many Requests Error