---
title: "Create SAML application secret"
method: POST
path: "/api/saml-applications/{id}/secrets"
tags: ["SAML applications"]
---

# Create SAML application secret

`POST /api/saml-applications/{id}/secrets`

Create a new signing certificate for the SAML application.

## Path parameters

- `id` string, required

## Request body

- object
  - `lifeSpanInYears` integer, required — The lifetime of the certificate in years (minimum 1 year).

## Response `201`

The signing certificate was created successfully.

- 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` — Invalid request body.
- `401` — Unauthorized
- `403` — Forbidden
- `404` — The SAML application was 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)
