Skip to content

Update Turnstile Config

POST/web/v1/system/workspaces/{workspaceId}/institutions/{institutionBizId}/portals/turnstile/update WEB

Updates the Cloudflare Turnstile configuration for the specified institution.

Required Headers

HeaderExample ValueDescription
Content-Typeapplication/jsonRequest content type
Acceptapplication/jsonExpected response type
X-Client-HashClient device fingerprint
Accept-Languageen, zh, zh-Hant, ja, viResponse language (default: en)
AuthorizationBearerJWT access token

Request Parameters

Path Parameters

NameTypeRequiredInDescription
workspaceIdstringRequiredpathWorkspace business ID
institutionBizIdstringRequiredpathInstitution business ID

Request Body

InstitutionTurnstileUpdateRequest:

NameTypeRequiredInDescription
turnstileSiteKeystringRequiredbodyCloudflare Turnstile site key (max 255 characters)
turnstileSecretKeystringRequiredbodyCloudflare Turnstile secret key (max 255 characters)
remarkstringOptionalbodyConfiguration remark (max 255 characters)
enabledbooleanOptionalbodyWhether to enable Turnstile (optional, preserves current state if omitted)

Example request body:

Request Body 200
{
  "turnstileSiteKey": "0x4AAAAAAABkMYinukE8nMDQ",
  "turnstileSecretKey": "0x4AAAAAAABkMYsecretKeyValue",
  "remark": "Production turnstile config",
  "enabled": true
}

Request Example

json
{
  "turnstileSiteKey": "0x4AAAAAAAB...",
  "turnstileSecretKey": "0x4AAAAAAAB...",
  "remark": "Production config"
}

Success Response

Success 200
{
  "success": true,
  "code": "2000",
  "message": "SUCCESS",
  "data": {
    "id": 1,
    "institutionBizId": "INST_ACME_001",
    "turnstileSiteKey": "0x4AAAAAAABkMYinukE8nMDQ",
    "turnstileSecretKey": "****alue",
    "enabled": true,
    "remark": "Production turnstile config",
    "createdAt": "2026-03-21T00:00:00Z",
    "updatedAt": "2026-03-23T10:00:00Z"
  }
}

Error Responses

CodeDescription
4000Validation error (missing required keys or exceeds max length)
4010Unauthorized (invalid or missing JWT token)
4040Institution not found

Notes

  • Both turnstileSiteKey and turnstileSecretKey are required fields.
  • The secret key is masked in the response. Only the last 4 characters are visible (format: ****xxxx).
  • If no Turnstile configuration exists yet, this endpoint creates one.
  • To toggle Turnstile on/off without changing keys, use Enable Turnstile / Disable Turnstile.

SlaunchX Internal Documentation