

# CreateTrafficPolicy
<a name="API_CreateTrafficPolicy"></a>

Provision a new traffic policy resource.

## Request Syntax
<a name="API_CreateTrafficPolicy_RequestSyntax"></a>

```
{
   "ClientToken": "string",
   "DefaultAction": "string",
   "MaxMessageSizeBytes": number,
   "PolicyStatements": [ 
      { 
         "Action": "string",
         "Conditions": [ 
            { ... }
         ]
      }
   ],
   "Tags": [ 
      { 
         "Key": "string",
         "Value": "string"
      }
   ],
   "TrafficPolicyName": "string"
}
```

## Request Parameters
<a name="API_CreateTrafficPolicy_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [ClientToken](#API_CreateTrafficPolicy_RequestSyntax) **   <a name="sesmailmanager-CreateTrafficPolicy-request-ClientToken"></a>
A unique token that Amazon SES uses to recognize subsequent retries of the same request.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 128.  
Required: No

 ** [DefaultAction](#API_CreateTrafficPolicy_RequestSyntax) **   <a name="sesmailmanager-CreateTrafficPolicy-request-DefaultAction"></a>
Default action instructs the traﬃc policy to either Allow or Deny (block) messages that fall outside of (or not addressed by) the conditions of your policy statements  
Type: String  
Valid Values: `ALLOW | DENY`   
Required: Yes

 ** [MaxMessageSizeBytes](#API_CreateTrafficPolicy_RequestSyntax) **   <a name="sesmailmanager-CreateTrafficPolicy-request-MaxMessageSizeBytes"></a>
The maximum message size in bytes of email which is allowed in by this traffic policy—anything larger will be blocked.  
Type: Integer  
Valid Range: Minimum value of 1.  
Required: No

 ** [PolicyStatements](#API_CreateTrafficPolicy_RequestSyntax) **   <a name="sesmailmanager-CreateTrafficPolicy-request-PolicyStatements"></a>
Conditional statements for filtering email traffic.  
Type: Array of [PolicyStatement](API_PolicyStatement.md) objects  
Required: Yes

 ** [Tags](#API_CreateTrafficPolicy_RequestSyntax) **   <a name="sesmailmanager-CreateTrafficPolicy-request-Tags"></a>
The tags used to organize, track, or control access for the resource. For example, \$1 "tags": \$1"key1":"value1", "key2":"value2"\$1 \$1.  
Type: Array of [Tag](API_Tag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 200 items.  
Required: No

 ** [TrafficPolicyName](#API_CreateTrafficPolicy_RequestSyntax) **   <a name="sesmailmanager-CreateTrafficPolicy-request-TrafficPolicyName"></a>
A user-friendly name for the traffic policy resource.  
Type: String  
Length Constraints: Minimum length of 3. Maximum length of 63.  
Pattern: `[A-Za-z0-9_\-]+`   
Required: Yes

## Response Syntax
<a name="API_CreateTrafficPolicy_ResponseSyntax"></a>

```
{
   "TrafficPolicyId": "string"
}
```

## Response Elements
<a name="API_CreateTrafficPolicy_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [TrafficPolicyId](#API_CreateTrafficPolicy_ResponseSyntax) **   <a name="sesmailmanager-CreateTrafficPolicy-response-TrafficPolicyId"></a>
The identifier of the traffic policy resource.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 100.

## Errors
<a name="API_CreateTrafficPolicy_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ConflictException **   
The request configuration has conflicts. For details, see the accompanying error message.  
HTTP Status Code: 400

 ** ServiceQuotaExceededException **   
Occurs when an operation exceeds a predefined service quota or limit.  
HTTP Status Code: 400

 ** ValidationException **   
The request validation has failed. For details, see the accompanying error message.  
HTTP Status Code: 400

## See Also
<a name="API_CreateTrafficPolicy_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/mailmanager-2023-10-17/CreateTrafficPolicy) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/mailmanager-2023-10-17/CreateTrafficPolicy) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/mailmanager-2023-10-17/CreateTrafficPolicy) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/mailmanager-2023-10-17/CreateTrafficPolicy) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/mailmanager-2023-10-17/CreateTrafficPolicy) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/mailmanager-2023-10-17/CreateTrafficPolicy) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/mailmanager-2023-10-17/CreateTrafficPolicy) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/mailmanager-2023-10-17/CreateTrafficPolicy) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/mailmanager-2023-10-17/CreateTrafficPolicy) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/mailmanager-2023-10-17/CreateTrafficPolicy) 