Skip to content

Get a rewrite rule

GET
/api/zones/{zoneId}/rewrite-rules/{id}

Returns a single rewrite rule identified by its id within the zone.

Authorizations

ApiToken

Long-lived API token created via POST /api/api-tokens (returned once in plaintext).

Type
API Key (header: X-API-TOKEN)
or
JWT

JWT access token obtained via POST /api/auth/login. Send as: Authorization: Bearer .

Type
HTTP (bearer)

Parameters

Path Parameters

zoneId*

Zone identifier

Type
string
Required
id*

rewrite-rule identifier

Type
string
Required

Responses

rewrite-rule resource

JSON
{
  
"@context": "string",
  
"@id": "string",
  
"@type": "string",
  
"id": "string",
  
"zone": "https://example.com/",
  
"name": "Redirect old blog paths",
  
"description": "Rewrites legacy /blog/* URLs to the new /articles/* structure.",
  
"operator": "regex",
  
"sourcePattern": "^/blog/(.*)$",
  
"target": "/articles/$1",
  
"order": 0,
  
"enabled": true,
  
"createdAt": "string",
  
"updatedAt": "string"
}

Playground

Authorization
Variables
Key
Value

Samples

Powered by VitePress OpenAPI