# POST /domains/{name}/certificate

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

UrbeStack release 0.2.35 API operation in the certificates group.

Request a TLS certificate for a domain

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

Queues a cert-issue job to request the certificate from the certificate authority. The 202 response returns the queued job in job.

If supplied, challenge must be auto, http, or dns. An invalid challenge returns 400.

## As a command

- [urbestack-cert-issue](https://urbestack.com/docs/commands/urbestack-cert-issue.md): Obtains and installs a TLS certificate from the ACME directory configured in ssl.acme_directory, which defaults to Let's Encrypt at https://acme-v02.api.letsencrypt.org/directory.

## Parameters

- `name` (path, DomainName, required)

## Request body

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

- `challenge` (string, one of auto, http, dns)

## 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 POST "$API/domains/example.com/certificate" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "challenge": "auto"
  }'
```

Response, 202 Accepted:

```
{
  "job": {
    "created_at": "2026-09-09T10:15:00Z",
    "created_by": 1,
    "created_by_name": "text",
    "dismissed_at": "text",
    "finished_at": "2026-09-09T10:15:04Z",
    "id": 1,
    "lane": "short",
    "log": "",
    "params": {},
    "progress": 100,
    "result": {},
    "started_at": "2026-09-09T10:15:01Z",
    "status": "queued",
    "type": "rebuild",
    "usual_seconds": 1
  }
}
```

## Errors

- 400: A new job is queued or running
- 400: Invalid <what>: 
- 400: Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter
- 400: Job parameters must be an object
- 400: Unknown job type
- 400: Username '<value>' is reserved
- 400: challenge must be auto, http or dns
- 401: Authentication required
- 404: User '<user>' not found
