---
title: "POST /#X-Amz-Target=AWSWAF_Regional_20161128.CreateRegexPatternSet"
method: POST
path: "/#X-Amz-Target=AWSWAF_Regional_20161128.CreateRegexPatternSet"
---

# POST /#X-Amz-Target=AWSWAF_Regional_20161128.CreateRegexPatternSet

`POST /#X-Amz-Target=AWSWAF_Regional_20161128.CreateRegexPatternSet`

<note> <p>This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS WAF Classic</a> in the developer guide.</p> <p> <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints for regional and global use. </p> </note> <p>Creates a <code>RegexPatternSet</code>. You then use <a>UpdateRegexPatternSet</a> to specify the regular expression (regex) pattern that you want AWS WAF to search for, such as <code>B[a@]dB[o0]t</code>. You can then configure AWS WAF to reject those requests.</p> <p>To create and configure a <code>RegexPatternSet</code>, perform the following steps:</p> <ol> <li> <p>Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code> parameter of a <code>CreateRegexPatternSet</code> request.</p> </li> <li> <p>Submit a <code>CreateRegexPatternSet</code> request.</p> </li> <li> <p>Use <code>GetChangeToken</code> to get the change token that you provide in the <code>ChangeToken</code> parameter of an <code>UpdateRegexPatternSet</code> request.</p> </li> <li> <p>Submit an <a>UpdateRegexPatternSet</a> request to specify the string that you want AWS WAF to watch for.</p> </li> </ol> <p>For more information about how to use the AWS WAF API to allow or block HTTP requests, see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer Guide</a>.</p>

## Headers

- `X-Amz-Target` 'AWSWAF_Regional_20161128.CreateRegexPatternSet', required

## Request body

- CreateRegexPatternSetRequest
  - `Name` string, required — A friendly name or description of the <a>RegexPatternSet</a>. You can't change <code>Name</code> after you create a <code>RegexPatternSet</code>.
  - `ChangeToken` string, required — The value returned by the most recent call to <a>GetChangeToken</a>.

## Response `200`

Success

- CreateRegexPatternSetResponse
  - `RegexPatternSet` object — A <a>RegexPatternSet</a> that contains no objects.
    - `RegexPatternSetId` string, required — <p>The identifier for the <code>RegexPatternSet</code>. You use <code>RegexPatternSetId</code> to get information about a <code>RegexPatternSet</code>, update a <code>RegexPatternSet</code>, remove a <code>RegexPatternSet</code> from a <code>RegexMatchSet</code>, and delete a <code>RegexPatternSet</code> from AWS WAF.</p> <p> <code>RegexMatchSetId</code> is returned by <a>CreateRegexPatternSet</a> and by <a>ListRegexPatternSets</a>.</p>
    - `Name` string — A friendly name or description of the <a>RegexPatternSet</a>. You can't change <code>Name</code> after you create a <code>RegexPatternSet</code>.
    - `RegexPatternStrings` RegexPatternString[], required — Specifies the regular expression (regex) patterns that you want AWS WAF to search for, such as <code>B[a@]dB[o0]t</code>.
  - `ChangeToken` string — The <code>ChangeToken</code> that you used to submit the <code>CreateRegexPatternSet</code> request. You can also use this value to query the status of the request. For more information, see <a>GetChangeTokenStatus</a>.

## Other responses

- `480` — WAFStaleDataException
- `481` — WAFInternalErrorException
- `482` — WAFDisallowedNameException
- `483` — WAFLimitsExceededException

---

[API](https://skmtc.net/aws/apis/waf-regional.md) · [All operations](https://skmtc.net/aws/apis/waf-regional/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/waf-regional/versions/12b830ff94fb/schema)
