---
title: "POST /v1/{+parent}/certificateTemplates"
method: POST
path: "/v1/{+parent}/certificateTemplates"
tags: ["projects"]
---

# POST /v1/{+parent}/certificateTemplates

`POST /v1/{+parent}/certificateTemplates`

Create a new CertificateTemplate in a given Project and Location.

## Path parameters

- `parent` string, required

## Query parameters

- `certificateTemplateId` string
- `requestId` string

## Request body

- CertificateTemplate — A CertificateTemplate refers to a managed template for certificate issuance.
  - `description` string — Optional. A human-readable description of scenarios this template is intended for.
  - `labels` object — Optional. Labels with user-defined metadata.
  - `createTime` string, google-datetime — Output only. The time at which this CertificateTemplate was created.
  - `identityConstraints` CertificateIdentityConstraints — Describes constraints on a Certificate's Subject and SubjectAltNames.
    - `allowSubjectAltNamesPassthrough` boolean — Required. If this is true, the SubjectAltNames extension may be copied from a certificate request into the signed certificate. Otherwise, the requested SubjectAltNames will be discarded.
    - `celExpression` Expr — Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() < 100" Example (Equality): title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email" Example (Logic): title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' && document.type != 'internal'" Example (Data Manipulation): title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)" The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
      - `title` string — Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
      - `location` string — Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
      - `description` string — Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
      - `expression` string — Textual representation of an expression in Common Expression Language syntax.
    - `allowSubjectPassthrough` boolean — Required. If this is true, the Subject field may be copied from a certificate request into the signed certificate. Otherwise, the requested Subject will be discarded.
  - `maximumLifetime` string, google-duration — Optional. The maximum lifetime allowed for issued Certificates that use this template. If the issuing CaPool resource's IssuancePolicy specifies a maximum_lifetime the minimum of the two durations will be the maximum lifetime for issued Certificates. Note that if the issuing CertificateAuthority expires before a Certificate's requested maximum_lifetime, the effective lifetime will be explicitly truncated to match it.
  - `predefinedValues` X509Parameters — An X509Parameters is used to describe certain fields of an X.509 certificate, such as the key usage fields, fields specific to CA certificates, certificate policy extensions and custom extensions.
    - `nameConstraints` NameConstraints — Describes the X.509 name constraints extension, per https://tools.ietf.org/html/rfc5280#section-4.2.1.10
      - `excludedIpRanges` string[] — Contains the excluded IP ranges. For IPv4 addresses, the ranges are expressed using CIDR notation as specified in RFC 4632. For IPv6 addresses, the ranges are expressed in similar encoding as IPv4 addresses.
      - `excludedEmailAddresses` string[] — Contains the excluded email addresses. The value can be a particular email address, a hostname to indicate all email addresses on that host or a domain with a leading period (e.g. `.example.com`) to indicate all email addresses in that domain.
      - `permittedUris` string[] — Contains the permitted URIs that apply to the host part of the name. The value can be a hostname or a domain with a leading period (like `.example.com`)
      - `permittedDnsNames` string[] — Contains permitted DNS names. Any DNS name that can be constructed by simply adding zero or more labels to the left-hand side of the name satisfies the name constraint. For example, `example.com`, `www.example.com`, `www.sub.example.com` would satisfy `example.com` while `example1.com` does not.
      - `critical` boolean — Indicates whether or not the name constraints are marked critical.
      - `excludedUris` string[] — Contains the excluded URIs that apply to the host part of the name. The value can be a hostname or a domain with a leading period (like `.example.com`)
      - `excludedDnsNames` string[] — Contains excluded DNS names. Any DNS name that can be constructed by simply adding zero or more labels to the left-hand side of the name satisfies the name constraint. For example, `example.com`, `www.example.com`, `www.sub.example.com` would satisfy `example.com` while `example1.com` does not.
      - `permittedIpRanges` string[] — Contains the permitted IP ranges. For IPv4 addresses, the ranges are expressed using CIDR notation as specified in RFC 4632. For IPv6 addresses, the ranges are expressed in similar encoding as IPv4 addresses.
      - `permittedEmailAddresses` string[] — Contains the permitted email addresses. The value can be a particular email address, a hostname to indicate all email addresses on that host or a domain with a leading period (e.g. `.example.com`) to indicate all email addresses in that domain.
    - `additionalExtensions` X509Extension[] — Optional. Describes custom X.509 extensions.
      - `objectId` ObjectId — An ObjectId specifies an object identifier (OID). These provide context and describe types in ASN.1 messages.
        - `objectIdPath` integer[] — Required. The parts of an OID path. The most significant parts of the path come first.
      - `critical` boolean — Optional. Indicates whether or not this extension is critical (i.e., if the client does not know how to handle this extension, the client should consider this to be an error).
      - `value` string, byte — Required. The value of this X.509 extension.
    - `keyUsage` KeyUsage — A KeyUsage describes key usage values that may appear in an X.509 certificate.
      - `baseKeyUsage` KeyUsageOptions — KeyUsage.KeyUsageOptions corresponds to the key usage values described in https://tools.ietf.org/html/rfc5280#section-4.2.1.3.
        - `certSign` boolean — The key may be used to sign certificates.
        - `keyAgreement` boolean — The key may be used in a key agreement protocol.
        - `dataEncipherment` boolean — The key may be used to encipher data.
        - `digitalSignature` boolean — The key may be used for digital signatures.
        - `contentCommitment` boolean — The key may be used for cryptographic commitments. Note that this may also be referred to as "non-repudiation".
        - `keyEncipherment` boolean — The key may be used to encipher other keys.
        - `encipherOnly` boolean — The key may be used to encipher only.
        - `decipherOnly` boolean — The key may be used to decipher only.
        - `crlSign` boolean — The key may be used sign certificate revocation lists.
      - `extendedKeyUsage` ExtendedKeyUsageOptions — KeyUsage.ExtendedKeyUsageOptions has fields that correspond to certain common OIDs that could be specified as an extended key usage value.
        - `serverAuth` boolean — Corresponds to OID 1.3.6.1.5.5.7.3.1. Officially described as "TLS WWW server authentication", though regularly used for non-WWW TLS.
        - `clientAuth` boolean — Corresponds to OID 1.3.6.1.5.5.7.3.2. Officially described as "TLS WWW client authentication", though regularly used for non-WWW TLS.
        - `codeSigning` boolean — Corresponds to OID 1.3.6.1.5.5.7.3.3. Officially described as "Signing of downloadable executable code client authentication".
        - `emailProtection` boolean — Corresponds to OID 1.3.6.1.5.5.7.3.4. Officially described as "Email protection".
        - `ocspSigning` boolean — Corresponds to OID 1.3.6.1.5.5.7.3.9. Officially described as "Signing OCSP responses".
        - `timeStamping` boolean — Corresponds to OID 1.3.6.1.5.5.7.3.8. Officially described as "Binding the hash of an object to a time".
      - `unknownExtendedKeyUsages` ObjectId[] — Used to describe extended key usages that are not listed in the KeyUsage.ExtendedKeyUsageOptions message.
        - `objectIdPath` integer[] — Required. The parts of an OID path. The most significant parts of the path come first.
    - `policyIds` ObjectId[] — Optional. Describes the X.509 certificate policy object identifiers, per https://tools.ietf.org/html/rfc5280#section-4.2.1.4.
      - `objectIdPath` integer[] — Required. The parts of an OID path. The most significant parts of the path come first.
    - `caOptions` CaOptions — Describes the X.509 basic constraints extension, per [RFC 5280 section 4.2.1.9](https://tools.ietf.org/html/rfc5280#section-4.2.1.9)
      - `maxIssuerPathLength` integer — Optional. Refers to the path length constraint field in the X.509 extension. For a CA certificate, this value describes the depth of subordinate CA certificates that are allowed. If this value is less than 0, the request will fail. If this value is missing, the max path length will be omitted from the certificate.
      - `isCa` boolean — Optional. Refers to the "CA" boolean field in the X.509 extension. When this value is missing, the basic constraints extension will be omitted from the certificate.
    - `aiaOcspServers` string[] — Optional. Describes Online Certificate Status Protocol (OCSP) endpoint addresses that appear in the "Authority Information Access" extension in the certificate.
  - `updateTime` string, google-datetime — Output only. The time at which this CertificateTemplate was updated.
  - `name` string — Identifier. The resource name for this CertificateTemplate in the format `projects/*/locations/*/certificateTemplates/*`.
  - `passthroughExtensions` CertificateExtensionConstraints — Describes a set of X.509 extensions that may be part of some certificate issuance controls.
    - `knownExtensions` string[] — Optional. A set of named X.509 extensions. Will be combined with additional_extensions to determine the full set of X.509 extensions.
    - `additionalExtensions` ObjectId[] — Optional. A set of ObjectIds identifying custom X.509 extensions. Will be combined with known_extensions to determine the full set of X.509 extensions.
      - `objectIdPath` integer[] — Required. The parts of an OID path. The most significant parts of the path come first.

## Response `200`

Successful response

---

[API](https://skmtc.dev/google/apis/privateca.md) · [All operations](https://skmtc.dev/google/apis/privateca/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/google/privateca/revisions/23453098738d/schema)
