---
title: "Activate or deactivate an SP signing key"
method: PATCH
path: "/api/sso-connectors/{id}/signing-keys/{keyId}"
tags: ["SSO connectors"]
---

# Activate or deactivate an SP signing key

`PATCH /api/sso-connectors/{id}/signing-keys/{keyId}`

Update the activation state of the given Service Provider signing key. Activating a key atomically deactivates the currently active key — the switch step of a graceful rotation. Deactivating the active key is rejected while signed authentication requests are enabled — disable them first (key routes never modify the connector config).

## Path parameters

- `id` string, required
- `keyId` string, required

## Request body

- object
  - `active` boolean, required — Whether the key should be the active signing key.

## Response `200`

The updated 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` — The key is the active signing key and signed authentication requests are enabled — it cannot be deactivated until they are disabled.
- `401` — Unauthorized
- `403` — Forbidden
- `404` — The SSO connector is not found, is not a SAML connector, or the signing key is not found.

---

[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)
