Execution Policy
Get an execution policy
Retrieve an existing execution policy by ID.
get/api/v2/actions/execution-policies/{policy_id}
Request
- Base URLhttps://api.datadoghq.com
- Auth
- API key in header DD-API-KEY and API key in header DD-APPLICATION-KEY
- or OAuth 2Authorization code/oauth2/v1/authorizeToken URL/oauth2/v1/token
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
policy_idstring required
The ID of the execution policy.
Response
OK
Example response
{
"data": {
"attributes": {
"action_pattern": {
"action_fqns": [
"com.datadoghq.script.*"
],
"integration": "INTEGRATION_SCRIPT"
},
"created_at": "2026-01-15T10:00:00.000Z",
"created_by": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"effect": "allow",
"name": "Block prod restarts",
"scope": {
"kubernetes": {
"rules": [
{
"target_namespaces": [
"default"
]
}
]
},
"remote_action_rshell": {
"rules": [
{
"access": "read_only",
"target_paths": [
"/var/log"
]
}
]
},
"scripts": {
"rules": [
{
"target_script_names": [
"restart_service.sh"
]
}
]
},
"slack": {
"rules": [
{
"channel_name_selectors": [
"incident-*"
]
}
]
}
},
"targets": [
{
"agent_tags": [
"env:prod"
],
"name": "Production hosts"
}
],
"updated_at": "2026-01-15T10:00:00.000Z",
"updated_by": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"version": 1
},
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"type": "execution_policy"
}
}Changes
Changes to this operation have not been checked yet.