Skip to Content
SeyloDocs

Upload a custom certificate

POST
/api/v1/domains.setCertificate

Stores a PEM certificate chain and private key for a domain and switches it to HTTPS mode custom. Fails when the key does not match the certificate or the certificate does not cover the host.

Needs domains.edit on the service (a grant on its project covers it). Not available to MCP clients or the assistant.

Authorization

cookieseylo_session<token>

Request Body

application/json
  1. body
serviceId*string

Panel-issued id.

Match^[a-z0-9]{16}$
domainId*string

Panel-issued id.

Match^[a-z0-9]{16}$
certPem*string
Length100 <= length <= 65536
privateKey*string

PEM private key.

Length100 <= length <= 65536

Response Body

Success.

application/json
  1. response
id*string

Panel-issued id.

Match^[a-z0-9]{16}$
serviceId*string

Panel-issued id.

Match^[a-z0-9]{16}$
host*string

Lower-case host name without scheme or port, for example shop.example.com.

Match^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z][a-z0-9-]{0,62}$
Length3 <= length <= 253
pathPrefix*string

Only requests under this path match. "/" is the whole host.

Match^/[A-Za-z0-9._~!$&'()*+,;=:@%/-]*$
Length1 <= length <= 200
stripPrefix*boolean
targetPort*integer

Port the container listens on.

Range1 <= value <= 65535
https*string|string|string
redirectToHttps*boolean
auto*boolean
primary*boolean
forward*|null
middlewares*
dnsStatus*string|string|string|string|string
dnsCheckedAt*|null
certificate*
liveAt*|null
url*string
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
Example Request
curl -X POST 'https://example.com/api/v1/domains.setCertificate' \  -H 'Content-Type: application/json' \  -d '{  "serviceId": "string",  "domainId": "string",  "certPem": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstri",  "privateKey": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstri"}'
Example Response
{  "id": "string",  "serviceId": "string",  "host": "string",  "pathPrefix": "string",  "stripPrefix": true,  "targetPort": 1,  "https": "acme",  "redirectToHttps": true,  "auto": true,  "primary": true,  "forward": {    "url": "stringst",    "permanent": true,    "keepPath": true  },  "middlewares": {    "basicAuth": {      "usernames": [        "string"      ]    },    "ipAllowList": [      "string"    ],    "rateLimit": {      "average": 1,      "burst": 1,      "periodSeconds": 1    },    "redirects": [      {        "from": "string",        "to": "string",        "permanent": true      }    ]  },  "dnsStatus": "unknown",  "dnsCheckedAt": "2019-08-24T14:15:22Z",  "certificate": {    "status": "none",    "expiresAt": "2019-08-24T14:15:22Z",    "issuer": "string",    "error": "string"  },  "liveAt": "2019-08-24T14:15:22Z",  "url": "string",  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z"}