

# CreateMatchmakingRuleSet
<a name="API_CreateMatchmakingRuleSet"></a>

 **This API works with the following fleet types:** EC2, Anywhere, Container

Creates a new rule set for FlexMatch matchmaking. A rule set describes the type of match to create, such as the number and size of teams. It also sets the parameters for acceptable player matches, such as minimum skill level or character type.

To create a matchmaking rule set, provide unique rule set name and the rule set body in JSON format. Rule sets must be defined in the same Region as the matchmaking configuration they are used with.

Since matchmaking rule sets cannot be edited, it is a good idea to check the rule set syntax using [ValidateMatchmakingRuleSet](https://docs.aws.amazon.com/gamelift/latest/apireference/API_ValidateMatchmakingRuleSet.html) before creating a new rule set.

 **Learn more** 
+  [Build a rule set](https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-rulesets.html) 
+  [Design a matchmaker](https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-configuration.html) 
+  [Matchmaking with FlexMatch](https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-intro.html) 

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

```
{
   "Name": "string",
   "RuleSetBody": "string",
   "Tags": [ 
      { 
         "Key": "string",
         "Value": "string"
      }
   ]
}
```

## Request Parameters
<a name="API_CreateMatchmakingRuleSet_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.

**Note**  
In the following list, the required parameters are described first.

 ** [Name](#API_CreateMatchmakingRuleSet_RequestSyntax) **   <a name="gameliftservers-CreateMatchmakingRuleSet-request-Name"></a>
A unique identifier for the matchmaking rule set. A matchmaking configuration identifies the rule set it uses by this name value. Note that the rule set name is different from the optional `name` field in the rule set body.  
Type: String  
Length Constraints: Maximum length of 128.  
Pattern: `[a-zA-Z0-9-\.]*`   
Required: Yes

 ** [RuleSetBody](#API_CreateMatchmakingRuleSet_RequestSyntax) **   <a name="gameliftservers-CreateMatchmakingRuleSet-request-RuleSetBody"></a>
A collection of matchmaking rules, formatted as a JSON string. Comments are not allowed in JSON, but most elements support a description field.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 65535.  
Required: Yes

 ** [Tags](#API_CreateMatchmakingRuleSet_RequestSyntax) **   <a name="gameliftservers-CreateMatchmakingRuleSet-request-Tags"></a>
A list of labels to assign to the new matchmaking rule set resource. Tags are developer-defined key-value pairs. Tagging AWS resources are useful for resource management, access management and cost allocation. For more information, see [ Tagging AWS Resources](https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) in the * AWS General Reference*.  
Type: Array of [Tag](API_Tag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 200 items.  
Required: No

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

```
{
   "RuleSet": { 
      "CreationTime": number,
      "RuleSetArn": "string",
      "RuleSetBody": "string",
      "RuleSetName": "string"
   }
}
```

## Response Elements
<a name="API_CreateMatchmakingRuleSet_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.

 ** [RuleSet](#API_CreateMatchmakingRuleSet_ResponseSyntax) **   <a name="gameliftservers-CreateMatchmakingRuleSet-response-RuleSet"></a>
The newly created matchmaking rule set.  
Type: [MatchmakingRuleSet](API_MatchmakingRuleSet.md) object

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

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

 ** InternalServiceException **   
The service encountered an unrecoverable internal failure while processing the request. Clients can retry such requests immediately or after a waiting period.  
HTTP Status Code: 500

 ** InvalidRequestException **   
One or more parameter values in the request are invalid. Correct the invalid parameter values before retrying.  
HTTP Status Code: 400

 ** LimitExceededException **   
The requested operation would cause the resource to exceed the allowed service limit. Resolve the issue before retrying.  
HTTP Status Code: 400

 ** TaggingFailedException **   
The requested tagging operation did not succeed. This may be due to invalid tag format or the maximum tag limit may have been exceeded. Resolve the issue before retrying.  
HTTP Status Code: 400

 ** UnsupportedRegionException **   
The requested operation is not supported in the Region specified.  
HTTP Status Code: 400

## See Also
<a name="API_CreateMatchmakingRuleSet_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/gamelift-2015-10-01/CreateMatchmakingRuleSet) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/gamelift-2015-10-01/CreateMatchmakingRuleSet) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/gamelift-2015-10-01/CreateMatchmakingRuleSet) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/gamelift-2015-10-01/CreateMatchmakingRuleSet) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/gamelift-2015-10-01/CreateMatchmakingRuleSet) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/gamelift-2015-10-01/CreateMatchmakingRuleSet) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/gamelift-2015-10-01/CreateMatchmakingRuleSet) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/gamelift-2015-10-01/CreateMatchmakingRuleSet) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/gamelift-2015-10-01/CreateMatchmakingRuleSet) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/gamelift-2015-10-01/CreateMatchmakingRuleSet) 