How to: Sample connect event payloads
The following are sample payloads for the `connect` webhook events.

#### Successful player backend connection

```json
{
  "event": "connect",
  "timestamp": "2025-04-20T22:26:30.2568775-05:00",
  "status": "success",
  "client": {
    "host": "127.0.0.1",
    "port": 56860
  },
  "server": "localhost",
  "player": {
    "name": "itzg",
    "uuid": "5cddfd26-fc86-4981-b52e-c42bb10bfdef"
  },
  "backend": "localhost:25566"
}
```

**NOTE** `client` refers to the machine where the Minecraft client is connecting from and is conveyed separately from the `player` starting a session. As seen below, the player information may not always be present, such as when the client is pinging the server list.

#### Successful server ping backend connection

**NOTE** the absence of `player` in this payload since the Minecraft client does not send player information in the server ping request.

```json
{
  "event": "connect",
  "timestamp": "2025-04-20T22:26:30.2568775-05:00",
  "status": "success",
  "client": {
    "host": "127.0.0.1",
    "port": 56396
  },
  "server": "localhost",
  "backend": "localhost:25566"
}
```

#### Missing backend

In this the status is `"missing-backend"` since the requested server `invalid.example.com` does not have a configured/discovered backend entry.

```json
{
  "event": "connect",
  "timestamp": "2025-04-20T22:26:30.2568775-05:00",
  "status": "missing-backend",
  "client": {
    "host": "127.0.0.1",
    "port": 56891
  },
  "server": "invalid.example.com",
  "player": {
    "name": "itzg",
    "uuid": "5cddfd26-fc86-4981-b52e-c42bb10bfdef"
  },
  "error": "No backend found"
}
```

#### Failed backend connection

In this case the `status` is `"failed-backend-connection"` indicating that a backend server was located but a connection could not be established from mc-router.

```json
{
  "event": "connect",
  "timestamp": "2025-04-20T22:26:30.2568775-05:00",
  "status": "failed-backend-connection",
  "client": {
    "host": "127.0.0.1",
    "port": 56905
  },
  "server": "localhost",
  "player": {
    "name": "itzg",
    "uuid": "5cddfd26-fc86-4981-b52e-c42bb10bfdef"
  },
  "backend": "localhost:25566",
  "error": "dial tcp [::1]:25566: connectex: No connection could be made because the target machine actively refused it."
}
```