---
title: "POST /api/v1/pki/certificate-templates"
method: POST
path: "/api/v1/pki/certificate-templates"
tags: ["PKI Certificate Templates"]
---

# POST /api/v1/pki/certificate-templates

`POST /api/v1/pki/certificate-templates`

## Request body

- object
  - `caId` string, required — The ID of the certificate authority to associate the template with.
  - `pkiCollectionId` string — The ID of the PKI collection to bind to the template.
  - `name` string, required — The name of the template.
  - `commonName` string, required — The regular expression string to use for validating common names.
  - `subjectAlternativeName` string, required — The regular expression string to use for validating subject alternative names.
  - `ttl` string, required — The max TTL for the template.
  - `keyUsages` string[] — The key usage constraint or default value for when template is used during certificate issuance.
  - `extendedKeyUsages` string[] — The extended key usage constraint or default value for when template is used during certificate issuance.

## Response `200`

Default Response

- object
  - `id` string, uuid, required
  - `caId` string, uuid, required
  - `name` string, required
  - `commonName` string, required
  - `subjectAlternativeName` string, required
  - `pkiCollectionId` string, uuid, nullable
  - `ttl` string, required
  - `keyUsages` string[], nullable
  - `extendedKeyUsages` string[], nullable
  - `projectId` string, required
  - `caName` string, required

## Other responses

- `400` — Default Response
- `401` — Default Response
- `403` — Default Response
- `404` — Default Response
- `422` — Default Response
- `500` — Default Response

---

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