directories

Register or rotate this directory's Turnstile widget

Both halves are required on every write, including one that only means to change the site key — they are a pair and are replaced together, so a mismatched pair cannot be created through this API. The secret is checked against Cloudflare before it is stored: an unrecognised one is a 400 and nothing is saved. PUT rather than POST because it is idempotent and there is at most one widget per directory; rotating is the same call.

put/v1/directories/{directoryId}/turnstile

Request

  • Base URL: https://api.epicdirectories.com
  • URL: https://api.epicdirectories.com/v1/directories/{directoryId}/turnstile
  • Auth: HTTP bearer

Path parameters

directoryIdstring required

Request body

siteKeystring required

The Turnstile SITE key — the public half, rendered in the page as data-sitekey. Published through /export so the form and the verifier cannot disagree about which widget is in use.

secretstring required

The Turnstile SECRET key — the private half. Stored, never returned by any endpoint in any shape. Required on every write, including one that only means to change the site key: the two are a pair and are replaced together.

Example request

{
  "siteKey": "0x4AAAAAAECip5aOzNT_oCWH",
  "secret": "0x4AAAAAAECip…"
}

Response

Widget registered; returns the same shape as GET

Changes

No recorded changes to this operation across all 1 revision of this API.