---
title: create-an-sdk-key
product: vercel
url: /docs/rest-api/feature-flags/create-an-sdk-key
type: reference
prerequisites:
  []
related:
  - /docs/rest-api
summary: Learn about create-an-sdk-key on Vercel.
install_vercel_plugin: npx plugins add vercel/vercel-plugin
---

# Create an SDK key

```http
PUT /v1/projects/{projectIdOrName}/feature-flags/sdk-keys
```

Creates an SDK key.

## Authentication

**bearerToken**: HTTP bearer

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `projectIdOrName` | string | Yes | The project id or name |


## Query parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `teamId` | string | No | The Team identifier to perform the request on behalf of. |
| `slug` | string | No | The Team slug to perform the request on behalf of. |


## Request body

Required: No

Content-Type: `application/json`

```json
{
  "type": "object",
  "required": [
    "sdkKeyType",
    "environment"
  ],
  "properties": {
    "sdkKeyType": {
      "type": "string",
      "enum": [
        "server",
        "mobile",
        "client"
      ]
    },
    "environment": {
      "type": "string"
    },
    "label": {
      "type": "string"
    }
  }
}
```

## Responses

### 200: No description

Content-Type: `application/json`

```json
{
  "type": "object",
  "required": [
    "createdAt",
    "createdBy",
    "environment",
    "hashKey",
    "projectId",
    "type",
    "updatedAt"
  ],
  "properties": {
    "hashKey": {
      "type": "string"
    },
    "projectId": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "enum": [
        "server",
        "mobile",
        "client"
      ]
    },
    "environment": {
      "type": "string"
    },
    "createdBy": {
      "type": "string"
    },
    "createdAt": {
      "type": "number"
    },
    "updatedAt": {
      "type": "number"
    },
    "label": {
      "type": "string"
    },
    "deletedAt": {
      "type": "number"
    },
    "keyValue": {
      "type": "string",
      "description": "Cleartext value of the SDK key"
    },
    "tokenValue": {
      "type": "string",
      "description": "Cleartext value of the Edge Config token"
    },
    "connectionString": {
      "type": "string",
      "description": "Connection string for the SDK"
    }
  }
}
```

### 400: One of the provided values in the request body is invalid.
One of the provided values in the request query is invalid.

### 401: The request is not authorized.

### 402: The account was soft-blocked for an unhandled reason.
The account is missing a payment so payment method must be updated

### 403: You do not have permission to access this resource.

### 404: No description

### 409: No description

---

## Related

- [feature-flags endpoints](/docs/rest-api#feature-flags)

- [REST API overview](/docs/rest-api)

- [OpenAPI spec](https://openapi.vercel.sh/) (machine-readable, all endpoints)

---

[View full sitemap](/docs/sitemap)
