Skip to content

API Reference

CSD has a dedicated API at /api/shape/csd/ for managing domains, scripts, mitigation, and monitoring. CSD can also be enabled on HTTP Load Balancers via the load balancer configuration API.

All API calls require an API token. Generate one in the XC Console under AdministrationCredentialsAPI Credentials.

Set up your environment variables as described in API Automation — Environment Setup:

Terminal window
set -a && source .env && set +a

All curl examples use the xTOKENx placeholder format. Substitute with your environment variables or use the interactive form at the top of the page. For example, xF5XC_API_TOKENx corresponds to $F5XC_API_TOKEN.

Terminal window
-H "Authorization: APIToken xF5XC_API_TOKENx"
  • POST returns the created object as JSON.
  • PUT and DELETE return an empty \{\} on HTTP 200 — this is normal, not an error. Do not treat an empty response body as a failure.

List endpoints (e.g., /healthchecks, /origin_pools, /protected_domains) and individual GET endpoints (e.g., /healthchecks/\{name\}) return different response structures:

Endpoint typeExample pathResponse structure
List/origin_poolsItems have top-level .name, .namespace, .tenant with metadata: null and get_spec: null
Individual GET/origin_pools/\{name\}Object has .metadata.name, .spec.* with full configuration

Use the correct jq paths for each. For example, to extract names from a list endpoint use .items[].name, not .items[].metadata.name.

For protected domain GET and DELETE operations, the \{name\} path parameter is the domain value itself (e.g., bankexample.com), not an arbitrary object name. This differs from other F5 XC objects where the name is a user-chosen identifier.

Base path: /api/shape/csd/namespaces/\{namespace\}/

OperationMethodPath
Enable CSDPOST/api/shape/csd/namespaces/system/init
Get StatusGET/api/shape/csd/namespaces/\{namespace\}/status
Get JS ConfigurationGET/api/shape/csd/namespaces/\{namespace\}/js_configuration
Test JSPOST/api/shape/csd/namespaces/\{namespace\}/testjs
Update DomainsPOST/api/shape/csd/namespaces/\{namespace\}/update_domains
OperationMethodPath
ListGET/api/shape/csd/namespaces/\{namespace\}/protected_domains
GetGET/api/shape/csd/namespaces/\{namespace\}/protected_domains/\{name\}
CreatePOST/api/shape/csd/namespaces/\{namespace\}/protected_domains
DeleteDELETE/api/shape/csd/namespaces/\{namespace\}/protected_domains/\{name\}
OperationMethodPath
List DetectedGET/api/shape/csd/namespaces/\{namespace\}/detected_domains
Get DetailsGET/api/shape/csd/namespaces/\{namespace\}/domain_details
OperationMethodPath
ListGET/api/shape/csd/namespaces/\{namespace\}/allowed_domains
GetGET/api/shape/csd/namespaces/\{namespace\}/allowed_domains/\{name\}
CreatePOST/api/shape/csd/namespaces/\{namespace\}/allowed_domains
DeleteDELETE/api/shape/csd/namespaces/\{namespace\}/allowed_domains/\{name\}
OperationMethodPath
ListGET/api/shape/csd/namespaces/\{namespace\}/mitigated_domains
GetGET/api/shape/csd/namespaces/\{namespace\}/mitigated_domains/\{name\}
CreatePOST/api/shape/csd/namespaces/\{namespace\}/mitigated_domains
DeleteDELETE/api/shape/csd/namespaces/\{namespace\}/mitigated_domains/\{name\}
OperationMethodPath
List ScriptsPOST/api/shape/csd/namespaces/\{namespace\}/scripts
List Scripts (legacy)GET/api/shape/csd/namespaces/\{namespace\}/scripts
Get Script OverviewGET/api/shape/csd/namespaces/\{namespace\}/scripts/\{id\}/dashboard
List BehaviorsGET/api/shape/csd/namespaces/\{namespace\}/scripts/\{id\}/behaviors
List Network InteractionsGET/api/shape/csd/namespaces/\{namespace\}/scripts/\{id\}/networkInteractions
Update JustificationPOST/api/shape/csd/namespaces/\{namespace\}/scripts/\{script_id\}/justification
Delete JustificationDELETE/api/shape/csd/namespaces/\{namespace\}/script/justification/\{justification_id\}
Update Read StatusPOST/api/shape/csd/namespaces/\{namespace\}/scripts/\{id\}/readStatus
List Affected UsersPOST/api/shape/csd/namespaces/\{namespace\}/scripts/\{script_id\}/affectedUsers
OperationMethodPath
List Form FieldsGET/api/shape/csd/namespaces/\{namespace\}/formFields
List Form Fields (POST)POST/api/shape/csd/namespaces/\{namespace\}/formFields
Get Form FieldGET/api/shape/csd/namespaces/\{namespace\}/formFields/\{id\}
List by ScriptGET/api/shape/csd/namespaces/\{namespace\}/scripts/\{id\}/formFields
Update Field AnalysisPOST/api/shape/csd/namespaces/\{namespace\}/formFields/analysis

Initialize CSD for the tenant:

Terminal window
curl -s -X POST \
-H "Authorization: APIToken xF5XC_API_TOKENx" \
-H "Content-Type: application/json" \
"xF5XC_API_URLx/api/shape/csd/namespaces/system/init"
Terminal window
curl -s \
-H "Authorization: APIToken xF5XC_API_TOKENx" \
"xF5XC_API_URLx/api/shape/csd/namespaces/xF5XC_NAMESPACEx/status" \
| jq .
Terminal window
curl -s \
-H "Authorization: APIToken xF5XC_API_TOKENx" \
"xF5XC_API_URLx/api/shape/csd/namespaces/xF5XC_NAMESPACEx/protected_domains" \
| jq .
Terminal window
curl -s -X POST \
-H "Authorization: APIToken xF5XC_API_TOKENx" \
-H "Content-Type: application/json" \
-d '{
"metadata": {
"name": "my-app",
"namespace": "xF5XC_NAMESPACEx"
},
"spec": {}
}' \
"xF5XC_API_URLx/api/shape/csd/namespaces/xF5XC_NAMESPACEx/protected_domains" \
| jq .
Terminal window
curl -s -X DELETE \
-H "Authorization: APIToken xF5XC_API_TOKENx" \
"xF5XC_API_URLx/api/shape/csd/namespaces/xF5XC_NAMESPACEx/protected_domains/my-app"

Query parameters: locations (filter by location), risk (filter by risk level).

Terminal window
curl -s \
-H "Authorization: APIToken xF5XC_API_TOKENx" \
"xF5XC_API_URLx/api/shape/csd/namespaces/xF5XC_NAMESPACEx/detected_domains" \
| jq .

Filter by high risk:

Terminal window
curl -s \
-H "Authorization: APIToken xF5XC_API_TOKENx" \
"xF5XC_API_URLx/api/shape/csd/namespaces/xF5XC_NAMESPACEx/detected_domains?risk=high" \
| jq .
Terminal window
curl -s \
-H "Authorization: APIToken xF5XC_API_TOKENx" \
"xF5XC_API_URLx/api/shape/csd/namespaces/xF5XC_NAMESPACEx/domain_details?name=suspicious.example.com" \
| jq .
Terminal window
curl -s -X POST \
-H "Authorization: APIToken xF5XC_API_TOKENx" \
-H "Content-Type: application/json" \
-d '{}' \
"xF5XC_API_URLx/api/shape/csd/namespaces/xF5XC_NAMESPACEx/scripts" \
| jq .
Terminal window
SCRIPT_ID="your-script-id"
curl -s \
-H "Authorization: APIToken xF5XC_API_TOKENx" \
"xF5XC_API_URLx/api/shape/csd/namespaces/xF5XC_NAMESPACEx/scripts/${SCRIPT_ID}/dashboard" \
| jq .
Terminal window
curl -s \
-H "Authorization: APIToken xF5XC_API_TOKENx" \
"xF5XC_API_URLx/api/shape/csd/namespaces/xF5XC_NAMESPACEx/scripts/${SCRIPT_ID}/behaviors" \
| jq .
Terminal window
curl -s \
-H "Authorization: APIToken xF5XC_API_TOKENx" \
"xF5XC_API_URLx/api/shape/csd/namespaces/xF5XC_NAMESPACEx/scripts/${SCRIPT_ID}/networkInteractions" \
| jq .
Terminal window
curl -s -X POST \
-H "Authorization: APIToken xF5XC_API_TOKENx" \
-H "Content-Type: application/json" \
-d '{
"metadata": {
"name": "blocked-domain",
"namespace": "xF5XC_NAMESPACEx"
},
"spec": {}
}' \
"xF5XC_API_URLx/api/shape/csd/namespaces/xF5XC_NAMESPACEx/mitigated_domains" \
| jq .
Terminal window
curl -s \
-H "Authorization: APIToken xF5XC_API_TOKENx" \
"xF5XC_API_URLx/api/shape/csd/namespaces/xF5XC_NAMESPACEx/mitigated_domains" \
| jq .
Terminal window
curl -s -X DELETE \
-H "Authorization: APIToken xF5XC_API_TOKENx" \
"xF5XC_API_URLx/api/shape/csd/namespaces/xF5XC_NAMESPACEx/mitigated_domains/blocked-domain"
Terminal window
curl -s -X POST \
-H "Authorization: APIToken xF5XC_API_TOKENx" \
-H "Content-Type: application/json" \
-d '{
"metadata": {
"name": "trusted-cdn",
"namespace": "xF5XC_NAMESPACEx"
},
"spec": {}
}' \
"xF5XC_API_URLx/api/shape/csd/namespaces/xF5XC_NAMESPACEx/allowed_domains" \
| jq .
Terminal window
curl -s \
-H "Authorization: APIToken xF5XC_API_TOKENx" \
"xF5XC_API_URLx/api/shape/csd/namespaces/xF5XC_NAMESPACEx/allowed_domains" \
| jq .
Terminal window
curl -s -X DELETE \
-H "Authorization: APIToken xF5XC_API_TOKENx" \
"xF5XC_API_URLx/api/shape/csd/namespaces/xF5XC_NAMESPACEx/allowed_domains/trusted-cdn"
Terminal window
curl -s \
-H "Authorization: APIToken xF5XC_API_TOKENx" \
"xF5XC_API_URLx/api/shape/csd/namespaces/xF5XC_NAMESPACEx/js_configuration" \
| jq .

CSD JavaScript injection can also be enabled directly on an HTTP Load Balancer via the configuration API at /api/config/namespaces/\{namespace\}/http_loadbalancers/\{name\}.

The client_side_defense field within the load balancer spec controls injection:

{
"client_side_defense": {
"policy": {
"js_insert_all_pages": {}
}
}
}

The policy accepts one of:

FieldDescription
js_insert_all_pagesInject on all pages
js_insert_all_pages_exceptInject on all pages except exclusion rules
js_insertion_rulesInject only on pages matching rules
disable_js_insertDo not inject

To disable CSD on a load balancer, replace client_side_defense with disable_client_side_defense: \{\}.

Terminal window
curl -s \
-H "Authorization: APIToken xF5XC_API_TOKENx" \
"xF5XC_API_URLx/api/config/namespaces/xF5XC_NAMESPACEx/http_loadbalancers/xF5XC_LB_NAMEx" \
| jq '.spec.client_side_defense'

Retrieve, modify, and apply:

Terminal window
curl -s \
-H "Authorization: APIToken xF5XC_API_TOKENx" \
"xF5XC_API_URLx/api/config/namespaces/xF5XC_NAMESPACEx/http_loadbalancers/xF5XC_LB_NAMEx" \
> lb-config.json
jq '.spec |= (
del(.disable_client_side_defense) |
.client_side_defense = {
"policy": {
"js_insert_all_pages": {}
}
}
)' lb-config.json > lb-config-updated.json
curl -s -X PUT \
-H "Authorization: APIToken xF5XC_API_TOKENx" \
-H "Content-Type: application/json" \
-d @lb-config-updated.json \
"xF5XC_API_URLx/api/config/namespaces/xF5XC_NAMESPACEx/http_loadbalancers/xF5XC_LB_NAMEx" \
| jq '.spec.client_side_defense'

Domain and Path Matching for Exclusion Rules

Section titled “Domain and Path Matching for Exclusion Rules”

When using js_insert_all_pages_except or js_insertion_rules, each rule matches a domain and path combination.

Domain (choose one):

FieldExample
any_domain: \{\}All domains
domain.exact_value"app.example.com"
domain.suffix_value".example.com"
domain.regex_value".*\\.example\\.com"

Path (choose one):

FieldExample
path.path"/login"
path.prefix"/checkout"
path.regex"/user/[0-9]+"