API reference

/v1/edge-scripts

12 operations · 12 support API keys

← All groups · First call? Read the tutorial: auth, permissions, requests and responses, common failures

MethodPathSummaryAuth
GET/v1/edge-scriptsList edge scriptsAPI keySession
POST/v1/edge-scriptsCreate an edge scriptAPI keySession
POST/v1/edge-scripts/checkCheck an edge script sourceAPI keySession
POST/v1/edge-scripts/trialRun an edge script against a sample requestAPI keySession
GET/v1/edge-scripts/{script_id}Get an edge scriptAPI keySession
PUT/v1/edge-scripts/{script_id}Save an edge script draftAPI keySession
DELETE/v1/edge-scripts/{script_id}Delete an edge scriptAPI keySession
POST/v1/edge-scripts/{script_id}/publishPublish the draft of an edge scriptAPI keySession
GET/v1/edge-scripts/{script_id}/referencesList the policies running an edge scriptAPI keySession
POST/v1/edge-scripts/{script_id}/rollbackRoll an edge script back to a versionAPI keySession
GET/v1/edge-scripts/{script_id}/versionsList the versions of an edge scriptAPI keySession
GET/v1/edge-scripts/{script_id}/versions/{version}Get one version of an edge scriptAPI keySession

Contract file:api/openapi/v1/control.yaml

Operation details

GET /v1/edge-scripts

List edge scripts

operationId
listEdgeScripts
Auth
  • API key: header Authorization: CdncaKey <key_id>.<secret>. Effective permissions are the key scopes intersected with the owner’s current permissions.
  • Session: the Bearer session of a signed-in control plane user, used by the customer in their own control plane; a plugin must never ask for it.
Required permissions

The contract has no separate permission annotation; see the description below and the 403 response.

Description (from the contract)

Requires security_policies.read. Tenant identities only. enabled is true when module.edge_script is granted and a valid package has limits.edge_script; when false the console hides the menu and the script rule action (existing scripts stay readable).

Responses

listEdgeScripts Responses
StatusDescription
200Scripts by name.

Fields:items: array<EdgeScript> enabled: boolean

401Authentication failed or the session is invalid.
403The authenticated principal is not allowed to perform the action.
503Edge scripts or their entitlement are unavailable (edge_scripts_unavailable).

What to do on failure

  • 401 Check the credential format and whether it expired or was rotated.
  • 403 Check the key scopes, the owner’s current permissions and the tenant scope; never switch to a more privileged account.
  • 503 A dependency is unavailable: retry later with the original Idempotency-Key.

↑ Back to list

POST /v1/edge-scripts

Create an edge script

operationId
createEdgeScript
Auth
  • API key: header Authorization: CdncaKey <key_id>.<secret>. Effective permissions are the key scopes intersected with the owner’s current permissions.
  • Session: the Bearer session of a signed-in control plane user, used by the customer in their own control plane; a plugin must never ask for it.
Required permissions

The contract has no separate permission annotation; see the description below and the 403 response.

Description (from the contract)

Requires security_policies.manage; tenant only; module.edge_script and limits.edge_script (403 entitlement_feature_denied / package_feature_denied). Creates the script with a draft that is not published. At most 50 live scripts per tenant (422 edge_script_limit); a name is unique per tenant (409 edge_script_name_conflict). Omitted settings take the defaults. Audit edge_script.create.

Request body

application/json · Required:Yes

createEdgeScript Request body
NameTypeRequiredDescription
failure_modestring: deny / allowNodeny answers 503 on an error or limit hit, allow lets the request through and drops the script's intents.
max_instructionsintegerNo—
max_time_msintegerNo—
max_memory_kbintegerNo—
namestringYes—
descriptionstringNo—
sourcestringNo—

Responses

createEdgeScript Responses
StatusDescription
201Created.

Fields:failure_mode?: string: deny / allow max_instructions?: integer max_time_ms?: integer max_memory_kb?: integer id: string(uuid) name: string description: string source: string current_version: integer latest_version: integer dirty: boolean reference_count: integer revision: integer updated_at: string(date-time)

400The request body or parameters are invalid.
401Authentication failed or the session is invalid.
403The authenticated principal is not allowed to perform the action.
409The requested state conflicts with an existing resource or idempotency fact.
422The request is well formed but breaks a business rule (error.code names it).
500The request could not be completed because of an internal failure.

What to do on failure

  • 400 Fix the parameters or body per the field list; do not retry unchanged.
  • 401 Check the credential format and whether it expired or was rotated.
  • 403 Check the key scopes, the owner’s current permissions and the tenant scope; never switch to a more privileged account.
  • 409 Read the current state first; a retry of the same operation keeps the original Idempotency-Key and body.
  • 500 Outcome unknown: read back by ID or list first, then decide whether to retry with the original Idempotency-Key.

↑ Back to list

POST /v1/edge-scripts/check

Check an edge script source

operationId
checkEdgeScript
Auth
  • API key: header Authorization: CdncaKey <key_id>.<secret>. Effective permissions are the key scopes intersected with the owner’s current permissions.
  • Session: the Bearer session of a signed-in control plane user, used by the customer in their own control plane; a plugin must never ask for it.
Required permissions

The contract has no separate permission annotation; see the description below and the 403 response.

Description (from the contract)

Requires security_policies.read. Parses the source and checks forbidden identifiers, string.dump, concatenation chains over 16 operands and the 32 KiB size; never runs it. Not stored, not audited. Each diagnostic carries a 1-based line (0: the whole source).

Request body

application/json · Required:Yes

checkEdgeScript Request body
NameTypeRequiredDescription
sourcestringYes—

Responses

checkEdgeScript Responses
StatusDescription
200The check result.

Fields:ok: boolean diagnostics: array<object>

400The request body or parameters are invalid.
401Authentication failed or the session is invalid.
403The authenticated principal is not allowed to perform the action.
500The request could not be completed because of an internal failure.

What to do on failure

  • 400 Fix the parameters or body per the field list; do not retry unchanged.
  • 401 Check the credential format and whether it expired or was rotated.
  • 403 Check the key scopes, the owner’s current permissions and the tenant scope; never switch to a more privileged account.
  • 500 Outcome unknown: read back by ID or list first, then decide whether to retry with the original Idempotency-Key.

↑ Back to list

POST /v1/edge-scripts/trial

Run an edge script against a sample request

operationId
trialEdgeScript
Auth
  • API key: header Authorization: CdncaKey <key_id>.<secret>. Effective permissions are the key scopes intersected with the owner’s current permissions.
  • Session: the Bearer session of a signed-in control plane user, used by the customer in their own control plane; a plugin must never ask for it.
Required permissions

The contract has no separate permission annotation; see the description below and the 403 response.

Description (from the contract)

Requires security_policies.read. Runs the source in a resource-limited child process of the control plane: a simulation, not the node's result (instruction counts are not reported, bit and country are simulated; the node's real result is in the security log). 500 ms wall clock; at most 4 trials at once; 30 trials per tenant per minute (429 edge_script_trial_rate_limited). A source that fails the check answers outcome fail, reason syntax. Not stored, not audited.

Request body

application/json · Required:Yes

trialEdgeScript Request body
NameTypeRequiredDescription
sourcestringYes—
failure_modestring: deny / allowNo—
requestobjectNo—

Responses

trialEdgeScript Responses
StatusDescription
200The trial result.

Fields:outcome: string: continue / exit / fail reason?: string detail?: string status?: integer redirect?: string response_headers: array<EdgeScriptTrialHeader> request_headers: array<EdgeScriptTrialHeader> elapsed_ms: number failure_mode: string

400The request body or parameters are invalid.
401Authentication failed or the session is invalid.
403The authenticated principal is not allowed to perform the action.
429Too many trials (edge_script_trial_rate_limited).
503Trials are not configured (edge_scripts_unavailable).

What to do on failure

  • 400 Fix the parameters or body per the field list; do not retry unchanged.
  • 401 Check the credential format and whether it expired or was rotated.
  • 403 Check the key scopes, the owner’s current permissions and the tenant scope; never switch to a more privileged account.
  • 429 Rate limited: wait, then retry with lower concurrency.
  • 503 A dependency is unavailable: retry later with the original Idempotency-Key.

↑ Back to list

GET /v1/edge-scripts/{script_id}

Get an edge script

operationId
getEdgeScript
Auth
  • API key: header Authorization: CdncaKey <key_id>.<secret>. Effective permissions are the key scopes intersected with the owner’s current permissions.
  • Session: the Bearer session of a signed-in control plane user, used by the customer in their own control plane; a plugin must never ask for it.
Required permissions

The contract has no separate permission annotation; see the description below and the 403 response.

Description (from the contract)

Requires security_policies.read. The script with its draft; dirty is true when the draft differs from the current version.

Parameters

getEdgeScript Parameters
NameInTypeRequiredDescription
script_idpathstring(uuid)Yes—

Responses

getEdgeScript Responses
StatusDescription
200The script.

Fields:failure_mode?: string: deny / allow max_instructions?: integer max_time_ms?: integer max_memory_kb?: integer id: string(uuid) name: string description: string source: string current_version: integer latest_version: integer dirty: boolean reference_count: integer revision: integer updated_at: string(date-time)

400The request body or parameters are invalid.
401Authentication failed or the session is invalid.
403The authenticated principal is not allowed to perform the action.
404The requested resource was not found.

What to do on failure

  • 400 Fix the parameters or body per the field list; do not retry unchanged.
  • 401 Check the credential format and whether it expired or was rotated.
  • 403 Check the key scopes, the owner’s current permissions and the tenant scope; never switch to a more privileged account.
  • 404 The resource does not exist or belongs to another tenant.

↑ Back to list

PUT /v1/edge-scripts/{script_id}

Save an edge script draft

operationId
updateEdgeScript
Auth
  • API key: header Authorization: CdncaKey <key_id>.<secret>. Effective permissions are the key scopes intersected with the owner’s current permissions.
  • Session: the Bearer session of a signed-in control plane user, used by the customer in their own control plane; a plugin must never ask for it.
Required permissions

The contract has no separate permission annotation; see the description below and the 403 response.

Description (from the contract)

Requires security_policies.manage, the current revision, module.edge_script and limits.edge_script. Replaces the name, description, settings and source of the draft (revision + 1); the nodes keep running the current version. Audit edge_script.update.

Parameters

updateEdgeScript Parameters
NameInTypeRequiredDescription
script_idpathstring(uuid)Yes—

Request body

application/json · Required:Yes

updateEdgeScript Request body
NameTypeRequiredDescription
failure_modestring: deny / allowNodeny answers 503 on an error or limit hit, allow lets the request through and drops the script's intents.
max_instructionsintegerNo—
max_time_msintegerNo—
max_memory_kbintegerNo—
namestringYes—
descriptionstringNo—
sourcestringNo—
expected_revisionintegerYes—

Responses

updateEdgeScript Responses
StatusDescription
200Saved.

Fields:failure_mode?: string: deny / allow max_instructions?: integer max_time_ms?: integer max_memory_kb?: integer id: string(uuid) name: string description: string source: string current_version: integer latest_version: integer dirty: boolean reference_count: integer revision: integer updated_at: string(date-time)

400The request body or parameters are invalid.
401Authentication failed or the session is invalid.
403The authenticated principal is not allowed to perform the action.
404The requested resource was not found.
409The requested state conflicts with an existing resource or idempotency fact.

What to do on failure

  • 400 Fix the parameters or body per the field list; do not retry unchanged.
  • 401 Check the credential format and whether it expired or was rotated.
  • 403 Check the key scopes, the owner’s current permissions and the tenant scope; never switch to a more privileged account.
  • 404 The resource does not exist or belongs to another tenant.
  • 409 Read the current state first; a retry of the same operation keeps the original Idempotency-Key and body.

↑ Back to list

DELETE /v1/edge-scripts/{script_id}

Delete an edge script

operationId
deleteEdgeScript
Auth
  • API key: header Authorization: CdncaKey <key_id>.<secret>. Effective permissions are the key scopes intersected with the owner’s current permissions.
  • Session: the Bearer session of a signed-in control plane user, used by the customer in their own control plane; a plugin must never ask for it.
Required permissions

The contract has no separate permission annotation; see the description below and the 403 response.

Description (from the contract)

Requires security_policies.manage and the current revision (entitlement is not asked). A script a live policy runs is refused (409 edge_script_in_use). Audit edge_script.delete.

Parameters

deleteEdgeScript Parameters
NameInTypeRequiredDescription
script_idpathstring(uuid)Yes—
expected_revisionqueryintegerYes—

Responses

deleteEdgeScript Responses
StatusDescription
204Deleted.
400The request body or parameters are invalid.
401Authentication failed or the session is invalid.
403The authenticated principal is not allowed to perform the action.
404The requested resource was not found.
409The requested state conflicts with an existing resource or idempotency fact.

What to do on failure

  • 400 Fix the parameters or body per the field list; do not retry unchanged.
  • 401 Check the credential format and whether it expired or was rotated.
  • 403 Check the key scopes, the owner’s current permissions and the tenant scope; never switch to a more privileged account.
  • 404 The resource does not exist or belongs to another tenant.
  • 409 Read the current state first; a retry of the same operation keeps the original Idempotency-Key and body.

↑ Back to list

POST /v1/edge-scripts/{script_id}/publish

Publish the draft of an edge script

operationId
publishEdgeScript
Auth
  • API key: header Authorization: CdncaKey <key_id>.<secret>. Effective permissions are the key scopes intersected with the owner’s current permissions.
  • Session: the Bearer session of a signed-in control plane user, used by the customer in their own control plane; a plugin must never ask for it.
Required permissions

The contract has no separate permission annotation; see the description below and the 403 response.

Description (from the contract)

Requires security_policies.manage, the current revision, module.edge_script and limits.edge_script. Checks the draft (422 edge_script_check_failed with diagnostics and line numbers), stores it as an immutable version latest + 1, makes it current and republishes every tenant whose bound WAF policy runs the script (system trigger edge_script). The newest 100 versions are kept. Audit edge_script.publish.

Parameters

publishEdgeScript Parameters
NameInTypeRequiredDescription
script_idpathstring(uuid)Yes—

Request body

application/json · Required:Yes

publishEdgeScript Request body
NameTypeRequiredDescription
expected_revisionintegerYes—
notestringNo—

Responses

publishEdgeScript Responses
StatusDescription
200Published.

Fields:failure_mode?: string: deny / allow max_instructions?: integer max_time_ms?: integer max_memory_kb?: integer id: string(uuid) name: string description: string source: string current_version: integer latest_version: integer dirty: boolean reference_count: integer revision: integer updated_at: string(date-time)

400The request body or parameters are invalid.
401Authentication failed or the session is invalid.
403The authenticated principal is not allowed to perform the action.
404The requested resource was not found.
409The requested state conflicts with an existing resource or idempotency fact.
422The request is well formed but breaks a business rule (error.code names it).

What to do on failure

  • 400 Fix the parameters or body per the field list; do not retry unchanged.
  • 401 Check the credential format and whether it expired or was rotated.
  • 403 Check the key scopes, the owner’s current permissions and the tenant scope; never switch to a more privileged account.
  • 404 The resource does not exist or belongs to another tenant.
  • 409 Read the current state first; a retry of the same operation keeps the original Idempotency-Key and body.

↑ Back to list

GET /v1/edge-scripts/{script_id}/references

List the policies running an edge script

operationId
listEdgeScriptReferences
Auth
  • API key: header Authorization: CdncaKey <key_id>.<secret>. Effective permissions are the key scopes intersected with the owner’s current permissions.
  • Session: the Bearer session of a signed-in control plane user, used by the customer in their own control plane; a plugin must never ask for it.
Required permissions

The contract has no separate permission annotation; see the description below and the 403 response.

Description (from the contract)

Requires security_policies.read. The tenant's live WAF policies with a script rule naming it, by policy name; rule_count counts those rules.

Parameters

listEdgeScriptReferences Parameters
NameInTypeRequiredDescription
script_idpathstring(uuid)Yes—

Responses

listEdgeScriptReferences Responses
StatusDescription
200References.

Fields:items: array<object>

400The request body or parameters are invalid.
401Authentication failed or the session is invalid.
403The authenticated principal is not allowed to perform the action.
404The requested resource was not found.

What to do on failure

  • 400 Fix the parameters or body per the field list; do not retry unchanged.
  • 401 Check the credential format and whether it expired or was rotated.
  • 403 Check the key scopes, the owner’s current permissions and the tenant scope; never switch to a more privileged account.
  • 404 The resource does not exist or belongs to another tenant.

↑ Back to list

POST /v1/edge-scripts/{script_id}/rollback

Roll an edge script back to a version

operationId
rollbackEdgeScript
Auth
  • API key: header Authorization: CdncaKey <key_id>.<secret>. Effective permissions are the key scopes intersected with the owner’s current permissions.
  • Session: the Bearer session of a signed-in control plane user, used by the customer in their own control plane; a plugin must never ask for it.
Required permissions

The contract has no separate permission annotation; see the description below and the 403 response.

Description (from the contract)

Requires security_policies.manage, the current revision, module.edge_script and limits.edge_script. Makes an existing version current again (404 edge_script_version_not_found); the draft stays. Republishes every tenant running the script (system trigger edge_script). Audit edge_script.rollback.

Parameters

rollbackEdgeScript Parameters
NameInTypeRequiredDescription
script_idpathstring(uuid)Yes—

Request body

application/json · Required:Yes

rollbackEdgeScript Request body
NameTypeRequiredDescription
expected_revisionintegerYes—
versionintegerYes—

Responses

rollbackEdgeScript Responses
StatusDescription
200Rolled back.

Fields:failure_mode?: string: deny / allow max_instructions?: integer max_time_ms?: integer max_memory_kb?: integer id: string(uuid) name: string description: string source: string current_version: integer latest_version: integer dirty: boolean reference_count: integer revision: integer updated_at: string(date-time)

400The request body or parameters are invalid.
401Authentication failed or the session is invalid.
403The authenticated principal is not allowed to perform the action.
404The requested resource was not found.
409The requested state conflicts with an existing resource or idempotency fact.

What to do on failure

  • 400 Fix the parameters or body per the field list; do not retry unchanged.
  • 401 Check the credential format and whether it expired or was rotated.
  • 403 Check the key scopes, the owner’s current permissions and the tenant scope; never switch to a more privileged account.
  • 404 The resource does not exist or belongs to another tenant.
  • 409 Read the current state first; a retry of the same operation keeps the original Idempotency-Key and body.

↑ Back to list

GET /v1/edge-scripts/{script_id}/versions

List the versions of an edge script

operationId
listEdgeScriptVersions
Auth
  • API key: header Authorization: CdncaKey <key_id>.<secret>. Effective permissions are the key scopes intersected with the owner’s current permissions.
  • Session: the Bearer session of a signed-in control plane user, used by the customer in their own control plane; a plugin must never ask for it.
Required permissions

The contract has no separate permission annotation; see the description below and the 403 response.

Description (from the contract)

Requires security_policies.read. The kept versions, newest first, without sources.

Parameters

listEdgeScriptVersions Parameters
NameInTypeRequiredDescription
script_idpathstring(uuid)Yes—

Responses

listEdgeScriptVersions Responses
StatusDescription
200Versions.

Fields:items: array<EdgeScriptVersion>

400The request body or parameters are invalid.
401Authentication failed or the session is invalid.
403The authenticated principal is not allowed to perform the action.
404The requested resource was not found.

What to do on failure

  • 400 Fix the parameters or body per the field list; do not retry unchanged.
  • 401 Check the credential format and whether it expired or was rotated.
  • 403 Check the key scopes, the owner’s current permissions and the tenant scope; never switch to a more privileged account.
  • 404 The resource does not exist or belongs to another tenant.

↑ Back to list

GET /v1/edge-scripts/{script_id}/versions/{version}

Get one version of an edge script

operationId
getEdgeScriptVersion
Auth
  • API key: header Authorization: CdncaKey <key_id>.<secret>. Effective permissions are the key scopes intersected with the owner’s current permissions.
  • Session: the Bearer session of a signed-in control plane user, used by the customer in their own control plane; a plugin must never ask for it.
Required permissions

The contract has no separate permission annotation; see the description below and the 403 response.

Description (from the contract)

Requires security_policies.read. The version with its source (the console loads it into the draft).

Parameters

getEdgeScriptVersion Parameters
NameInTypeRequiredDescription
script_idpathstring(uuid)Yes—
versionpathintegerYes—

Responses

getEdgeScriptVersion Responses
StatusDescription
200The version.

Fields:failure_mode?: string: deny / allow max_instructions?: integer max_time_ms?: integer max_memory_kb?: integer version: integer sha256: string note: string current: boolean published_at: string(date-time) source?: string

400The request body or parameters are invalid.
401Authentication failed or the session is invalid.
403The authenticated principal is not allowed to perform the action.
404The requested resource was not found.

What to do on failure

  • 400 Fix the parameters or body per the field list; do not retry unchanged.
  • 401 Check the credential format and whether it expired or was rotated.
  • 403 Check the key scopes, the owner’s current permissions and the tenant scope; never switch to a more privileged account.
  • 404 The resource does not exist or belongs to another tenant.

↑ Back to list