# The stateManager.getMatches() method
This documents the `stateManager.getMatches()` method.

This method has input parameters. The function could easily be defined as:
```ts
function getMatches(tournamentGuid: string,): Match[] | undefined {
    // backend logic
}
```
## General usage:
```ts
const matchesResponse: Match[] | undefined = taClient.stateManager.getMatches(tournamentGuid);
```

This method will return either an array of the `Match` object or undefined. A `Match` can be described by the following TypeScript Interface:
```ts
interface Match {
    /**
     * @generated from protobuf field: string guid = 1;
     */
    guid: string;
    /**
     * @generated from protobuf field: repeated string associated_users = 2;
     */
    associatedUsers: string[];
    /**
     * @generated from protobuf field: string leader = 3;
     */
    leader: string;
    /**
     * @generated from protobuf field: proto.models.Map selected_map = 4;
     */
    selectedMap?: Map;
}
```

For the definition of a Map please look at the [Modals -> Map page](/documentation#Modals/4-Map)