---
title: "Generate a self-signed certificate for a domain"
method: POST
path: "/api/client/ssl-certificates/{domain_id}/self-signed"
tags: ["Client - SSL Certificates"]
---

# Generate a self-signed certificate for a domain

`POST /api/client/ssl-certificates/{domain_id}/self-signed`

When 'apply' is true (default), the certificate is also uploaded and activated for the domain. When false, the generated PEM material is returned without persisting it.

## Path parameters

- `domain_id` integer, required

## Request body

- object
  - `apply` boolean

## Response `200`

Generated

- object
  - `certificate` string
  - `private_key` string
  - `certificate_chain` string
  - `ssl_certificate` HostingAccountSslCertificate — SSL certificate record attached to a domain
    - `id` integer
    - `hosting_account_id` integer
    - `domain_id` integer
    - `type` string, nullable — Provider name (e.g. LetsEncrypt, ZeroSSL) or null for uploaded/self-signed
    - `path` string, nullable
    - `domains` string[]
    - `auto_renew` boolean
    - `expiration_date` string, date-time, nullable
    - `created_at` string, date-time
    - `updated_at` string, date-time

## Other responses

- `404` — Domain not found
- `422` — Upload failed

---

[API](https://skmtc.dev/adminbolt/apis/adminbolt-api-documentation.md) · [All operations](https://skmtc.dev/adminbolt/apis/adminbolt-api-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/adminbolt/adminbolt-api-documentation/revisions/bf4f36fbfbd3/schema)
