SSLforSaaS API

Introduction

Welcome to the SSLforSaaS API documentation. These are the current project-scoped APIs for integrating custom-domain SSL automation with your SaaS platform.

Automated SSL for SaaS Domains

SSLforSaaS lets you create, inspect, disable, and delete customer custom domains under a project. Domain setup is asynchronous: API requests return quickly, then SSLforSaaS completes certificate setup and routing in the background.

Base URL
Use the production API host with workspace and project identifiers in the path.
HTTPS https://api.sslforsaas.io
Authentication

Project API requests use a project API key in the Authorization header. Generate or rotate the key from the project API settings in the dashboard.

HTTP
Authorization: ApiKey {PROJECT_API_KEY}
Content-Type: application/json
Info
Project keys are scoped. The default key supports project:read, domains:read, domains:write, and metrics:read. Never expose a project API key in browser code.
Quick-start

Queue a customer domain for SSL provisioning:

cURL
curl -X POST \
     -H "Authorization: ApiKey {PROJECT_API_KEY}" \
     -H "Content-Type: application/json" \
     -d '{"domain_name":"customer.example.com"}' \
     'https://api.sslforsaas.io/workspaces/{workspaceId}/projects/{projectId}/domains'

A successful create returns 202 Accepted with a domain_id, operation_id, customer-facing cname_target, and provisioning state. The target matches cname_domain from the project read response and the DNS instructions in Project Settings.

SSLforSaaS API

Basics

SSLforSaaS APIs are HTTP-based REST APIs. All request and response payloads are JSON.

General rules
  • All requests must be issued over HTTPS.
  • Project API requests use Authorization: ApiKey {PROJECT_API_KEY}.
  • All project API routes include {workspaceId} and {projectId}.
  • Domain creation and enable transitions are asynchronous and can return 202 Accepted.
  • Request and response bodies are application/json.
API Request
Project API routes use this shape:
ComponentDescription
Base URLhttps://api.sslforsaas.io
Project path/workspaces/{workspaceId}/projects/{projectId}
AuthenticationAuthorization: ApiKey {PROJECT_API_KEY}
Content-Type headerapplication/json
Supported scopesproject:read, project:write, domains:read, domains:write, metrics:read, metrics:write
API Response
Responses use standard HTTP status codes plus JSON bodies.
Status codeDescription
200Request completed successfully.
202Domain provisioning or enable work was accepted and queued.
400Invalid request body, identifier, or query parameter.
402Subscription inactive; activate billing before managing domains.
403Missing token, invalid key, inactive key, or insufficient scope.
404The requested workspace, project, or domain was not found.
409Conflict, duplicate domain, invalid Cloudflare mapping, or disabled-before-delete requirement.
500Server or provider configuration error.
Retry behavior

No plan-specific request throttling contract is currently published. If infrastructure returns 429 Too Many Requests, retry with backoff and preserve idempotency on your side.

SSLforSaaS API

Errors

The API uses JSON error bodies. The exact message can vary by endpoint, but the status code and errorCode fields identify the failure class when present.

Validation errors

Validation errors occur when a request body, identifier, or query parameter is missing or invalid.

JSON — 400 Bad Request
{
  "message": "Invalid request body"
}
Authorization errors

Authorization errors occur when the project API key is missing, invalid, revoked, inactive, or lacks the required scope.

JSON — 403 Forbidden
{
  "message": "Forbidden"
}
Domain lifecycle errors
Status codeDescription
402Subscription inactive. Activate billing to manage domains.
409Domain already exists, must be disabled before deletion, or cannot be configured in its current state.
500Service error. Contact support with the returned traceId.
Domains

Create a Domain

Add each domain in the dashboard or create it with this project API before directing customer traffic. DNS alone does not register a domain. A successful create request returns HTTP 202 and queues asynchronous provisioning; configure the returned customer-facing cname_target and check lifecycle status before cutover.

Endpoint
POST https://api.sslforsaas.io/workspaces/{workspaceId}/projects/{projectId}/domains

Requires the domains:write scope.

Sample Request
cURL
curl -X POST \
     -H "Authorization: ApiKey {PROJECT_API_KEY}" \
     -H "Content-Type: application/json" \
     -d '{"domain_name":"customer.example.com"}' \
     'https://api.sslforsaas.io/workspaces/{workspaceId}/projects/{projectId}/domains'
OK
A successful response returns HTTP 202. SSLforSaaS records the domain, returns a domain_id, and starts certificate setup asynchronously.
Request Parameters
ParameterTypeRequiredDescription
domain_namestringRequiredThe customer's custom domain, for example customer.example.com.
sourcestringOptionalSource label for audit/debug context. Defaults to Dashboard.
Sample Response
JSON — 202 Accepted
{
  "message": "Domain creation accepted and queued for asynchronous provisioning.",
  "domain_id": "65f000000000000000000001",
  "operation_id": "8b39f8a3-6f1b-4e85-8d4e-a8711a9e52d1",
  "cname_target": "project-id.sslforsaas.io",
  "provisioning": {
    "state": "queued",
    "hostname_status": "pending",
    "certificate_status": "pending"
  }
}

The returned cname_target is the customer-facing project CNAME, also available as cname_domain from GET /workspaces/{workspaceId}/projects/{projectId}. Do not point customer DNS at your application origin or an internal load-balancer hostname.

Domains

Disable or Delete a Domain

Disable a domain before deleting it. Disable removes provider routing/certificate state where applicable; delete removes the project-domain record after it is disabled.

Disable endpoint
PUT https://api.sslforsaas.io/workspaces/{workspaceId}/projects/{projectId}/domains/{domainId}

Requires the domains:write scope.

Disable request
cURL
curl -X PUT \
     -H "Authorization: ApiKey {PROJECT_API_KEY}" \
     -H "Content-Type: application/json" \
     -d '{"status":false}' \
     'https://api.sslforsaas.io/workspaces/{workspaceId}/projects/{projectId}/domains/{domainId}'
Delete endpoint
DELETE https://api.sslforsaas.io/workspaces/{workspaceId}/projects/{projectId}/domains/{domainId}
Note
Delete returns 409 domain_delete_requires_disabled unless the domain is already disabled.
SSL Certificates

Certificate Lifecycle

Cloudflare manages certificate issuance and renewal for domains added through the project-scoped API. SSLforSaaS exposes lifecycle state; it does not expose certificate upload or CA selection.

Info
Certificate upload and CA selection are not available through the project API. Use the domain endpoints and status fields described in this guide.
What the API supports

A project API key can work with domain lifecycle endpoints according to its declared scopes:

  • Add a customer domain to a project.
  • Read persisted DNS, hostname, and certificate status.
  • Check a registered domain's latest certificate status with GET /workspaces/{workspaceId}/projects/{projectId}/domains/{domainId}?check_status=1. A refresh can update the saved lifecycle state.
  • Disable a domain before deleting it.
Others

Webhooks

Project webhooks notify your server when SSLforSaaS emits workspace and user events that are subscribable for outbound delivery.

Webhook configuration

Configure webhooks from the project settings page. Owners and admins can set a webhook URL, enable/disable delivery, set a signing secret, and choose event types.

  • Webhook settings are project-scoped.
  • System events are visible in the notification catalog but are not project-webhook subscribable by default.
  • Webhook secrets are used to sign each delivery attempt.
Webhook payload structure

Outbound webhook deliveries include notification fields and a stable event_id inside the signed JSON body:

JSON
{
  "event_id": "65f000000000000000000002",
  "event_type": "workspace.domain_disabled",
  "scope": "workspace_event",
  "severity": "high",
  "title": "Domain disabled",
  "message": "Domain customer.example.com has been disabled.",
  "source": "domains.update",
  "workspace_id": "{workspaceId}",
  "project_id": "{projectId}",
  "payload": {
    "domain_id": "{domainId}",
    "domain_name": "customer.example.com"
  },
  "occurred_at": "2026-06-22T10:00:00Z"
}
Delivery headers
HeaderDescription
X-SSLforSaaS-EventThe event type, for example workspace.domain_disabled.
X-SSLforSaaS-Event-IdMirrors the signed body's event_id. Retries of the same event keep this identifier.
X-SSLforSaaS-TimestampUnix timestamp used in the signature payload.
X-SSLforSaaS-Signaturesha256=... HMAC of {timestamp}.{rawBody} using your webhook secret.
X-SSLforSaaS-Webhook-KeyOptional header key configured for the project.
Subscribable event types
EventDescription
workspace.domain_disabledA domain was disabled.
workspace.domain_enabledA domain was enabled.
workspace.domain_ssl_errorA domain SSL/provider issue needs attention.
workspace.domain_limit_alertA project is near or over its domain limit.
workspace.project_provisioning_failedProject provisioning failed.
user.team_inviteA team invitation event was emitted.
user.welcomeA one-time welcome event was emitted.
Best practices

Verify signatures

Recompute the HMAC with your webhook secret over {timestamp}.{rawBody} and compare it to X-SSLforSaaS-Signature.

Respond quickly

Return 2xx quickly and process long-running work asynchronously. SSLforSaaS retries transient delivery failures; use the signed event_id to avoid duplicate processing.

Be idempotent

Retries carry the same event_id. After verifying the signature, use the signed body's event_id to record processed events and skip duplicates. The X-SSLforSaaS-Event-Id header mirrors that value but is not itself signed. Delivery is not exactly-once.

Others

Application Endpoint and Origin Routing

Each project has one application endpoint that receives forwarded traffic for the project's customer domains. Configure this in project settings before adding domains.

How routing works

When a domain is added to a project, SSLforSaaS uses the project's Cloudflare and routing mapping to direct traffic to the configured application endpoint. The domain create API does not currently accept a per-domain target parameter.

  • Project application endpoint is the source of truth for origin routing.
  • Domain create returns the authoritative CNAME/target information for customer DNS setup.
  • Change the application endpoint in project settings; the updated route may take time to become active.
Read project routing context
GET https://api.sslforsaas.io/workspaces/{workspaceId}/projects/{projectId}

Requires the project:read scope.

Domains

List Domain Names

Retrieve a paginated list of custom domains in a project. Results can be sorted and filtered by domain-name prefix.

Endpoint
GET https://api.sslforsaas.io/workspaces/{workspaceId}/projects/{projectId}/domains

Requires the domains:read scope.

Sample Request
cURL
curl -X GET \
     -H "Authorization: ApiKey {PROJECT_API_KEY}" \
     'https://api.sslforsaas.io/workspaces/{workspaceId}/projects/{projectId}/domains?page=1&limit=20'

Sample Response

JSON — 200 OK
{
  "total": 2,
  "page": 1,
  "pages": 1,
  "domains": [
    {
      "_id": "65f000000000000000000001",
      "domain_name": "customer.example.com",
      "status": true,
      "ssl_status": "active",
      "provisioning": {
        "state": "active"
      }
    }
  ]
}
Query Parameters
ParameterTypeRequiredDescription
pageintegerOptionalPage number. Defaults to 1.
limitintegerOptionalPage size from 1 to 100. Defaults to 20.
qstringOptionalPrefix filter for domain_name.
sortBystringOptionalcreated_at, updated_at, or domain_name.
sortDirstringOptionalasc or desc. Defaults to desc.
Read one domain
GET https://api.sslforsaas.io/workspaces/{workspaceId}/projects/{projectId}/domains/{domainId}