# /v1/beacon/rewards/sync_committee/{block_id}

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

POST https://eth-mainnetbeacon.g.alchemy.com/v2/docs-demo/eth/v1/beacon/rewards/sync_committee/{block_id}

Retrieves rewards info for sync committee members specified by array of public keys or validator indices.   If no array is provided, the rewards for **all sync committee members** are returned.


Reference: https://www.alchemy.com/docs/chains/ethereum/ethereum-beacon-api-endpoints/ethereum-beacon-api-endpoints/v-1-beacon-rewards-sync-committee-block-id

## Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| block_id | string | Yes | Block identifier.   Can be one of:   `head` (canonical head in node's view),   `genesis`,   `finalized`,   `<slot>`,   `<hex encoded blockRoot with 0x prefix>`.  |

## Code Examples

### cURL

```bash
curl --request POST \
  --url https://eth-mainnetbeacon.g.alchemy.com/v2/docs-demo/eth/v1/beacon/rewards/sync_committee/head \
  --header 'Content-Type: application/json' \
  --data '[
  "string"
]'
```

### JavaScript

```javascript
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify(['string'])
};

fetch('https://eth-mainnetbeacon.g.alchemy.com/v2/docs-demo/eth/v1/beacon/rewards/sync_committee/head', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://eth-mainnetbeacon.g.alchemy.com/v2/docs-demo/eth/v1/beacon/rewards/sync_committee/head"

payload = ["string"]
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

### Go

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://eth-mainnetbeacon.g.alchemy.com/v2/docs-demo/eth/v1/beacon/rewards/sync_committee/head"

	payload := strings.NewReader("[\n  \"string\"\n]")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

### Java

```java
HttpResponse<String> response = Unirest.post("https://eth-mainnetbeacon.g.alchemy.com/v2/docs-demo/eth/v1/beacon/rewards/sync_committee/head")
  .header("Content-Type", "application/json")
  .body("[\n  \"string\"\n]")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://eth-mainnetbeacon.g.alchemy.com/v2/docs-demo/eth/v1/beacon/rewards/sync_committee/head");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("[\n  \"string\"\n]", false);
var response = await client.PostAsync(request);

Console.WriteLine("{0}", response.Content);

```


## Operation Specification

```yaml
path: /eth/v1/beacon/rewards/sync_committee/{block_id}
method: POST
operation:
  summary: /v1/beacon/rewards/sync_committee/{block_id}
  description: |
    Retrieves rewards info for sync committee members specified by array of public keys or validator indices.   If no array is provided, the rewards for **all sync committee members** are returned.
  tags:
    - Ethereum Beacon API Endpoints
  security:
    - apiKey: []
  parameters:
    - name: block_id
      in: path
      required: true
      schema:
        type: string
        example: head
      description: |
        Block identifier.   Can be one of:   `head` (canonical head in node's view),   `genesis`,   `finalized`,   `<slot>`,   `<hex encoded blockRoot with 0x prefix>`.
  requestBody:
    required: false
    content:
      application/json:
        schema:
          type: array
          description: |
            Optional list of validator identifiers.   Each entry may be either: - hex encoded public key (48 bytes, `0x` prefix), or   - validator index (string).
          items:
            type: string
          example:
            - '474200'
  responses:
    '200':
      description: Rewards for sync committee members.
      content:
        application/json:
          schema:
            type: object
            properties:
              execution_optimistic:
                type: boolean
              finalized:
                type: boolean
              data:
                type: array
                description: Rewards info.
                items:
                  type: object
                  properties:
                    validator_index:
                      type: string
                      example: '1'
                    reward:
                      type: string
                      description: Reward amount in Gwei.
                      example: '2000'
          examples:
            response_example:
              summary: Example response
              value:
                execution_optimistic: false
                finalized: false
                data:
                  - validator_index: '1'
                    reward: '2000'
            empty_response_example:
              summary: Example response (no rewards returned)
              value:
                execution_optimistic: false
                finalized: false
                data: []
```
