Quickstart: REST API

Integrate thin.host domain provisioning into any application using the REST API.

1. Get a Platform API Key

Sign up at thin.host/platform to get your API key.

2. Provision a Domain

curl

curl -X POST https://thin.host/v1/domains \
  -H "X-Platform-API-Key: th_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "domain": "mysite.com",
    "origin_url": "https://myapp.vercel.app",
    "end_user_email": "user@example.com"
  }'

Python

import requests

resp = requests.post(
    "https://thin.host/v1/domains",
    headers={"X-Platform-API-Key": "th_live_your_key"},
    json={
        "domain": "mysite.com",
        "origin_url": "https://myapp.vercel.app",
        "end_user_email": "user@example.com",
    },
)
data = resp.json()
print(data["claim_url"])  # Send this to the user

Node.js

const resp = await fetch("https://thin.host/v1/domains", {
  method: "POST",
  headers: {
    "X-Platform-API-Key": "th_live_your_key",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    domain: "mysite.com",
    origin_url: "https://myapp.vercel.app",
    end_user_email: "user@example.com",
  }),
});
const data = await resp.json();
console.log(data.claim_url); // Send this to the user

3. Check Status

curl https://thin.host/v1/domains/{id} \
  -H "X-Platform-API-Key: th_live_your_key"

# Response:
# {
#   "id": "...",
#   "hostname": "mysite.com",
#   "status": "active",
#   "dns_status": "resolved",
#   "ssl_status": "active",
#   "payment_status": "paid",
#   "ready": true
# }

4. Update Origin

curl -X PATCH https://thin.host/v1/domains/{id} \
  -H "X-Platform-API-Key: th_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{"origin_url": "https://new-deploy.vercel.app"}'

See the REST API Reference for full endpoint documentation.