AWS WAF Waf Rule API
The Waf Rule API from AWS WAF — 5 operation(s) for waf rule.
The Waf Rule API from AWS WAF — 5 operation(s) for waf rule.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/aws-waf:aws-waf-rule-api"
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: AWS WAF Rule API
version: '2015-08-24'
description: Generated from AWS's published Smithy model for AWS WAF. 5 operation(s).
contact:
name: Amazon Web Services
url: https://aws.amazon.com/contact-us/
license:
name: Apache 2.0
identifier: Apache-2.0
url: https://github.com/aws/api-models-aws/blob/main/LICENSE
servers:
- url: https://waf.{region}.amazonaws.com
variables:
region:
default: us-east-1
security:
- sigv4: []
tags:
- name: Rule
paths:
/#CreateRule:
post:
operationId: CreateRule
summary: Create Rule
description: 'This is AWS WAF Classic documentation. For more information, see AWS WAF Classic in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API and see the AWS WAF Developer Guide. With the latest version, AWS WAF has a single set of endpoints for regional and global use. Creates a Rule, which contains the IPSet objects, ByteMatchSet objects, and other predicates that identify the requests that you want to block. If you add more than one predicate to a Rule, a request must match all of the specifications to be allowed or blocked. For example, suppose that you add the following to a Rule: An IPSet that matches the IP address 192.0.2.44/32 A ByteMatchSet that matches BadBot in the User-Agent header You then add the Rule to a WebACL and specify that you want to blocks requests that satisfy the Rule. For a request to be blocked, it must come from the IP address 192.0.2.44 and the User-Agent header in the request must contain the value BadBot. To create and configure a Rule, perform the following steps: Create and update the predicates that you want to include in the Rule. For more information, see CreateByteMatchSet, CreateIPSet, and CreateSqlInjectionMatchSet. Use Ge'
responses:
'200':
description: Success
content:
application/x-amz-json-1.1:
schema:
$ref: '#/components/schemas/CreateRuleResponse'
example:
Rule:
MetricName: WAFByteHeaderRule
Name: WAFByteHeaderRule
Predicates:
- DataId: MyByteMatchSetID
Negated: false
Type: ByteMatch
RuleId: WAFRule-1-Example
ChangeToken: abcd12f2-46da-4fdb-b8d5-fbd4c466928f
'400':
description: WAFBadRequestException; WAFDisallowedNameException; WAFInvalidParameterException; WAFLimitsExceededException; WAFStaleDataException; WAFTagOperationException
content:
application/x-amz-json-1.1:
schema:
$ref: '#/components/schemas/WAFBadRequestException'
'500':
description: WAFInternalErrorException; WAFTagOperationInternalErrorException
content:
application/x-amz-json-1.1:
schema:
$ref: '#/components/schemas/WAFInternalErrorException'
parameters:
- name: X-Amz-Target
in: header
required: true
schema:
type: string
enum:
- AWSWAF_20150824.CreateRule
requestBody:
required: true
content:
application/x-amz-json-1.1:
schema:
$ref: '#/components/schemas/CreateRuleRequest'
example:
Name: WAFByteHeaderRule
MetricName: WAFByteHeaderRule
ChangeToken: abcd12f2-46da-4fdb-b8d5-fbd4c466928f
tags:
- Rule
/#DeleteRule:
post:
operationId: DeleteRule
summary: Delete Rule
description: 'This is AWS WAF Classic documentation. For more information, see AWS WAF Classic in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API and see the AWS WAF Developer Guide. With the latest version, AWS WAF has a single set of endpoints for regional and global use. Permanently deletes a Rule. You can''t delete a Rule if it''s still used in any WebACL objects or if it still includes any predicates, such as ByteMatchSet objects. If you just want to remove a Rule from a WebACL, use UpdateWebACL. To permanently delete a Rule from AWS WAF, perform the following steps: Update the Rule to remove predicates, if any. For more information, see UpdateRule. Use GetChangeToken to get the change token that you provide in the ChangeToken parameter of a DeleteRule request. Submit a DeleteRule request.'
responses:
'200':
description: Success
content:
application/x-amz-json-1.1:
schema:
$ref: '#/components/schemas/DeleteRuleResponse'
example:
ChangeToken: abcd12f2-46da-4fdb-b8d5-fbd4c466928f
'500':
description: WAFInternalErrorException; WAFTagOperationInternalErrorException
content:
application/x-amz-json-1.1:
schema:
$ref: '#/components/schemas/WAFInternalErrorException'
'400':
description: WAFInvalidAccountException; WAFNonEmptyEntityException; WAFNonexistentItemException; WAFReferencedItemException; WAFStaleDataException; WAFTagOperationException
content:
application/x-amz-json-1.1:
schema:
$ref: '#/components/schemas/WAFInvalidAccountException'
parameters:
- name: X-Amz-Target
in: header
required: true
schema:
type: string
enum:
- AWSWAF_20150824.DeleteRule
requestBody:
required: true
content:
application/x-amz-json-1.1:
schema:
$ref: '#/components/schemas/DeleteRuleRequest'
example:
RuleId: WAFRule-1-Example
ChangeToken: abcd12f2-46da-4fdb-b8d5-fbd4c466928f
tags:
- Rule
/#GetRule:
post:
operationId: GetRule
summary: Get Rule
description: This is AWS WAF Classic documentation. For more information, see AWS WAF Classic in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API and see the AWS WAF Developer Guide. With the latest version, AWS WAF has a single set of endpoints for regional and global use. Returns the Rule that is specified by the RuleId that you included in the GetRule request.
responses:
'200':
description: Success
content:
application/x-amz-json-1.1:
schema:
$ref: '#/components/schemas/GetRuleResponse'
example:
Rule:
MetricName: WAFByteHeaderRule
Name: WAFByteHeaderRule
Predicates:
- DataId: MyByteMatchSetID
Negated: false
Type: ByteMatch
RuleId: example1ds3t-46da-4fdb-b8d5-abc321j569j5
'500':
description: WAFInternalErrorException
content:
application/x-amz-json-1.1:
schema:
$ref: '#/components/schemas/WAFInternalErrorException'
'400':
description: WAFInvalidAccountException; WAFNonexistentItemException
content:
application/x-amz-json-1.1:
schema:
$ref: '#/components/schemas/WAFInvalidAccountException'
parameters:
- name: X-Amz-Target
in: header
required: true
schema:
type: string
enum:
- AWSWAF_20150824.GetRule
requestBody:
required: true
content:
application/x-amz-json-1.1:
schema:
$ref: '#/components/schemas/GetRuleRequest'
example:
RuleId: example1ds3t-46da-4fdb-b8d5-abc321j569j5
tags:
- Rule
/#ListRules:
post:
operationId: ListRules
summary: List Rules
description: This is AWS WAF Classic documentation. For more information, see AWS WAF Classic in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API and see the AWS WAF Developer Guide. With the latest version, AWS WAF has a single set of endpoints for regional and global use. Returns an array of RuleSummary objects.
responses:
'200':
description: Success
content:
application/x-amz-json-1.1:
schema:
$ref: '#/components/schemas/ListRulesResponse'
example:
Rules:
- Name: WAFByteHeaderRule
RuleId: WAFRule-1-Example
'500':
description: WAFInternalErrorException
content:
application/x-amz-json-1.1:
schema:
$ref: '#/components/schemas/WAFInternalErrorException'
'400':
description: WAFInvalidAccountException
content:
application/x-amz-json-1.1:
schema:
$ref: '#/components/schemas/WAFInvalidAccountException'
parameters:
- name: X-Amz-Target
in: header
required: true
schema:
type: string
enum:
- AWSWAF_20150824.ListRules
requestBody:
required: true
content:
application/x-amz-json-1.1:
schema:
$ref: '#/components/schemas/ListRulesRequest'
example:
Limit: 100
tags:
- Rule
/#UpdateRule:
post:
operationId: UpdateRule
summary: Update Rule
description: 'This is AWS WAF Classic documentation. For more information, see AWS WAF Classic in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API and see the AWS WAF Developer Guide. With the latest version, AWS WAF has a single set of endpoints for regional and global use. Inserts or deletes Predicate objects in a Rule. Each Predicate object identifies a predicate, such as a ByteMatchSet or an IPSet, that specifies the web requests that you want to allow, block, or count. If you add more than one predicate to a Rule, a request must match all of the specifications to be allowed, blocked, or counted. For example, suppose that you add the following to a Rule: A ByteMatchSet that matches the value BadBot in the User-Agent header An IPSet that matches the IP address 192.0.2.44 You then add the Rule to a WebACL and specify that you want to block requests that satisfy the Rule. For a request to be blocked, the User-Agent header in the request must contain the value BadBot and the request must originate from the IP address 192.0.2.44. To create and configure a Rule, perform the following steps: Create and update the predicates that you want to include in the Rule. Create t'
responses:
'200':
description: Success
content:
application/x-amz-json-1.1:
schema:
$ref: '#/components/schemas/UpdateRuleResponse'
example:
ChangeToken: abcd12f2-46da-4fdb-b8d5-fbd4c466928f
'500':
description: WAFInternalErrorException
content:
application/x-amz-json-1.1:
schema:
$ref: '#/components/schemas/WAFInternalErrorException'
'400':
description: WAFInvalidAccountException; WAFInvalidOperationException; WAFInvalidParameterException; WAFLimitsExceededException; WAFNonexistentContainerException; WAFNonexistentItemException; WAFReferencedItemException; WAFStaleDataException
content:
application/x-amz-json-1.1:
schema:
$ref: '#/components/schemas/WAFInvalidAccountException'
parameters:
- name: X-Amz-Target
in: header
required: true
schema:
type: string
enum:
- AWSWAF_20150824.UpdateRule
requestBody:
required: true
content:
application/x-amz-json-1.1:
schema:
$ref: '#/components/schemas/UpdateRuleRequest'
example:
RuleId: example1ds3t-46da-4fdb-b8d5-abc321j569j5
ChangeToken: abcd12f2-46da-4fdb-b8d5-fbd4c466928f
Updates:
- Action: DELETE
Predicate:
DataId: MyByteMatchSetID
Negated: false
Type: ByteMatch
tags:
- Rule
components:
schemas:
UpdateRuleResponse:
type: object
properties:
ChangeToken:
type: string
description: The ChangeToken that you used to submit the UpdateRule request. You can also use this value to query the status of the request. For more information, see GetChangeTokenStatus.
Rule:
type: object
properties:
RuleId:
type: string
description: A unique identifier for a Rule. You use RuleId to get more information about a Rule (see GetRule), update a Rule (see UpdateRule), insert a Rule into a WebACL or delete a one from a WebACL (see UpdateWebACL), or delete a Rule from AWS WAF (see DeleteRule). RuleId is returned by CreateRule and by ListRules.
Name:
type: string
description: The friendly name or description for the Rule. You can't change the name of a Rule after you create it.
MetricName:
type: string
description: A friendly name or description for the metrics for this Rule. The name can contain only alphanumeric characters (A-Z, a-z, 0-9), with maximum length 128 and minimum length one. It can't contain whitespace or metric names reserved for AWS WAF, including "All" and "Default_Action." You can't change MetricName after you create the Rule.
Predicates:
type: array
items:
$ref: '#/components/schemas/Predicate'
description: The Predicates object contains one Predicate element for each ByteMatchSet, IPSet, or SqlInjectionMatchSet object that you want to include in a Rule.
required:
- RuleId
- Predicates
DeleteRuleResponse:
type: object
properties:
ChangeToken:
type: string
description: The ChangeToken that you used to submit the DeleteRule request. You can also use this value to query the status of the request. For more information, see GetChangeTokenStatus.
WAFInvalidAccountException:
type: object
properties: {}
CreateRuleRequest:
type: object
properties:
Name:
type: string
description: A friendly name or description of the Rule. You can't change the name of a Rule after you create it.
MetricName:
type: string
description: A friendly name or description for the metrics for this Rule. The name can contain only alphanumeric characters (A-Z, a-z, 0-9), with maximum length 128 and minimum length one. It can't contain whitespace or metric names reserved for AWS WAF, including "All" and "Default_Action." You can't change the name of the metric after you create the Rule.
ChangeToken:
type: string
description: The value returned by the most recent call to GetChangeToken.
Tags:
type: array
items:
$ref: '#/components/schemas/Tag'
required:
- Name
- MetricName
- ChangeToken
GetRuleRequest:
type: object
properties:
RuleId:
type: string
description: The RuleId of the Rule that you want to get. RuleId is returned by CreateRule and by ListRules.
required:
- RuleId
RuleUpdate:
type: object
properties:
Action:
type: string
enum:
- INSERT
- DELETE
description: Specify INSERT to add a Predicate to a Rule. Use DELETE to remove a Predicate from a Rule.
Predicate:
$ref: '#/components/schemas/Predicate'
required:
- Action
- Predicate
DeleteRuleRequest:
type: object
properties:
RuleId:
type: string
description: The RuleId of the Rule that you want to delete. RuleId is returned by CreateRule and by ListRules.
ChangeToken:
type: string
description: The value returned by the most recent call to GetChangeToken.
required:
- RuleId
- ChangeToken
WAFInternalErrorException:
type: object
properties:
message:
type: string
Predicate:
type: object
properties:
Negated:
type: boolean
description: Set Negated to False if you want AWS WAF to allow, block, or count requests based on the settings in the specified ByteMatchSet, IPSet, SqlInjectionMatchSet, XssMatchSet, RegexMatchSet, GeoMatchSet, or SizeConstraintSet. For example, if an IPSet includes the IP address 192.0.2.44, AWS WAF will allow or block requests based on that IP address. Set Negated to True if you want AWS WAF to allow or block a request based on the negation of the settings in the ByteMatchSet, IPSet, SqlInjectionMatchSet, XssMatchSet, RegexMatchSet, GeoMatchSet, or SizeConstraintSet. For example, if an IPSet includes th
Type:
type: string
enum:
- IPMatch
- ByteMatch
- SqlInjectionMatch
- GeoMatch
- SizeConstraint
- XssMatch
- RegexMatch
description: The type of predicate in a Rule, such as ByteMatch or IPSet.
DataId:
type: string
description: A unique identifier for a predicate in a Rule, such as ByteMatchSetId or IPSetId. The ID is returned by the corresponding Create or List command.
required:
- Negated
- Type
- DataId
GetRuleResponse:
type: object
properties:
Rule:
$ref: '#/components/schemas/Rule'
ListRulesRequest:
type: object
properties:
NextMarker:
type: string
description: If you specify a value for Limit and you have more Rules than the value of Limit, AWS WAF returns a NextMarker value in the response that allows you to list another group of Rules. For the second and subsequent ListRules requests, specify the value of NextMarker from the previous response to get information about another batch of Rules.
Limit:
type: integer
description: Specifies the number of Rules that you want AWS WAF to return for this request. If you have more Rules than the number that you specify for Limit, the response includes a NextMarker value that you can use to get another batch of Rules.
Tag:
type: object
properties:
Key:
type: string
Value:
type: string
required:
- Key
- Value
RuleSummary:
type: object
properties:
RuleId:
type: string
description: A unique identifier for a Rule. You use RuleId to get more information about a Rule (see GetRule), update a Rule (see UpdateRule), insert a Rule into a WebACL or delete one from a WebACL (see UpdateWebACL), or delete a Rule from AWS WAF (see DeleteRule). RuleId is returned by CreateRule and by ListRules.
Name:
type: string
description: A friendly name or description of the Rule. You can't change the name of a Rule after you create it.
required:
- RuleId
- Name
UpdateRuleRequest:
type: object
properties:
RuleId:
type: string
description: The RuleId of the Rule that you want to update. RuleId is returned by CreateRule and by ListRules.
ChangeToken:
type: string
description: The value returned by the most recent call to GetChangeToken.
Updates:
type: array
items:
$ref: '#/components/schemas/RuleUpdate'
description: 'An array of RuleUpdate objects that you want to insert into or delete from a Rule. For more information, see the applicable data types: RuleUpdate: Contains Action and Predicate Predicate: Contains DataId, Negated, and Type FieldToMatch: Contains Data and Type'
required:
- RuleId
- ChangeToken
- Updates
CreateRuleResponse:
type: object
properties:
Rule:
$ref: '#/components/schemas/Rule'
ChangeToken:
type: string
description: The ChangeToken that you used to submit the CreateRule request. You can also use this value to query the status of the request. For more information, see GetChangeTokenStatus.
WAFBadRequestException:
type: object
properties:
message:
type: string
ListRulesResponse:
type: object
properties:
NextMarker:
type: string
description: If you have more Rules than the number that you specified for Limit in the request, the response includes a NextMarker value. To list more Rules, submit another ListRules request, and specify the NextMarker value from the response in the NextMarker value in the next request.
Rules:
type: array
items:
$ref: '#/components/schemas/RuleSummary'
description: An array of RuleSummary objects.
securitySchemes:
sigv4:
type: apiKey
in: header
name: Authorization
description: AWS Signature Version 4. The Authorization header carries an AWS4-HMAC-SHA256 signature over the canonical request, with X-Amz-Date (and X-Amz-Security-Token for temporary credentials). Not a bearer token.
x-aws-sigv4:
signingName: waf
x-provenance:
method: harvested
publisher: Amazon Web Services
source: https://raw.githubusercontent.com/aws/api-models-aws/582e55931c45b944739742a2c1620b6026dd2d13/models/waf/service/2015-08-24/waf-2015-08-24.json
note: converted by smithy-to-openapi.py from AWS's Smithy model (roadmap#1001)