Every API here is available over the APIs.io API and to AI agents over MCP.
openapi: 3.1.0
info:
title: AWS WAFV2 Rule API
version: '2019-07-29'
description: Generated from AWS's published Smithy model for AWS WAFV2. 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: []
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/WafWAFInternalErrorException'
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/WafWAFInternalErrorException'
'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/WafWAFInternalErrorException'
'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/WafWAFInternalErrorException'
'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/WafWAFInternalErrorException'
'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:
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
schemas:
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/WafTag'
required:
- Name
- MetricName
- ChangeToken
CreateRuleResponse:
type: object
properties:
Rule:
$ref: '#/components/schemas/WafRule'
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.
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
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.
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
GetRuleResponse:
type: object
properties:
Rule:
$ref: '#/components/schemas/WafRule'
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.
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/WafRuleSummary'
description: An array of RuleSummary objects.
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
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
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
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.
WAFBadRequestException:
type: object
properties:
message:
type: string
WAFInvalidAccountException:
type: object
properties: {}
WafRule:
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
WafRuleSummary:
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
WafTag:
type: object
properties:
Key:
type: string
Value:
type: string
required:
- Key
- Value
WafWAFInternalErrorException:
type: object
properties:
message:
type: string
x-provenance:
method: harvested
publisher: Amazon Web Services
source: https://raw.githubusercontent.com/aws/api-models-aws/3cd98287b471c106254abd89279cc87308d38bfd/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)