API: SSL and HTTPS

Certificates through DNS for acme.sh and certbot, the certificate mode, HTTPS redirect, HSTS, TLS, redirects, timeouts and the origin health check.

POST /domains/{domain}/acme acme

Publish an ACME challenge

Adds the _acme-challenge TXT record for a DNS-01 certificate, with TTL max(60, the plan's minimum). Calling it again with the same value changes nothing.

Body fieldValuesMeaning
name _acme-challenge _acme-challenge or _acme-challenge.<labels>; empty means _acme-challenge.
valueRequired Text The challenge text from your certificate client (printable ASCII, at most 255 characters).
curl -X POST -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"name":"_acme-challenge","value":"gfj9Xq...Rg85nM"}' \
  https://my.cloud9.ir/api/customer/v1/domains/example.com/acme
DELETE /domains/{domain}/acme acme

Remove an ACME challenge

Removes the TXT records with that name and value (at most 10 per call). Nothing to remove is not an error.

Body fieldValuesMeaning
name Text _acme-challenge or _acme-challenge.<labels>; empty means _acme-challenge.
valueRequired Text The challenge text from your certificate client (printable ASCII, at most 255 characters).
curl -X DELETE -H "Authorization: Bearer $KEY" \
  https://my.cloud9.ir/api/customer/v1/domains/example.com/acme
{"ok":true,"data":{"deleted":1}}
GET /domains/{domain}/certificates services.read

Certificate state

Each proxied name with its certificate state and expiry, and the CNAME that issues the certificate before the nameservers change.

curl -H "Authorization: Bearer $KEY" \
  https://my.cloud9.ir/api/customer/v1/domains/example.com/certificates
POST /domains/{domain}/services/ssl proxy.ssl

Certificate mode

panel: a free certificate on the nodes, issued and renewed by Cloud9. passthrough: the nodes pass HTTPS through and your server keeps its own certificate.

Body fieldValuesMeaning
valueRequired panel | passthrough panel or passthrough.
host Text One proxied name; without it every name of the domain changes. For nodes, value zone makes the name follow the domain again.
curl -X POST -H "Authorization: Bearer $KEY" \
  https://my.cloud9.ir/api/customer/v1/domains/example.com/services/ssl
POST /domains/{domain}/services/edge proxy.ssl

HTTPS, HSTS, TLS, redirects and health check

Only the fields you send change. Needs proxy.ssl.

Body fieldValuesMeaning
https 1 | 0 Always HTTPS: plain HTTP is redirected with 301.
hsts 0 | 15552000 | 31536000 HSTS lifetime in seconds; 0 turns it off.
tls_min 1.2 | 1.3 The lowest TLS version the nodes accept.
redirects Text One rule per line: FROM TO [301|302], for example www.example.com/* https://example.com/*
timeouts Text One per line: /path seconds [stream], 30 to 3600 seconds, for slow pages and downloads.
health Text A path the nodes check on your server, such as /health; empty turns the check off.
curl -X POST -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"https":"1","hsts":"15552000","tls_min":"1.2","health":"/health"}' \
  https://my.cloud9.ir/api/customer/v1/domains/example.com/services/edge

No answer here? Sign in to the portal and open a ticket. Open a ticket