StartMatchmaking - Amazon GameLift Service


Uses FlexMatch to create a game match for a group of players based on custom matchmaking rules, and starts a new game for the matched players. Each matchmaking request specifies the type of match to build (team configuration, rules for an acceptable match, etc.). The request also specifies the players to find a match for and where to host the new game session for optimal performance. A matchmaking request might start with a single player or a group of players who want to play together. FlexMatch finds additional players as needed to fill the match. Match type, rules, and the queue used to place a new game session are defined in a MatchmakingConfiguration.

To start matchmaking, provide a unique ticket ID, specify a matchmaking configuration, and include the players to be matched. You must also include a set of player attributes relevant for the matchmaking configuration. If successful, a matchmaking ticket is returned with status set to QUEUED. Track the status of the ticket to respond as needed and acquire game session connection information for successfully completed matches.

Tracking ticket status -- A couple of options are available for tracking the status of matchmaking requests:

  • Polling -- Call DescribeMatchmaking. This operation returns the full ticket object, including current status and (for completed tickets) game session connection info. We recommend polling no more than once every 10 seconds.

  • Notifications -- Get event notifications for changes in ticket status using Amazon Simple Notification Service (SNS). Notifications are easy to set up (see CreateMatchmakingConfiguration) and typically deliver match status changes faster and more efficiently than polling. We recommend that you use polling to back up to notifications (since delivery is not guaranteed) and call DescribeMatchmaking only when notifications are not received within 30 seconds.

Processing a matchmaking request -- FlexMatch handles a matchmaking request as follows:

  1. Your client code submits a StartMatchmaking request for one or more players and tracks the status of the request ticket.

  2. FlexMatch uses this ticket and others in process to build an acceptable match. When a potential match is identified, all tickets in the proposed match are advanced to the next status.

  3. If the match requires player acceptance (set in the matchmaking configuration), the tickets move into status REQUIRES_ACCEPTANCE. This status triggers your client code to solicit acceptance from all players in every ticket involved in the match, and then call AcceptMatch for each player. If any player rejects or fails to accept the match before a specified timeout, the proposed match is dropped (see AcceptMatch for more details).

  4. Once a match is proposed and accepted, the matchmaking tickets move into status PLACING. FlexMatch locates resources for a new game session using the game session queue (set in the matchmaking configuration) and creates the game session based on the match data.

  5. When the match is successfully placed, the matchmaking tickets move into COMPLETED status. Connection information (including game session endpoint and player session) is added to the matchmaking tickets. Matched players can use the connection information to join the game.

Learn more

Add FlexMatch to a Game Client

Set Up FlexMatch Event Notification

FlexMatch Integration Roadmap

How GameLift FlexMatch Works

Related operations

Request Syntax

{ "ConfigurationName": "string", "Players": [ { "LatencyInMs": { "string" : number }, "PlayerAttributes": { "string" : { "N": number, "S": "string", "SDM": { "string" : number }, "SL": [ "string" ] } }, "PlayerId": "string", "Team": "string" } ], "TicketId": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.


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


Name of the matchmaking configuration to use for this request. Matchmaking configurations must exist in the same Region as this request. You can use either the configuration name or ARN value.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 256.

Pattern: [a-zA-Z0-9-\.]*|^arn:.*:matchmakingconfiguration\/[a-zA-Z0-9-\.]*

Required: Yes


Information on each player to be matched. This information must include a player ID, and may contain player attributes and latency data to be used in the matchmaking process. After a successful match, Player objects contain the name of the team the player is assigned to.

Type: Array of Player objects

Required: Yes


A unique identifier for a matchmaking ticket. If no ticket ID is specified here, Amazon GameLift will generate one in the form of a UUID. Use this identifier to track the matchmaking ticket status and retrieve match results.

Type: String

Length Constraints: Maximum length of 128.

Pattern: [a-zA-Z0-9-\.]*

Required: No

Response Syntax

{ "MatchmakingTicket": { "ConfigurationArn": "string", "ConfigurationName": "string", "EndTime": number, "EstimatedWaitTime": number, "GameSessionConnectionInfo": { "DnsName": "string", "GameSessionArn": "string", "IpAddress": "string", "MatchedPlayerSessions": [ { "PlayerId": "string", "PlayerSessionId": "string" } ], "Port": number }, "Players": [ { "LatencyInMs": { "string" : number }, "PlayerAttributes": { "string" : { "N": number, "S": "string", "SDM": { "string" : number }, "SL": [ "string" ] } }, "PlayerId": "string", "Team": "string" } ], "StartTime": number, "Status": "string", "StatusMessage": "string", "StatusReason": "string", "TicketId": "string" } }

Response Elements

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

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


Ticket representing the matchmaking request. This object include the information included in the request, ticket status, and match results as generated during the matchmaking process.

Type: MatchmakingTicket object


For information about the errors that are common to all actions, see Common Errors.


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


One or more parameter values in the request are invalid. Correct the invalid parameter values before retrying.

HTTP Status Code: 400


A service resource associated with the request could not be found. Clients should not retry such requests.

HTTP Status Code: 400


The requested operation is not supported in the Region specified.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: