Skip to main content
POST
cURL

Authorizations

Authorization
string
header
required

An access token in Infisical

Path Parameters

identityId
string
required

The ID of the machine identity to attach the configuration onto.

Body

application/json
allowedNamespaces
string
required

The comma-separated list of trusted namespaces that service accounts must belong to authenticate with Infisical.

allowedNames
string
required

The comma-separated list of trusted service account names that can authenticate with Infisical.

templateId
string<uuid>

The ID of the Kubernetes auth template to source connection settings from. When provided, the host, CA certificate, token reviewer JWT, token review mode, gateway, and allowed audience are taken from the template and cannot be set individually.

kubernetesHost
string | null

The host string, host:port pair, or URL to the base of the Kubernetes API server.

Required string length: 1 - 255
caCert
string

The PEM-encoded CA certificate used to validate the Kubernetes API server's TLS certificate. Required when verifyTlsCertificate is true. Supplying a non-empty caCert always implies verifyTlsCertificate=true; explicitly setting the toggle to false in the same request is rejected.

verifyTlsCertificate
boolean

Whether to verify the Kubernetes API server's TLS certificate against the configured CA certificate. When true, caCert is required. When false, the connection is still over HTTPS but the API server's certificate is not verified, and caCert must be empty. If omitted, defaults to true when caCert is provided and false otherwise.

tokenReviewerJwt
string

Optional JWT token for accessing Kubernetes TokenReview API. If provided, this long-lived token will be used to validate service account tokens during authentication. If omitted, the client's own JWT will be used instead, which requires the client to have the system:auth-delegator ClusterRole binding.

tokenReviewMode
enum<string>

The mode to use for token review. Must be one of: 'api', 'gateway'. Defaults to 'api' when omitted. If gateway is selected, the gateway must be deployed in Kubernetes, and the gateway must have the system:auth-delegator ClusterRole binding.

Available options:
api,
gateway
allowedAudience
string

The optional audience claim that the service account JWT token must have to authenticate with Infisical.

Maximum string length: 1000
gatewayId
string<uuid> | null

The ID of the gateway to use when performing kubernetes API requests.

gatewayPoolId
string<uuid> | null
accessTokenTrustedIps
object[]

The IPs or CIDR ranges that access tokens can be used from.

Minimum array length: 1
accessTokenTTL
integer
default:2592000

The lifetime for an access token in seconds.

Required range: 0 <= x <= 315360000
accessTokenMaxTTL
integer
default:2592000

The maximum lifetime for an access token in seconds.

Required range: 0 <= x <= 315360000
accessTokenNumUsesLimit
integer
default:0

The maximum number of times that an access token can be used.

Required range: x >= 0

Response

Default Response

identityKubernetesAuth
object
required