ValidationValidate Rule Pattern

Validate Rule Pattern

Checks whether the supplied rule glob/pattern is syntactically valid for the given zone. Called client-side with a 500 ms debounce as the user types the rule pattern field. Returns result: "success" when the pattern is valid.

curl -X POST "https://api.5centscdn.com/v2/validate/rule" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
  "rule": "/images/*",
  "zoneid": 12345,
  "zonetype": "pull"
}'
{
  "result": "success"
}
POST
/validate/rule
POST
Base URLstring

Target server for requests. Edit to use your own host.

API Key (header: X-API-Key)
X-API-Keystring
Required

API key (sent in header)

Content-Typestring
Required

The media type of the request body

Options: application/json
rulestring
Required

The URL pattern or regex string to validate. Same value as the rule field in the create/update payload. Supports plain path patterns (e.g. /images/*) and regex (e.g. ^/api/v[0-9]+/).

zoneidinteger
Required

The numeric ID of the zone this rule will belong to.

zonetypestring
Required

The type of the zone. Determines which pattern syntax rules apply. Must match the zone's type exactly.

Options: pull, push
Request Preview
Response

Response will appear here after sending the request

Authentication

header
X-API-Keystring
Required

API Key for authentication. Provide your API key in the header.

Body

application/json
rulestring
Required

The URL pattern or regex string to validate. Same value as the rule field in the create/update payload. Supports plain path patterns (e.g. /images/*) and regex (e.g. ^/api/v[0-9]+/).

Example:
/images/*
zoneidinteger
Required

The numeric ID of the zone this rule will belong to.

Example:
12345
zonetypestring
Required

The type of the zone. Determines which pattern syntax rules apply. Must match the zone's type exactly.

Allowed values:pullpush

Responses

resultstring
Required

Status of the API response.

Allowed values:success