Logo
OpenScaler
API Documentation/Load Balancer Certificates

Create / Upload a Certificate

Attach an SSL/TLS certificate to the given load balancer. Three certificate types are supported:

TypeDescription
self_signedAuto-generate a self-signed certificate.
let_encryptAuto-generate a Let's Encrypt certificate (requires cn_name and let_encrypt_email).
uploadUpload an existing PEM certificate via cert_content.
POST
/v1/lbs/{lb_id}/certificates

Authorization

AuthorizationRequiredBearer <token>

OAuth Authentication

OpenScaler API uses OAuth, a standard for secure authorization. To access the API, obtain a token via the OpenScaler Platform.

Use the access_token in the Authorization header for requests:

Authorization: Bearer <token>

Always keep your token secure and do not share it with anyone.

In: header

Request Body

application/jsonRequired
nameRequiredstring

Name for this certificate.

cert_typeRequiredstring

Certificate generation type.

Value in: "self_signed" | "let_encrypt" | "upload"
cn_namestring

Common Name (domain name). Required for let_encrypt.

let_encrypt_emailstring

Email address for Let's Encrypt notifications. Required for let_encrypt.

cert_contentstring

PEM-encoded certificate content. Required for upload.

Path Parameters

lb_idRequiredstring

A unique identifier for a load balancer instance.

curl -X POST "https://api.alpha.openscaler.net/v1/lbs/42/certificates" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-cert",
    "cert_type": "upload",
    "cn_name": "example.com",
    "let_encrypt_email": "admin@example.com",
    "cert_content": "-----BEGIN CERTIFICATE-----\n..."
  }'

Certificate created/uploaded successfully.

{
  "name": "my-cert",
  "cert_type": "upload",
  "common_name": "example.com",
  "subject": "CN=example.com",
  "domains": "example.com, www.example.com",
  "issuers": "Let's Encrypt Authority X3",
  "not_before": "2024-01-01T00:00:00Z",
  "not_after": "2025-01-01T00:00:00Z",
  "serial": "03:AB:CD:EF",
  "size": 2048
}