Certificates

List certificates

List certificates on a site.

GET /api/site/{id}/certificates

Example request :

curl "https://cloud.boxydev.com/api/site/1/certificates" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json"

Example response :

{
    "data": [
        {
            "id": 1,
            "domain": ["fiorella.com", "www.fiorella.com"],
            "type": "letsencrypt",
            "request_status": "created",
            "status": "installing",
            "activation_status": null,
            "active": false,
            "created_at": "2022-09-17T16:29:36.000000Z"
        }
    ],
    "links": {
        "first": "https://cloud.boxydev.com/api/site/1/certificates?page=1",
        "last": "https://cloud.boxydev.com/api/site/1/certificates?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "https://cloud.boxydev.com/api/site/1/certificates",
        "per_page": 20,
        "to": 1,
        "total": 1
    }
}

Get certificate

Show a certificate.

GET /api/certificate/{id}

Example request :

curl "https://cloud.boxydev.com/api/certificate/1" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json"

Example response :

{
    "id": 1,
    "domain": ["fiorella.com", "www.fiorella.com"],
    "type": "letsencrypt",
    "request_status": "created",
    "status": "installing",
    "activation_status": null,
    "active": false,
    "created_at": "2022-09-17T16:29:36.000000Z"
}

Create certificate

Create a simple certificate.

POST /api/site/{id}/certificate

Parameters :

Parameter Description
type The type of certificate: letsencrypt, import or create.
domain The domain or domains for certificate.
country Country for certificate.
state State for certificate.
city City for certificate.
organization Organization for certificate.
department Department for certificate.

Example request :

curl "https://cloud.boxydev.com/api/site/1/certificate" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -d '{
        "type": "create",
        "domain": [
            "fiorella.com",
            "www.fiorella.com"
        ],
        "country": "FR",
        "state": "Hauts-de-France",
        "city": "Hulluch",
        "organization": "Boxydev",
        "department": "IT"
    }'

Example response :

{
    "id": 1,
    "domain": ["fiorella.com", "www.fiorella.com"],
    "type": "create",
    "request_status": "pending",
    "status": "pending",
    "activation_status": null,
    "active": false,
    "created_at": "2022-09-18T13:13:50.000000Z"
}

Create Let's encrypt certificate

Create a Let's encrypt certificate.

POST /api/site/{id}/certificate

You can get DNS provider list here. You can manage all your DNS providers on your account.

Parameters :

Parameter Description
type The type of certificate: letsencrypt, import or create.
domain The domain or domains for certificate.
dns_provider_id DNS provider ID if domain is wildcard (*.fiorella.com).

Example request :

curl "https://cloud.boxydev.com/api/site/1/certificate" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -d '{
        "type": "letsencrypt",
        "domain": [
            "fiorella.com",
            "*.fiorella.com"
        ],
        "dns_provider_id": 1
    }'

Example response :

{
    "id": 1,
    "domain": ["fiorella.com", "www.fiorella.com"],
    "type": "letsencrypt",
    "request_status": "pending",
    "status": "pending",
    "activation_status": null,
    "active": false,
    "created_at": "2022-09-18T13:18:51.000000Z"
}

Import certificate

Import an existing certificate.

POST /api/site/{id}/certificate

Parameters :

Parameter Description
type The type of certificate: letsencrypt, import or create.
private_key Private key to import.
certificate Certificate to import.

Example request :

curl "https://cloud.boxydev.com/api/site/1/certificate" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -d '{
        "type": "import",
        "private_key": "KEY",
        "certificate": "CERTIFICATE"
    }'

Example response :

{
    "id": 1,
    "domain": ["fiorella.com"],
    "type": "import",
    "request_status": "pending",
    "status": "pending",
    "activation_status": null,
    "active": false,
    "created_at": "2022-09-18T13:25:46.000000Z"
}

Get CSR certificate

Retrieve CSR certificate after create a new certificate.

GET /api/certificate/{id}/csr

Example request :

curl "https://cloud.boxydev.com/api/certificate/1/csr" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json"

Install certificate

Install a certificate.

POST /api/certificate/{id}/install

Parameters :

Parameter Description
certificate Certificate to install.

Example request :

curl "https://cloud.boxydev.com/api/certificate/1/install" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -d '{
        "certificate": "CONTENT"
    }'

Activate certificate

Activate a certificate on site.

POST /api/certificate/{id}/activate

Example request :

curl -X POST "https://cloud.boxydev.com/api/certificate/1/activate" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json"

Delete certificate

Delete a certificate.

DELETE /api/certificate/{id}

Example request :

curl -X DELETE "https://cloud.boxydev.com/api/certificate/1" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json"