---
title: "Create an SP signing key"
method: POST
path: "/api/sso-connectors/{id}/signing-keys"
tags: ["SSO connectors"]
---

# Create an SP signing key

`POST /api/sso-connectors/{id}/signing-keys`

Generate a new Service Provider signing key pair for the given SAML SSO connector. Create the key inactive (default) to stage a graceful rotation — register its certificate at the identity provider before activating it. Creating an active key deactivates the currently active key atomically.

## Path parameters

- `id` string, required

## Request body

- object
  - `active` boolean, required — Whether the new key should become the active signing key immediately. Defaults to `false` (staged rotation).

## Response `201`

The created SP signing key.

- object
  - `id` string, required
  - `certificate` string, required
  - `createdAt` number, required
  - `expiresAt` number, required
  - `active` boolean, required
  - `fingerprints` object, required
    - `sha256` object, required
      - `formatted` string, required
      - `unformatted` string, required

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — The SSO connector is not found or is not a SAML connector.

---

[API](https://skmtc.net/logto/apis/logto-api-references.md) · [All operations](https://skmtc.net/logto/apis/logto-api-references/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/logto/logto-api-references/versions/a163dc77d842/schema)
