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
      • POSTCreate environment
      • DELDelete environment
      • GETGet environment
      • GETList environments
      • POSTReset environment mobile SDK key
      • POSTReset environment SDK key
      • PATCHUpdate environment
    • 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
    • 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 overviewEnvironments

Reset environment SDK key

POST
/api/v2/projects/:projectKey/environments/:environmentKey/apiKey
POST
/api/v2/projects/:projectKey/environments/:environmentKey/apiKey
$curl -X POST https://app.launchdarkly.com/api/v2/projects/projectKey/environments/environmentKey/apiKey \
> -H "Authorization: <apiKey>"
1{
2 "_links": {
3 "self": {
4 "href": "/api/v2/projects/my-project/environments/my-environment",
5 "type": "application/json"
6 }
7 },
8 "_id": "57be1db38b75bf0772d11384",
9 "key": "environment-key-123abc",
10 "name": "My Environment",
11 "apiKey": "sdk-xxx",
12 "mobileKey": "mob-xxx",
13 "color": "F5A623",
14 "defaultTtl": 5,
15 "secureMode": true,
16 "defaultTrackEvents": false,
17 "requireComments": true,
18 "confirmChanges": true,
19 "tags": [
20 "ops"
21 ],
22 "critical": true,
23 "_access": {
24 "denied": [
25 {
26 "action": "string",
27 "reason": {
28 "effect": "allow",
29 "resources": [
30 "proj/*:env/*;qa_*:/flag/*"
31 ],
32 "notResources": [
33 "string"
34 ],
35 "actions": [
36 "*"
37 ],
38 "notActions": [
39 "string"
40 ],
41 "role_name": "string"
42 }
43 }
44 ],
45 "allowed": [
46 {
47 "action": "string",
48 "reason": {
49 "effect": "allow",
50 "resources": [
51 "proj/*:env/*;qa_*:/flag/*"
52 ],
53 "notResources": [
54 "string"
55 ],
56 "actions": [
57 "*"
58 ],
59 "notActions": [
60 "string"
61 ],
62 "role_name": "string"
63 }
64 }
65 ]
66 },
67 "approvalSettings": {
68 "required": true,
69 "bypassApprovalsForPendingChanges": false,
70 "minNumApprovals": 1,
71 "canReviewOwnRequest": false,
72 "canApplyDeclinedChanges": true,
73 "serviceKind": "launchdarkly",
74 "serviceConfig": {},
75 "requiredApprovalTags": [
76 "require-approval"
77 ],
78 "autoApplyApprovedChanges": true,
79 "serviceKindConfigurationId": "1ef45a85-218f-4428-a8b2-a97e5f56c258"
80 },
81 "resourceApprovalSettings": {}
82}
Reset an environment's SDK key with an optional expiry time for the old key.
Was this page helpful?
Previous

Update environment

Next
Built with

Authentication

Authorizationstring
API Key authentication via header

Path parameters

projectKeystringRequiredformat: "string"
The project key
environmentKeystringRequiredformat: "string"
The environment key

Query parameters

expirylongOptional
The time at which you want the old SDK key to expire, in UNIX milliseconds. By default, the key expires immediately. During the period between this call and the time when the old SDK key expires, both the old SDK key and the new SDK key will work.

Response

Environment response
_linksmap from strings to objects
The location and content type of related resources
_idstring

The ID for the environment. Use this as the client-side ID for authorization in some client-side SDKs, and to associate LaunchDarkly environments with CDN integrations in edge SDKs.

keystring

A project-unique key for the new environment

namestring

A human-friendly name for the new environment

apiKeystring

The SDK key for the environment. Use this for authorization in server-side SDKs.

mobileKeystring
The mobile key for the environment. Use this for authorization in mobile SDKs.
colorstring
The color used to indicate this environment in the UI
defaultTtlinteger

The default time (in minutes) that the PHP SDK can cache feature flag rules locally

secureModeboolean

Ensures that one end user of the client-side SDK cannot inspect the variations for another end user

defaultTrackEventsboolean
Enables tracking detailed information for new flags by default
requireCommentsboolean
Whether members who modify flags and segments through the LaunchDarkly user interface are required to add a comment
confirmChangesboolean
Whether members who modify flags and segments through the LaunchDarkly user interface are required to confirm those changes
tagslist of strings
A list of tags for this environment
criticalboolean
Whether the environment is critical
_accessobject
approvalSettingsobject
Details about the approval settings for flags in this environment
resourceApprovalSettingsmap from strings to objects

Details about the approval settings for other resources in this environment, organized by resource kind (for example, “aiconfig” and “segment”)

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
429
Too Many Requests Error