> 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/state-leaderboard-scoreboard-hole-by-hole.md).

# State (leaderboard, scoreboard, hole-by-hole)

### Overview

Use these endpoints to consume current golf state snapshots.

This section covers leaderboard and hole-by-hole resources.

REST returns the current snapshot for the requested resource.

WebSocket delivers the same resource inside a CloudEvents envelope.

{% hint style="info" %}
REST state endpoints return the resource payload only.

WebSocket state endpoints wrap that payload in CloudEvents.
{% endhint %}

### WebSocket state message format

Each WebSocket state message contains a CloudEvents envelope.

The resource-specific state snapshot is stored in `data.payload`.

Possible `type` values:

* `Standings.Sport.Golf` for leaderboard endpoints
* `State.Statistics.Golf` for hole-by-hole endpoints

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

```json
{
  "specversion": "1.0",
  "id": "0da2b5ba-b92f-42bd-b9d2-0fcd978fec85",
  "source": "/tournaments/1971",
  "type": "State.Statistics.Golf",
  "time": "2026-05-04T14:23:01.123Z",
  "tournamentid": 1971,
  "datacontenttype": "application/json",
  "data": {
    "id": "0da2b5ba-b92f-42bd-b9d2-0fcd978fec85",
    "created_at": "2026-04-24T11:09:15.267Z",
    "payload": {
      "...": "resource-specific state object"
    }
  }
}
```

{% endcode %}

### State object fields

| **Name**          | **Type**           | **Description**                                                                      |
| ----------------- | ------------------ | ------------------------------------------------------------------------------------ |
| `specversion`     | String             | CloudEvents specification version.                                                   |
| `id`              | String (UUID)      | Unique identifier of the WebSocket message.                                          |
| `source`          | String             | Message source. Tournament-scoped state messages use `/tournaments/{tournament_id}`. |
| `type`            | String             | State message type, such as `Standings.Sport.Golf` or `State.Statistics.Golf`.       |
| `time`            | String (date-time) | Timestamp when the message was generated.                                            |
| `tournamentid`    | Integer            | Tournament identifier.                                                               |
| `datacontenttype` | String             | Content type of `data`, for example `application/json`.                              |
| `data`            | Object             | State message body.                                                                  |
| `data.id`         | String (UUID)      | Identifier of the state object version.                                              |
| `data.created_at` | String (date-time) | Timestamp when the state object version was created.                                 |
| `data.payload`    | Object             | Resource payload returned by the specific leaderboard or hole-by-hole endpoint.      |

{% hint style="info" %}
The structure of `data.payload` matches the resource page for the endpoint you consume.
{% endhint %}

### Related pages

* [Stroke Play leaderboard](/live-data/live-data-golf-api-design/ld-golf-api-documentation/state-leaderboard-scoreboard-hole-by-hole/stroke-play-leaderboard.md)
* [REST match play leaderboard](/live-data/live-data-golf-api-design/ld-golf-api-documentation/state-leaderboard-scoreboard-hole-by-hole/match-play-leaderboard.md)
* [Stroke Play hole-by-hole](/live-data/live-data-golf-api-design/ld-golf-api-documentation/state-leaderboard-scoreboard-hole-by-hole/stroke-play-hole-by-hole.md)
* [Match Play hole-by-hole](/live-data/live-data-golf-api-design/ld-golf-api-documentation/state-leaderboard-scoreboard-hole-by-hole/match-play-hole-by-hole.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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sportradar.com/live-data/live-data-golf-api-design/ld-golf-api-documentation/state-leaderboard-scoreboard-hole-by-hole.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
