> For the complete documentation index, see [llms.txt](https://docs.sportradar.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sportradar.com/live-data/live-data-golf-api-design/ld-golf-api-documentation/live-events/live-events.md).

# Live Events

### Overview

Use these endpoints to consume live golf events for a specific tournament context.

Stroke play events are scoped to a tournament round.

Match play events are scoped to a match.

You can consume live events through WebSocket or fetch event history through REST.

### Transport options

* **WebSocket** delivers events as they happen.
* **REST** returns previously produced events.

{% hint style="info" %}
REST responses return event objects only. They do not include the outer CloudEvents envelope used by WebSocket.
{% endhint %}

### WebSocket initialization

After the WebSocket connection is established, send a `Client.Init` message.

If you include `last_seen_event_id`, the stream resumes after that event.

If you omit `last_seen_event_id`, the stream starts by replaying all past events, then continues with new events.

If the server does not receive the init message within about 90 seconds, it closes the connection with code `1000`.

### Init message example

{% code title="Client.Init" overflow="wrap" %}

```json
{
  "type": "Client.Init",
  "last_seen_event_id": "3194af24-b6d6-4758-9dda-216072e2351e"
}
```

{% endcode %}

### WebSocket event format

Each WebSocket message contains a CloudEvents envelope.

The golf-specific event object is stored in `data`.

{% code title="WebSocket event example" overflow="wrap" expandable="true" %}

```json
{
  "specversion": "1.0",
  "id": "0da2b5ba-b92f-42bd-b9d2-0fcd978fec85",
  "source": "/tournaments/1971",
  "type": "Event.Sport.Golf",
  "time": "2026-05-04T14:23:01.123Z",
  "tournamentid": 1971,
  "datacontenttype": "application/json",
  "data": {
    "id": "0da2b5ba-b92f-42bd-b9d2-0fcd978fec85",
    "action": "ADD",
    "type": "Event.Sport.Golf.BallHoled",
    "created_at": "2026-04-24T11:09:15.267Z",
    "sport_event": {
      "id": "sr:match:67607764"
    },
    "payload": {
      "event_time": "2026-04-24T11:09:15.267Z"
      ......... // event specific data
    }
  }
}
```

{% endcode %}

### Event object fields

| field               | type               | description                                                                                              |
| ------------------- | ------------------ | -------------------------------------------------------------------------------------------------------- |
| id                  | String (UUID)      | Unique identifier of the live event.                                                                     |
| action              | String             | Operation applied to the event payload. Possible values: `ADD`, `UPDATE`, `DELETE`.                      |
| type                | String             | Golf live event type such as `Event.Sport.Golf.BallHoled`.                                               |
| created\_at         | String (date-time) | Timestamp when this version of the event object was created.                                             |
| sport\_event        | Object             | SR sport event reference. For stroke play this refers to a round. For match play this refers to a match. |
| sport\_event.id     | String             | SR identifier of the referenced sport event.                                                             |
| payload             | Object             | Domain-specific event payload. This field is omitted for `DELETE` actions.                               |
| payload.event\_time | String (date-time) | Timestamp when the event occurred on the course.                                                         |

{% hint style="info" %}
`created_at` is version time. `payload.event_time` is on-course event time.
{% endhint %}

### REST response format

REST endpoints return an array of event objects.

These objects match the `data` part of the WebSocket message.

{% code title="REST response example" overflow="wrap" expandable="true" %}

```json
{
  "events": [
    {
      "id": "0da2b5ba-b92f-42bd-b9d2-0fcd978fec85",
      "action": "ADD",
      "type": "Event.Sport.Golf.BallHoled",
      "created_at": "2026-04-24T11:09:15.267Z",
      "sport_event": {
        "id": "sr:stage:1234"
      },
      "payload": {
        "event_time": "2026-04-24T11:09:15.267Z"
      }
    },
    {
      "id": "c54039bb-56ef-4fa5-8240-446f28d28060",
      "action": "ADD",
      "type": "Event.Sport.Golf.HoleEnded",
      "created_at": "2026-04-24T11:10:15.267Z",
      "sport_event": {
        "id": "sr:stage:1234"
      },
      "payload": {
        "event_time": "2026-04-24T11:10:15.267Z"
      }
    }
  ]
}
```

{% endcode %}

### Endpoints

#### Stroke play tournaments

**WebSocket**

`wss://{domain}/golf/stream/v1/tournaments/{tournament_id}/round/{round_id}/events`

**REST**

`GET https://{domain}/golf/rest/v1/tournaments/{tournament_id}/round/{round_id}/events`

**Path parameters**

| **Name**        | **Type** | **Required** | **Description**        |
| --------------- | -------- | ------------ | ---------------------- |
| `tournament_id` | integer  | Yes          | Tournament identifier. |
| `round_id`      | integer  | Yes          | Round identifier.      |

#### Match play tournaments

**WebSocket**

`wss://{domain}/golf/stream/v1/tournaments/{tournament_id}/match/{match_id}/events`

**REST**

`GET https://{domain}/golf/rest/v1/tournaments/{tournament_id}/match/{match_id}/events`

**Path parameters**

| **Name**        | **Type** | **Required** | **Description**        |
| --------------- | -------- | ------------ | ---------------------- |
| `tournament_id` | integer  | Yes          | Tournament identifier. |
| `match_id`      | integer  | Yes          | Match identifier.      |

### Related pages

* [DELETE/UPDATE approach](/live-data/live-data-golf-api-design/ld-golf-api-documentation/live-events/delete-update-approach.md)
* [Round Events](/live-data/live-data-golf-api-design/ld-golf-api-documentation/live-event-types/round-events-sportevent.md)
* [Hole Events](/live-data/live-data-golf-api-design/ld-golf-api-documentation/live-event-types/hole-events.md)
* [Standard Stroke Event](/live-data/live-data-golf-api-design/ld-golf-api-documentation/live-event-types/standard-stroke-event.md)
* [Ball Drops and Penalty Events](/live-data/live-data-golf-api-design/ld-golf-api-documentation/live-event-types/ball-drops-and-penalty-events.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sportradar.com/live-data/live-data-golf-api-design/ld-golf-api-documentation/live-events/live-events.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
