Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

doc: add cert template api usage

Sheen Capadngan189a610f5238
diff --git a/docs/documentation/platform/pki/certificate-templates.mdx b/docs/documentation/platform/pki/certificate-templates.mdx
index 9afaf456fc..a014a6c019 100644
--- a/docs/documentation/platform/pki/certificate-templates.mdx
+++ b/docs/documentation/platform/pki/certificate-templates.mdx
@@ -55,4 +55,61 @@ In the following steps, we explore how to issue a X.509 certificate using a cert
</Step>
</Steps>
</Tab>
+ <Tab title="API">
+ <Steps>
+ <Step title="Creating the certificate template">
+ To create a certificate template, make an API request to the [Create Certificate Template](/api-reference/endpoints/certificate-templates/create) API endpoint.
+
+ ### Sample request
+
+ ```bash Request
+ curl --request POST \
+ --url https://app.infisical.com/api/v1/pki/certificate-templates \
+ --header 'Content-Type: application/json' \
+ --data '{
+ "caId": "<string>",
+ "pkiCollectionId": "<string>",
+ "name": "<string>",
+ "commonName": "<string>",
+ "subjectAlternativeName": "<string>",
+ "ttl": "<string>"
+ }'
+ ```
+
+ ### Sample response
+
+ ```bash Response
+ {
+ "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
+ "caId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
+ "name": "<string>",
+ "commonName": "<string>",
+ "subjectAlternativeName": "<string>",
+ "pkiCollectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
+ "ttl": "<string>",
+ "projectId": "<string>",
+ "caName": "<string>"
+ }
+ ```
+ </Step>
+ <Step title="Using the certificate template">
+ To use the certificate template, attach the certificate template ID when invoking the API endpoint for [issuing](/api-reference/endpoints/certificates/issue-certificate) or [signing](/api-reference/endpoints/certificates/sign-certificate) new certificates.
+
+ ### Sample request
+
+ ```bash Request
+ curl --request POST \
+ --url https://app.infisical.com/api/v1/pki/certificates/issue-certificate \
+ --header 'Content-Type: application/json' \
+ --data '{
+ "certificateTemplateId": "<string>",
+ "friendlyName": "<string>",
+ "commonName": "<string>",
+ ...
+ }'
+ ```
+ </Step>
+ </Steps>
+
+ </Tab>
</Tabs>