---
updatedAt: 2026-08-12T18:10:24.000Z
agentTools:
  siteIndex: https://techdocs.akamai.com/llms.txt
  projectIndex: https://techdocs.akamai.com/application-security/llms.txt
---

# Update an AI rule's action

__All products__ Update the action for an AI rule.

# OpenAPI definition

```json
{
  "externalDocs": {
    "description": "See documentation for Akamai's Application Security API",
    "url": "https://techdocs.akamai.com/application-security/reference"
  },
  "info": {
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "title": "Security policies",
    "version": "v1"
  },
  "openapi": "3.0.0",
  "paths": {
    "/configs/{configId}/versions/{versionNumber}/security-policies/{policyId}/ai-rules/{ruleId}/versions/{ruleVersionId}/action": {
      "put": {
        "description": "__All products__ Update the action for an AI rule.",
        "externalDocs": {
          "description": "See documentation for this operation in Akamai's Application Security API",
          "url": "https://techdocs.akamai.com/application-security/reference/put-policy-ai-rule-action"
        },
        "operationId": "put-policy-ai-rule-action",
        "parameters": [
          {
            "description": "For customers who manage more than one account, this [runs the operation from another account](https://techdocs.akamai.com/developer/docs/manage-many-accounts-with-one-api-client). The Identity and Access Management API provides a [list of available account switch keys](https://techdocs.akamai.com/iam-api/reference/get-client-account-switch-keys).",
            "in": "query",
            "name": "accountSwitchKey",
            "required": false,
            "schema": {
              "example": "1-5C0YLB:1-8BYUX",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "action": "alert"
              },
              "schema": {
                "additionalProperties": false,
                "description": "The action for an AI rule.",
                "properties": {
                  "action": {
                    "description": "The action to take for an AI rule, either `alert`, `deny`, or `none`. If the action is `none`, the rule is inactive in the policy.",
                    "enum": [
                      "alert",
                      "deny",
                      "none"
                    ],
                    "type": "string",
                    "x-akamai": {
                      "file-path": "schemas/ai-rule-action.yaml"
                    }
                  }
                },
                "required": [
                  "action"
                ],
                "type": "object",
                "x-akamai": {
                  "file-path": "schemas/ai-rule-action-get-200.yaml"
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "action": "alert"
                },
                "schema": {
                  "additionalProperties": false,
                  "description": "The action for an AI rule.",
                  "properties": {
                    "action": {
                      "description": "The action to take for an AI rule, either `alert`, `deny`, or `none`. If the action is `none`, the rule is inactive in the policy.",
                      "enum": [
                        "alert",
                        "deny",
                        "none"
                      ],
                      "type": "string",
                      "x-akamai": {
                        "file-path": "schemas/ai-rule-action.yaml"
                      }
                    }
                  },
                  "required": [
                    "action"
                  ],
                  "type": "object",
                  "x-akamai": {
                    "file-path": "schemas/ai-rule-action-get-200.yaml"
                  }
                }
              }
            },
            "description": "Successfully updated the AI rule's action."
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "detail": "The request could not be understood by the server due to malformed syntax.",
                  "instance": "https://problems.luna.akamaiapis.net/appsec/error-instances/d54686b5-21cb-4ab7-a8d6-a92282cf1749",
                  "status": 400,
                  "title": "Bad Request",
                  "type": "https://problems.luna.akamaiapis.net/appsec/error-types/BAD-REQUEST"
                },
                "schema": {
                  "additionalProperties": true,
                  "description": "Details the errors you can receive.",
                  "properties": {
                    "detail": {
                      "description": "The detailed error message.",
                      "type": "string"
                    },
                    "fieldErrors": {
                      "description": "Pointers to fields for which invalid input was provided, whose values are messages detailing the reason this input was invalid for this field.",
                      "type": "object"
                    },
                    "instance": {
                      "description": "The non-referenceable URI that indicates the error instance.",
                      "example": "https://problems.luna.akamaiapis.net/api-definitions/error-instances/d54686b5-21cb-4ab7-a8d6-a92282cf1749",
                      "type": "string"
                    },
                    "status": {
                      "description": "The HTTP status code.",
                      "example": 404,
                      "type": "integer"
                    },
                    "title": {
                      "description": "The error title.",
                      "example": "Not Found",
                      "type": "string"
                    },
                    "type": {
                      "description": "The URL for the error type.",
                      "example": "https://problems.luna.akamaiapis.net/api-definitions/error-types/NOT-FOUND",
                      "type": "string"
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "detail",
                    "instance",
                    "status"
                  ],
                  "type": "object",
                  "x-akamai": {
                    "file-path": "schemas/problem-details.yaml"
                  }
                }
              }
            },
            "description": "[Invalid](https://techdocs.akamai.com/application-security/reference/400). Client error, such as invalid or malformed input.",
            "x-akamai": {
              "file-path": "errors/400-client-read-errors.yaml"
            }
          },
          "403": {
            "content": {
              "application/problem+json": {
                "example": {
                  "detail": "You do not have the necessary access to perform this operation or the requested resource cannot be modified",
                  "instance": "https://problems.luna.akamaiapis.net/appsec/error-instances/d54686b5-21cb-4ab7-a8d6-a92282cf1749",
                  "status": 403,
                  "title": "Forbidden",
                  "type": "https://problems.luna.akamaiapis.net/appsec-resource/error-types/ACCESS-DENIED"
                },
                "schema": {
                  "additionalProperties": true,
                  "description": "Details the errors you can receive.",
                  "properties": {
                    "detail": {
                      "description": "The detailed error message.",
                      "type": "string"
                    },
                    "fieldErrors": {
                      "description": "Pointers to fields for which invalid input was provided, whose values are messages detailing the reason this input was invalid for this field.",
                      "type": "object"
                    },
                    "instance": {
                      "description": "The non-referenceable URI that indicates the error instance.",
                      "example": "https://problems.luna.akamaiapis.net/api-definitions/error-instances/d54686b5-21cb-4ab7-a8d6-a92282cf1749",
                      "type": "string"
                    },
                    "status": {
                      "description": "The HTTP status code.",
                      "example": 404,
                      "type": "integer"
                    },
                    "title": {
                      "description": "The error title.",
                      "example": "Not Found",
                      "type": "string"
                    },
                    "type": {
                      "description": "The URL for the error type.",
                      "example": "https://problems.luna.akamaiapis.net/api-definitions/error-types/NOT-FOUND",
                      "type": "string"
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "detail",
                    "instance",
                    "status"
                  ],
                  "type": "object",
                  "x-akamai": {
                    "file-path": "schemas/problem-details.yaml"
                  }
                }
              }
            },
            "description": "[Forbidden](https://techdocs.akamai.com/application-security/reference/403). You don't have permission to write to this resource.",
            "x-akamai": {
              "file-path": "errors/403-client-write-errors.yaml"
            }
          },
          "404": {
            "content": {
              "application/problem+json": {
                "example": {
                  "detail": "The requested resource is not found",
                  "instance": "https://problems.luna.akamaiapis.net/appsec/error-instances/d54686b5-21cb-4ab7-a8d6-a92282cf1749",
                  "status": 404,
                  "title": "Not Found",
                  "type": "https://problems.luna.akamaiapis.net/appsec/error-types/NOT-FOUND"
                },
                "schema": {
                  "additionalProperties": true,
                  "description": "Details the errors you can receive.",
                  "properties": {
                    "detail": {
                      "description": "The detailed error message.",
                      "type": "string"
                    },
                    "fieldErrors": {
                      "description": "Pointers to fields for which invalid input was provided, whose values are messages detailing the reason this input was invalid for this field.",
                      "type": "object"
                    },
                    "instance": {
                      "description": "The non-referenceable URI that indicates the error instance.",
                      "example": "https://problems.luna.akamaiapis.net/api-definitions/error-instances/d54686b5-21cb-4ab7-a8d6-a92282cf1749",
                      "type": "string"
                    },
                    "status": {
                      "description": "The HTTP status code.",
                      "example": 404,
                      "type": "integer"
                    },
                    "title": {
                      "description": "The error title.",
                      "example": "Not Found",
                      "type": "string"
                    },
                    "type": {
                      "description": "The URL for the error type.",
                      "example": "https://problems.luna.akamaiapis.net/api-definitions/error-types/NOT-FOUND",
                      "type": "string"
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "detail",
                    "instance",
                    "status"
                  ],
                  "type": "object",
                  "x-akamai": {
                    "file-path": "schemas/problem-details.yaml"
                  }
                }
              }
            },
            "description": "[Not found](https://techdocs.akamai.com/application-security/reference/404). The security policy doesn't exist, doesn't carry application layer controls, or no rule with this ID is available for use in this policy.",
            "x-akamai": {
              "file-path": "errors/404-client-read-errors.yaml"
            }
          },
          "500": {
            "content": {
              "application/problem+json": {
                "example": {
                  "detail": "Internal Server Error",
                  "instance": "12ab3c45-789d-01ef-2gh3-ijk4l56m78no",
                  "status": 500,
                  "title": "Internal Server Error",
                  "type": "internal_server_error"
                },
                "schema": {
                  "additionalProperties": true,
                  "description": "Details the errors you can receive.",
                  "properties": {
                    "detail": {
                      "description": "The detailed error message.",
                      "type": "string"
                    },
                    "fieldErrors": {
                      "description": "Pointers to fields for which invalid input was provided, whose values are messages detailing the reason this input was invalid for this field.",
                      "type": "object"
                    },
                    "instance": {
                      "description": "The non-referenceable URI that indicates the error instance.",
                      "example": "https://problems.luna.akamaiapis.net/api-definitions/error-instances/d54686b5-21cb-4ab7-a8d6-a92282cf1749",
                      "type": "string"
                    },
                    "status": {
                      "description": "The HTTP status code.",
                      "example": 404,
                      "type": "integer"
                    },
                    "title": {
                      "description": "The error title.",
                      "example": "Not Found",
                      "type": "string"
                    },
                    "type": {
                      "description": "The URL for the error type.",
                      "example": "https://problems.luna.akamaiapis.net/api-definitions/error-types/NOT-FOUND",
                      "type": "string"
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "detail",
                    "instance",
                    "status"
                  ],
                  "type": "object",
                  "x-akamai": {
                    "file-path": "schemas/problem-details.yaml"
                  }
                }
              }
            },
            "description": "[Internal server error](https://techdocs.akamai.com/application-security/reference/500). Something went wrong on our side. Try again in a few minutes or contact support if the error persists.",
            "x-akamai": {
              "file-path": "errors/500-server-errors.yaml"
            }
          }
        },
        "summary": "Update an AI rule's action",
        "tags": [
          "WAF rules: AI rules"
        ],
        "x-akamai": {
          "labels": [
            "All products"
          ]
        }
      },
      "parameters": [
        {
          "description": "A unique identifier for each configuration.",
          "in": "path",
          "name": "configId",
          "required": true,
          "schema": {
            "example": 77653,
            "format": "int64",
            "type": "integer"
          },
          "x-akamai": {
            "file-path": "parameters/config-id-path.yaml"
          }
        },
        {
          "description": "A unique identifier for each version of a configuration.",
          "in": "path",
          "name": "versionNumber",
          "required": true,
          "schema": {
            "example": 25,
            "type": "integer"
          },
          "x-akamai": {
            "file-path": "parameters/version-number-path.yaml"
          }
        },
        {
          "description": "A unique identifier for a security policy.",
          "in": "path",
          "name": "policyId",
          "required": true,
          "schema": {
            "example": "boBF_19288",
            "type": "string"
          },
          "x-akamai": {
            "file-path": "parameters/policy-id-path.yaml"
          }
        },
        {
          "description": "A unique identifier for rule.",
          "in": "path",
          "name": "ruleId",
          "required": true,
          "schema": {
            "example": 699989,
            "type": "integer"
          },
          "x-akamai": {
            "file-path": "parameters/rule-id-path.yaml"
          }
        },
        {
          "description": "Uniquely identifies each version of an AI rule.",
          "in": "path",
          "name": "ruleVersionId",
          "required": true,
          "schema": {
            "example": 1,
            "type": "integer"
          },
          "x-akamai": {
            "file-path": "parameters/ai-rule-version-id-path.yaml"
          }
        }
      ],
      "x-akamai": {
        "file-path": "paths/ai-rule-action.yaml",
        "path-info": "/configs/{configId}/versions/{versionNumber}/security-policies/{policyId}/ai-rules/{ruleId}/versions/{ruleVersionId}/action"
      }
    }
  },
  "servers": [
    {
      "url": "https://{hostname}/appsec/v1"
    }
  ],
  "tags": [
    {
      "description": "Manage WAF rules generated and continuously refined using machine learning.",
      "name": "WAF rules: AI rules"
    }
  ],
  "x-akamai": {
    "auth-type": "EDGE_GRID",
    "file-path": "02-security-policies.yaml"
  },
  "x-readme": {
    "explorer-enabled": false,
    "samples-languages": [
      "curl",
      "python",
      "node"
    ]
  }
}
```

# Sibling pages

* [List AI rules](https://techdocs.akamai.com/application-security/reference/get-policy-ai-rules.md)
* [Get AI rules status](https://techdocs.akamai.com/application-security/reference/get-policy-ai-rules-status.md)
* [Update AI rules status](https://techdocs.akamai.com/application-security/reference/put-policy-ai-rules-status.md)
* [Get an AI rule's action](https://techdocs.akamai.com/application-security/reference/get-policy-ai-rule-action.md)