Domains API

Overview

The Domains API lets you manage which sites RndrKit pre-renders. All endpoints require an API key in the X-Api-Key header (see Authentication).

List Domains

Returns all domains owned by the authenticated user.

GET /api/domains

curl

curl https://rndrkit.io/api/domains \
  -H "X-Api-Key: rk_live_your_key_here"

JavaScript

const response = await fetch("https://rndrkit.io/api/domains", {
  headers: { "X-Api-Key": "rk_live_your_key_here" },
});
const data = await response.json();
console.log(data.domains);

Response 200

{
  "domains": [
    {
      "id": 42,
      "custom_domain": "example.com",
      "origin_url": "https://myapp.lovable.app",
      "ssl_enabled": true,
      "renders_used": 1204,
      "monthly_render_limit": 10000,
      "is_active": true,
      "created_at": "2026-01-15T08:30:00.000Z",
      "updated_at": "2026-02-10T14:22:00.000Z"
    }
  ]
}

Create Domain

Adds a new domain to your account. The API validates your subscription's site limit before creating -- if you are at your max, you will get a 403.

The origin_url is validated for SSRF protection. Internal IPs, localhost, and non-HTTP schemes are rejected.

POST /api/domains

curl

curl -X POST https://rndrkit.io/api/domains \
  -H "X-Api-Key: rk_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "custom_domain": "example.com",
    "origin_url": "https://myapp.lovable.app"
  }'

JavaScript

const response = await fetch("https://rndrkit.io/api/domains", {
  method: "POST",
  headers: {
    "X-Api-Key": "rk_live_your_key_here",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    custom_domain: "example.com",
    origin_url: "https://myapp.lovable.app",
  }),
});
const data = await response.json();
console.log(data.domain);

Response 201

{
  "domain": {
    "id": 43,
    "custom_domain": "example.com",
    "origin_url": "https://myapp.lovable.app",
    "ssl_enabled": false,
    "renders_used": 0,
    "monthly_render_limit": 10000,
    "is_active": true,
    "created_at": "2026-02-18T12:00:00.000Z",
    "updated_at": "2026-02-18T12:00:00.000Z"
  }
}

Error Responses

StatusBodyMeaning
400{"error": "Missing required fields: custom_domain, origin_url"}Missing body fields
400{"error": "Invalid origin URL: ..."}SSRF protection triggered
403{"error": "Site limit reached for your subscription plan", "current": 3, "allowed": 3}At subscription limit
409{"error": "Domain already exists. Use PUT to update a domain you own."}Domain already registered

Delete Domain

Deletes a domain by name. All cached pages for this domain are purged automatically. You must own the domain -- the API checks ownership before deletion.

DELETE /api/domains/:domain

curl

curl -X DELETE https://rndrkit.io/api/domains/example.com \
  -H "X-Api-Key: rk_live_your_key_here"

JavaScript

const domain = "example.com";
const response = await fetch(`https://rndrkit.io/api/domains/${domain}`, {
  method: "DELETE",
  headers: { "X-Api-Key": "rk_live_your_key_here" },
});
const data = await response.json();
console.log(data.deleted);

Response 200

{
  "deleted": {
    "id": 43,
    "custom_domain": "example.com",
    "origin_url": "https://myapp.lovable.app",
    "is_active": true
  }
}

Response 404

{
  "error": "Domain not found"
}