S D K Keys (beta)

Create SDK key

POST
/api/v2/projects/{projectKey}/environments/{environmentKey}/sdk-keys

Create a new server-side or mobile SDK key.

Deleted SDK keys are retained for 180 days. During that period you cannot reuse the key of a deleted SDK key, even though the deleted key no longer appears in the list of SDK keys for the environment.

Authorization

ApiKey read, write
Authorization<token>

In: header

Scope: read, write

Path Parameters

projectKey*string
environmentKey*string

Header Parameters

LD-API-Version*"beta"

Version of the endpoint.

Value in

  • "beta"

Request Body

application/json

Parameters for creating a new SDK key

kind?string

The kind of SDK key. Can be either "sdk" (server-side) or "mobile" (mobile). Defaults to "sdk" when not explicitly defined.

Default"sdk"

Value in

  • "sdk"
  • "mobile"
key*string

The user-defined key of the SDK key.

name*string

The human-readable name of the SDK key.

description?string

The optional description of the SDK key.

expiry?integer
Formatint64
viewKeys?array<string>

List of view keys to associate with the SDK key.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v2/projects/default/environments/production/sdk-keys" \  -H "LD-API-Version: beta" \  -H "Content-Type: application/json" \  -d '{    "kind": "sdk",    "name": "name",    "description": "description",    "viewKeys": [      "viewKeys",      "viewKeys"    ],    "expiry": 0,    "key": "key"  }'
{  "isDefault": true,  "_links": {    "parent": {      "href": "href",      "type": "type"    },    "self": {      "href": "href",      "type": "type"    }  },  "kind": "sdk",  "_createdAt": 6,  "name": "name",  "description": "description",  "expiry": 0,  "value": "value",  "_updatedAt": 1,  "_version": 5,  "key": "key",  "_createdByMemberId": "_createdByMemberId"}