API
Certificates API
Manage SSL/TLS certificates
Certificates API
The Certificates API allows you to manage SSL/TLS certificates for load balancers.
List Certificates
Returns all Certificate objects.
const certificates = await client.certificates.list();Get Certificate
Returns a specific Certificate object.
const certificate = await client.certificates.get(12345);Create Certificate
Creates a new Certificate.
// Uploaded certificate
const cert = await client.certificates.create({
name: 'my-cert',
certificate: '-----BEGIN CERTIFICATE-----...',
private_key: '-----BEGIN PRIVATE KEY-----...',
labels: { environment: 'production' }
});
// Let's Encrypt certificate
const cert = await client.certificates.create({
name: 'my-cert',
type: 'managed',
domain_names: ['example.com', 'www.example.com'],
labels: { environment: 'production' }
});Update Certificate
Updates a Certificate.
const updated = await client.certificates.update(12345, {
name: 'new-name',
labels: { environment: 'production' }
});Delete Certificate
Deletes a Certificate.
await client.certificates.delete(12345);Certificate Actions
Retry Issuance
Retries the issuance process for a managed certificate.
await client.certificates.retryIssuance(12345);Types
type CertificateType = 'uploaded' | 'managed';
type CertificateStatus = 'pending' | 'issued' | 'failed';
interface Certificate {
id: number;
name: string;
type: CertificateType;
status: CertificateStatus;
certificate: string | null;
created: string;
not_valid_before: string;
not_valid_after: string;
domain_names: string[];
fingerprint: string | null;
labels: Record<string, string>;
used_by: Array<{
id: number;
type: 'load_balancer';
}>;
}