# PUT /domains/{name}/certificate/custom

First published 3 Oct 2026 (release 0.1.0) · Unchanged since publication

UrbeStack release 0.2.35 API operation in the certificates group.

Install a custom TLS certificate for a domain

- Who may call it: administrator, reseller, customer
- Token scope, any of: certificates, all
- Answers: 200 OK

Supply the certificate and matching private key as PEM text in cert and key. The certificate must cover the domain and still be valid. Supply the optional certificate chain as PEM text in chain. An empty chain is treated as omitted.

The API returns 400 if cert or key is missing or if cert, key, or a nonempty chain lacks a -----BEGIN marker. It returns 500 if UrbeStack cannot prepare the PEM data for installation.

UrbeStack continues installation with a warning if the certificate omits other configured names or is self-signed. For certificates that are not self-signed, UrbeStack also warns and continues if the chain is missing or fails verification.

UrbeStack sets the domain's certificate mode to custom and excludes it from automatic renewal. The 200 response returns the installed certificate record in certificate. Use DELETE /domains/{name}/certificate to remove it.

## As a command

- [urbestack-cert-custom-set](https://urbestack.com/docs/commands/urbestack-cert-custom-set.md): Installs a custom TLS certificate for a domain.

## Parameters

- `name` (path, DomainName, required)

## Request body

JSON, the type [CustomCertificate](https://urbestack.com/docs/api/types/CustomCertificate.md).

- `cert` (string, up to 65536 characters, required): Certificate in PEM format.
- `key` (string, up to 65536 characters, required): Certificate's private key in PEM format. UrbeStack restricts access to the stored key to root and never returns it.
- `chain` (string, up to 131072 characters): Optional intermediate certificates in PEM format. UrbeStack checks the chain and warns about problems.

## Example

Set $API to the base URL and $TOKEN to the token, as the [API overview](https://urbestack.com/docs/api.md) shows.

```
curl -sS -X PUT "$API/domains/example.com/certificate/custom" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "cert": "text",
    "chain": "text",
    "key": "panel.port"
  }'
```

Response, 200 OK:

```
{
  "certificate": {
    "fingerprint": "text",
    "issuer": "text",
    "kind": "profile",
    "name": "alice",
    "names": [
      "text"
    ],
    "not_after": "text",
    "not_before": "text",
    "reload": {},
    "warnings": [
      "text"
    ]
  }
}
```

## Errors

- 400: --<what> is required
- 400: --<what> may not contain ..
- 400: --<what> must be an absolute plain path
- 400: Cannot read <p>: $!
- 400: Domain name required
- 400: Domain name too long
- 400: Invalid domain name
- 400: The <part> must be in PEM form
- 401: Authentication required
- 404: Domain '<name>' not found
