---
title: "POST /api/v1/identity-templates"
method: POST
path: "/api/v1/identity-templates"
---

# POST /api/v1/identity-templates

`POST /api/v1/identity-templates`

Create identity auth template

## Request body

- union
  - object
    - `name` string, required
    - `authMethod` 'ldap', required
    - `templateFields` object, required
      - `url` string, required
      - `bindDN` string, required
      - `bindPass` string, required
      - `searchBase` string, required
      - `ldapCaCertificate` string
  - object
    - `name` string, required
    - `authMethod` 'kubernetes', required
    - `templateFields` object, required
      - `tokenReviewMode` 'api' | 'gateway' — The mode to use for token review. Must be one of: 'api', 'gateway'
      - `kubernetesHost` string, nullable — The host string, host:port pair, or URL to the base of the Kubernetes API server
      - `caCert` string — The PEM-encoded CA certificate used to validate the Kubernetes API server's TLS certificate
      - `verifyTlsCertificate` boolean — Whether to verify the Kubernetes API server's TLS certificate against the configured CA certificate
      - `tokenReviewerJwt` string — Optional JWT token for accessing the Kubernetes TokenReview API
      - `gatewayId` string, uuid, nullable — The ID of the gateway to use when performing Kubernetes API requests
      - `gatewayPoolId` string, uuid, nullable — The ID of the gateway pool to use when performing Kubernetes API requests
      - `allowedAudience` string — The optional audience claim that service account JWT tokens must have to authenticate with Infisical

## Response `200`

Default Response

- union
  - object
    - `id` string, uuid, required
    - `templateFields` object, required
      - `url` string
      - `bindDN` string
      - `searchBase` string
      - `ldapCaCertificate` string
      - `hasBindPass` boolean, required — Whether a bind password is stored for this template
    - `orgId` string, uuid, required
    - `name` string, required
    - `authMethod` 'ldap', required
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required
  - object
    - `id` string, uuid, required
    - `templateFields` object, required
      - `tokenReviewMode` 'api' | 'gateway' — The mode to use for token review. Must be one of: 'api', 'gateway'
      - `kubernetesHost` string, nullable — The host string, host:port pair, or URL to the base of the Kubernetes API server
      - `caCert` string — The PEM-encoded CA certificate used to validate the Kubernetes API server's TLS certificate
      - `verifyTlsCertificate` boolean — Whether to verify the Kubernetes API server's TLS certificate against the configured CA certificate
      - `gatewayId` string, uuid, nullable — The ID of the gateway to use when performing Kubernetes API requests
      - `gatewayPoolId` string, uuid, nullable — The ID of the gateway pool to use when performing Kubernetes API requests
      - `allowedAudience` string — The optional audience claim that service account JWT tokens must have to authenticate with Infisical
      - `hasTokenReviewerJwt` boolean, required — Whether a token reviewer JWT is stored for this template
    - `orgId` string, uuid, required
    - `name` string, required
    - `authMethod` 'kubernetes', required
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required

## Other responses

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

## Changes

- **2026-08-31** `763e38e78337` — 9 breaking, 3 warning, 2 info
  - the request's body type/format changed from `object`/`` to ``/``
  - the response's body type/format changed from `object`/`` to ``/`` for status `200`
  - removed the required property `authMethod` from the response with the `200` status
  - removed the required property `createdAt` from the response with the `200` status
  - …10 more

[Change history](https://skmtc.dev/infisical/apis/infisical-api/changes/api/v1/identity-templates/post.md)

---

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