VOD PushCreate Rule

Create Rule

Creates a new edge rule for the zone. The body must include "_METHOD": "PUT" alongside the standard rule payload. On success the server returns result: "success" with a human-readable message.

curl -X POST "https://api.5centscdn.com/v2/zones/vod/push/12345/rules/rule" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
  "_METHOD": "PUT",
  "name": "Cache Stream",
  "rule": "/live/*",
  "options": {
    "edge_cache_settings": {
      "enabled": null,
      "control": "default",
      "default": "345600s",
      "value": "345600s",
      "revalidate": null,
      "custom": {
        "default": "",
        "value": ""
      },
      "custom_values": {
        "codes": [],
        "value": []
      }
    },
    "midgress_cache_settings": {
      "enabled": null,
      "control": "default",
      "default": "345600s",
      "value": "345600s",
      "revalidate": null,
      "custom": {
        "default": "",
        "value": ""
      },
      "custom_values": {
        "codes": [],
        "value": []
      }
    },
    "browser_cache_settings": {
      "enabled": null,
      "control": "default",
      "value": "345600s",
      "custom": {
        "value": ""
      }
    },
    "country_acl": {
      "enabled": null,
      "policy_type": "allow",
      "excepted_values": [],
      "ip_whitelists": []
    },
    "ip_address_acl": {
      "enabled": null,
      "policy_type": "allow",
      "excepted_values": [],
      "ip_whitelists": []
    },
    "user_agent_acl": {
      "enabled": null,
      "policy_type": "allow",
      "excepted_values": [],
      "ip_whitelists": [],
      "casesensitive": false
    },
    "referrer_acl": {
      "enabled": null,
      "policy_type": "allow",
      "noreferer": false,
      "excepted_values": [],
      "ip_whitelists": []
    },
    "secure_key": {
      "enabled": null,
      "policy_type": 0,
      "session": 0,
      "key": "",
      "ip_whitelists": [],
      "type": false
    },
    "limit_bandwidth": {
      "enabled": null,
      "limit_type": "static",
      "speed": 12000,
      "buffer": 1024
    },
    "limit_request": {
      "enabled": null,
      "rate": 9,
      "burst": 98,
      "delay": 96,
      "ip_whitelists": []
    },
    "rewrite": {
      "enabled": null,
      "body": "",
      "flag": "break"
    },
    "host_redirect": {
      "enabled": null,
      "to": "",
      "value": []
    },
    "redirect_http_to_https": {
      "enabled": null
    },
    "hsts": {
      "enabled": null,
      "referrerPolicy": "no-referrer",
      "includeSubDomains": true,
      "preload": true
    },
    "force_return": {
      "enabled": null,
      "code": 200,
      "body": ""
    },
    "stale": {
      "enabled": null,
      "value": ""
    },
    "staticHeaders": {
      "enabled": null,
      "keys": [],
      "values": []
    },
    "cors": {
      "enabled": null,
      "control": "*",
      "always": false,
      "value": "*",
      "custom": ""
    }
  }
}'
{
  "result": "success",
  "message": "Zone EdgeRule Created. Please wait till the rules validation & deployment completes.",
  "ruleid": 8435
}
POST
/zones/vod/push/{zoneId}/rules/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)

path
zoneIdinteger
Required

Numeric ID of the zone

Content-Typestring
Required

The media type of the request body

Options: application/json
_METHODstring
Required

HTTP method override. Always "PUT" for create.

Options: PUT
namestring
Required

Human-readable label for the rule.

rulestring
Required

URL pattern or regex applied to incoming requests. Validated via /validate/rule.

optionsobject
Required

Container for all behavior option groups.

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.

Path Parameters

zoneIdinteger
Required

Numeric ID of the zone

Example:
12345

Body

application/json
_METHODstring
Required

HTTP method override. Always "PUT" for create.

Allowed values:PUT
namestring
Required

Human-readable label for the rule.

Example:
Cache Stream
rulestring
Required

URL pattern or regex applied to incoming requests. Validated via /validate/rule.

Example:
/live/*
optionsobject
Required

Container for all behavior option groups.

Responses

resultstring
Required

Status of the API response.

Allowed values:success
messagestring
Required
ruleidinteger
Required

The numeric ID of the newly created edge rule.