Documentation

Learn how to use Tenant SSL to help you manage SSL certificate provisioning for your SAAS tenants.

Introduction

Tenant SSL's API endpoint uses a RESTful architecture. All requests and responses follow the JSON format.

Authorization

All requests must be authorized with your account credentials. Your credentials are found in Tenant SSL's dashboard.

You will need to send two headers to authorize your requests:

Example:

curl -H "X-API-CLIENT-ID: f0f7..." -H "X-API-CLIENT-SECRET: 43f0..." -X GET https://api.tenantssl.com/domains.json

X-API-CLIENT-ID and X-API-CLIENT-SECRET are truncated in this example

Unauthorized requests return a status code of 403.

API Endpoint

All requests should be made to
https://api.tenantssl.com
.
GET /domains.json

You can add an unlimited number of domains to your account. Remember: You're not charged on the number of domains but the number of SSL certificates that are issued.

Calling the
/domains.json
endpoint will return an array of domains like the following:
    
[
  {
    "id": 4,
    "dns_verified": true,
    "le_verified": true,
    "le_issued": true,
    "value": "mycustomdomain.com",
    "proxy_pass": "https://verify.tenantssl.com",
    "created_at": "2018-09-19T22:04:48.014Z",
    "updated_at": "2018-09-19T22:04:55.852Z",
    "status": "success"
  }
]
    
  
POST /domains.json
Make a POST request to the
/domains.json
endpoint to create a new domain in your account with the following request body. The request should set the value of the domain itself and, optionally, the target URL of where you want this domain to proxy.
    
{
  "domain": {
    value: "mydomain.com",
    proxy_pass: "https://mysaas.com"
  }
}
    
  
GET /domains/:id.json
Retrieve the domain record by calling the
/domains/:id.json
endpoint. Replace :id with the numeric ID of the domain record. In order to reference the domains in Tenant SSL, you should save the ID to your application's database. The response will be similar to the following.
    
{
  "id": 4,
  "dns_verified": true,
  "le_verified": true,
  "le_issued": true,
  "value": "mycustomdomain.com",
  "proxy_pass": "https://verify.tenantssl.com",
  "created_at": "2018-09-19T22:04:48.014Z",
  "updated_at": "2018-09-19T22:04:55.852Z",
  "status": "success"
}
    
  
PATCH /domains/:id.json

Send a PATCH request to update a record. Only the proxy_pass value is accepted. Replace the :id value with the ID of the domain record.

    
{
  "domain": {
    proxy_pass: "https://mysaas.com"
  }
}
    
  
POST /domains/:id/verify.json

Send a POST request to perform DNS verification and Let's Encrypt verification on the domain record.

Tenant SSL will return the record of the domain. You should be able to see if the domain has passed DNS and Let's Encrypt verification by looking at dns_verified and le_verified respectively.

POST /domains/:id/activate.json

Send a POST request to have Let's Encrypt issue a certificate.

Tenant SSL will return the record of the domain. You should be able to see if a SSL certificate has been issued for the domain by looking at the le_issued property in the response.

It is recommended that you perform the verify check (above) before calling the activate endpoint.

DELETE /domains/:id.json

Send a DELETE request to remove the domain. The associated SSL certificate will be removed as well.

Copyright 2018 Tenant SSL