---
title: "Create Custom CSR"
method: POST
path: "/zones/{zone_id}/custom_csrs"
tags: ["Custom CSRs for a Zone"]
---

# Create Custom CSR

`POST /zones/{zone_id}/custom_csrs`

Generate a new custom Certificate Signing Request (CSR) for a zone. Cloudflare generates and securely stores the private key associated with the CSR. The CSR can then be provided to a Certificate Authority for signing. Once signed, the certificate is uploaded via the Custom SSL endpoint using the CSR ID.

## Path parameters

- `zone_id` string, required — Identifier.

## Request body

- TlsCertificatesAndHostnamesCustomCsrCreateRequest — Request body for creating a custom CSR.
  - `common_name` string, required — The common name (domain) for the CSR. Must be at most 64 characters.
  - `country` string, required — Two-letter ISO 3166-1 alpha-2 country code.
  - `key_type` 'rsa2048' | 'p256v1' — Key algorithm to use for the CSR. Defaults to rsa2048 if not specified.
  - `locality` string, required — City or locality name.
  - `organization` string, required — Organization name.
  - `organizational_unit` string — Organizational unit name.
  - `sans` string[], required — Subject Alternative Names for the CSR. At least one SAN is required. The list should include the common name.
  - `state` string, required — State or province name.

## Response `201`

Create Custom CSR response.

- TlsCertificatesAndHostnamesCustomCsrResponseSingle
  - `errors` object[], required
    - `code` integer, required
    - `documentation_url` string
    - `message` string, required
    - `source` object
      - `pointer` string
  - `messages` object[], required
    - `code` integer, required
    - `documentation_url` string
    - `message` string, required
    - `source` object
      - `pointer` string
  - `success` true, required — Whether the API call was successful.
  - `result` TlsCertificatesAndHostnamesCustomCsr — A custom Certificate Signing Request (CSR).
    - `common_name` string — The common name (domain) for the CSR.
    - `country` string — Two-letter ISO 3166-1 alpha-2 country code.
    - `created_at` string, date-time, required — When the CSR was created.
    - `csr` string — The PEM-encoded Certificate Signing Request.
    - `id` string, required — Custom CSR identifier tag.
    - `key_type` 'rsa2048' | 'p256v1', required — The key algorithm used to generate the CSR.
    - `locality` string — City or locality name.
    - `organization` string — Organization name.
    - `organizational_unit` string — Organizational unit for the CSR subject.
    - `sans` string[] — Subject Alternative Names included in the CSR.
    - `state` string — State or province name.

---

[API](https://skmtc.dev/cloudflare/apis/cloudflare.md) · [All operations](https://skmtc.dev/cloudflare/apis/cloudflare/llms.txt) · [OpenAPI document](https://skmtc.dev/cloudflare/apis/cloudflare/revisions/fb3dece9511d?raw)
