Request certificate

Create a certificate for your tenant.

Tenants can hold multiple certificates next to each other, each request adds a new certificate. When the tenant has no active certificate yet the new certificate is activated right away, otherwise it is installed alongside and can be swapped through the activate certificate endpoint. Only one request per tenant runs at a time. The endpoint returns a 404 when the tenant does not exist on the site.


POST/api/servers/{server}/sites/{site}/tenants/{tenant}/request-certificate

Request a certificate

Requests an SSL certificate for the specified tenant.

Optional attributes

  • Name
    webhook
    Type
    string
    Description

    A URL that will be triggered by Ploi (POST) once certificate is issued and finished all setup.

  • Name
    domains
    Type
    string
    Description

    A collection of domains comma separated to request a certificate for, example: domain.com,www.domain.com. When the tenant's www counterpart is included, Ploi also sets up the www to non-www redirect over SSL; without it the www redirect is left out so the counterpart can be used as its own tenant.

  • Name
    additional[type]
    Type
    string
    Description

    The certificate provider, either letsencrypt (default) or zerossl.

  • Name
    force
    Type
    boolean
    Description

    Bypasses the Ploi DNS validation.

  • Name
    additional[use_dns_provider]
    Type
    boolean
    Description

    Set to true to validate the certificate through a DNS provider instead of HTTP validation. This skips the Ploi DNS validation, so the tenant does not need to point to your server yet.

  • Name
    additional[provider]
    Type
    string
    Description

    The DNS provider to use for validation, required when additional[use_dns_provider] is true. Possible values: cloudflare, digitalocean, linode, route53, hetzner or bunny.

  • Name
    additional[secret]
    Type
    string
    Description

    The API token for the DNS provider, required when additional[use_dns_provider] is true and additional[use_from_profile] is not set.

  • Name
    additional[use_from_profile]
    Type
    boolean
    Description

    Set to true to use a DNS provider credential stored on the server owner's profile instead of passing an API token.

  • Name
    additional[credential]
    Type
    integer
    Description

    The ID of the DNS provider credential from the server owner's profile, required when additional[use_from_profile] is true.

Request

POST
/api/servers/{server}/sites/{site}/tenants/{tenant}/request-certificate
curl -X POST "https://ploi.io/api/servers/{server}/sites/{site}/tenants/example.com/request-certificate" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "domains": "domain.com,www.domain.com"
  }'

Response

HTTP/1.1 201 CREATED
Content-Type: application/json