---
title: create-a-signing-key
product: vercel
url: /docs/rest-api/kms/create-a-signing-key
canonical_url: "https://vercel.com/docs/rest-api/kms/create-a-signing-key"
last_updated: 2026-08-19
type: reference
prerequisites:
  []
related:
  - /docs/rest-api
summary: Learn about create-a-signing-key on Vercel.
install_vercel_plugin: npx plugins add vercel/vercel-plugin
---

# Create a signing key

```http
POST /v1/kms/issuers/{issuerId}/keys
```

Create a new signing key for a KMS issuer. Depending on the activation mode, the key is activated automatically once its public key has propagated, or manually via the activate endpoint.

## Authentication

**bearerToken**: HTTP bearer

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `issuerId` | string | Yes | The ID of the issuer. |


## 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",
  "properties": {
    "activation": {
      "type": "string",
      "description": "Whether the new key is activated automatically after its public key has propagated, or manually via the activate endpoint. Defaults to `automatic`.",
      "enum": [
        "automatic",
        "manual"
      ]
    },
    "revokePreviousAfterHours": {
      "type": "number",
      "description": "For automatic activation, how many hours after activation the previous signing key should stop being used. Defaults to a 1 hour grace period so already-issued tokens keep verifying.",
      "minimum": 0
    },
    "revokePreviousAt": {
      "description": "Deprecated. The ISO date string or timestamp when the previous signing key should stop being used. Converted to a relative grace and applied at activation, not creation. Prefer revokePreviousAfterHours.",
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        }
      ]
    },
    "importKey": {
      "type": "string",
      "description": "The PEM-encoded private key to use for the issuer."
    },
    "importKeyId": {
      "type": "string",
      "description": "The key id to use as the imported key's JWT/JWKS `kid`. Only allowed when `importKey` is provided. Not required to be unique; the addressable key id is the server-minted `keyId` returned in the response.",
      "pattern": "^[A-Za-z0-9._-]+$",
      "maxLength": 128
    }
  }
}
```

## Responses

### 200: No description

Content-Type: `application/json`

```json
{
  "type": "object",
  "required": [
    "algorithm",
    "createdAt",
    "issuerId",
    "keyId",
    "status",
    "updatedAt"
  ],
  "properties": {
    "keyId": {
      "type": "string",
      "description": "The server-minted, unique record identifier. Use this to address the key on the activate / certificate endpoints."
    },
    "importKeyId": {
      "type": "string",
      "description": "The caller-supplied key id (imported keys only), used as the JWT/JWKS `kid`. Not unique across an issuer's keys; omitted for generated keys."
    },
    "issuerId": {
      "type": "string"
    },
    "algorithm": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "pending",
        "revoking"
      ]
    },
    "publicKey": {
      "type": "object",
      "properties": {
        "kty": {
          "type": "string"
        },
        "kid": {
          "type": "string"
        },
        "alg": {
          "type": "string"
        },
        "use": {
          "type": "string"
        },
        "key_ops": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "x5c": {
          "type": "array",
          "description": "The X.509 certificate chain (RFC 7517 §4.7). Each entry is the base64 DER (not base64url) of a certificate. For keys minted with a stored certificate this holds the single self-signed cert as `[x5c]`.",
          "items": {
            "type": "string"
          }
        },
        "x5t#S256": {
          "type": "string",
          "description": "The base64url SHA-256 thumbprint of the DER certificate in `x5c[0]` (RFC 7517 §4.9)."
        }
      }
    },
    "publicKeyFingerprint": {
      "type": "string"
    },
    "publicKeyPem": {
      "type": "string",
      "description": "The public key in SPKI PEM form, ready to render. Present whenever the key has public key material. Derived from `publicKey`; the embedded certificate members (`x5c`/`x5t#S256`) do not affect it."
    },
    "certificatePem": {
      "type": "string",
      "description": "The stored X.509 certificate (from `publicKey.x5c[0]`) in PEM form, ready to render. Present only for keys created with a stored certificate; omitted for keys created before certificates were stored."
    },
    "createdAt": {
      "type": "string"
    },
    "updatedAt": {
      "type": "string"
    },
    "revokeAt": {
      "type": "string"
    },
    "activateAt": {
      "type": "string"
    },
    "activatedAt": {
      "type": "string",
      "description": "When the key became the active signer. Present for active and revoking keys (and absent for pending keys and rows predating this field)."
    }
  }
}
```

### 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.

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

### 404: No description

### 409: No description

### 410: No description

---

## Related

- [kms endpoints](/docs/rest-api#kms)

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

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

---

[View full sitemap](/docs/sitemap)
