---
title: "POST /generate-csr"
method: POST
path: "/generate-csr"
tags: ["v2"]
---

# POST /generate-csr

`POST /generate-csr`

## Request body

- GenerateCsr
  - `alg` string
  - `alt-names` string — A comma-separated list of dns alternative names
  - `certificate-type` string — The certificate type to be included in the CSR certificate (ssl-client/ssl-server/certificate-signing)
  - `city` string — The city to be included in the CSR certificate
  - `common-name` string, required — The common name to be included in the CSR certificate
  - `country` string — The country to be included in the CSR certificate
  - `critical` boolean — Add critical to the key usage extension (will be false if not added)
  - `dep` string — The department to be included in the CSR certificate
  - `email-addresses` string — A comma-separated list of email addresses alternative names
  - `export-private-key` boolean — The flag to indicate if the private key should be exported
  - `generate-key` boolean — Generate a new classic key for the csr
  - `hash-algorithm` string — Specifies the hash algorithm used for the encryption key's operations, available options: SHA256, SHA384, SHA512
  - `ip-addresses` string — A comma-separated list of ip addresses alternative names
  - `json` boolean — Set output format to JSON
  - `key-type` string, required — The type of the key to generate (classic-key/dfc)
  - `name` string, required — The key name
  - `org` string — The organization to be included in the CSR certificate
  - `split-level` integer — The number of fragments that the item will be split into (not includes customer fragment)
  - `state` string — The state to be included in the CSR certificate
  - `token` string — Authentication token (see `/auth` and `/configure`)
  - `uid-token` string — The universal identity token, Required only for universal_identity authentication
  - `uri-sans` string — A comma-separated list of uri alternative names

## Response `200`

generateCsrResponse wraps response body.

- GenerateCsrOutput
  - `data` string

## Other responses

- `default` — errorResponse wraps any error to return it as a JSON object with one "error" field.

---

[API](https://skmtc.net/akeyless/apis/akeyless-api.md) · [All operations](https://skmtc.net/akeyless/apis/akeyless-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/akeyless/akeyless-api/versions/0ceb25634501/schema)
