> ## Documentation Index
> Fetch the complete documentation index at: https://docs.canton.network/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> If you are building a Canton Network application, start from https://docs.canton.network/appdev/quickstart.md. To run only a local network for your own Daml code, without building the QuickStart demo, see https://docs.canton.network/sdks-tools/development-tools/localnet.md.

# POST /v0/backfilling/votes-before

> Retrieve vote results strictly before the given `(record_time, event_number)`, for backfilling `votes_store_results`. Meant for Scan-to-Scan backfilling only, and offers no compatibility guarantees. Fails unless `/v0/backfilling/votes-status` reports "available" for the same record time.

Retrieve vote results strictly before the given `(record_time, event_number)`, for backfilling `votes_store_results`. Meant for Scan-to-Scan backfilling only, and offers no compatibility guarantees. Fails unless `/v0/backfilling/votes-status` reports "available" for the same record time.

OpenAPI

[Added 0.10.4](#history-added-0-10-4)

```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl --request POST \
  --url 'https://scan.sv-1.global.canton.network.sync.global/api/scan/v0/backfilling/votes-before' \
  --header 'Content-Type: application/json' \
  --data '{
  "before_record_time": "2026-01-01T00:00:00Z",
  "before_event_number": 123,
  "count": 123
}'
```

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
import json
import requests

url = "https://scan.sv-1.global.canton.network.sync.global/api/scan/v0/backfilling/votes-before"
headers = {'Content-Type': 'application/json'}
payload = json.loads(r'''{
  "before_record_time": "2026-01-01T00:00:00Z",
  "before_event_number": 123,
  "count": 123
}''')
response = requests.request(
    "POST", url, headers=headers, json=payload
)

print(response.text)
```

```javascript JavaScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
const response = await fetch('https://scan.sv-1.global.canton.network.sync.global/api/scan/v0/backfilling/votes-before', {
  method: 'POST',
  headers: {
  "Content-Type": "application/json"
},
  body: JSON.stringify({
  "before_record_time": "2026-01-01T00:00:00Z",
  "before_event_number": 123,
  "count": 123
}),
});

console.log(await response.text());
```

```php PHP theme={"theme":{"light":"github-light","dark":"github-dark"}}
<?php
$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => 'https://scan.sv-1.global.canton.network.sync.global/api/scan/v0/backfilling/votes-before',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => <<<'JSON'
{
  "before_record_time": "2026-01-01T00:00:00Z",
  "before_event_number": 123,
  "count": 123
}
JSON,
    CURLOPT_HTTPHEADER => [
        "Content-Type: application/json"
    ],
]);

$response = curl_exec($curl);
echo $response;
```

```go Go theme={"theme":{"light":"github-light","dark":"github-dark"}}
package main

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

func main() {
  req, _ := http.NewRequest("POST", "https://scan.sv-1.global.canton.network.sync.global/api/scan/v0/backfilling/votes-before", bytes.NewBufferString(`{
  "before_record_time": "2026-01-01T00:00:00Z",
  "before_event_number": 123,
  "count": 123
}`))
  req.Header.Set("Content-Type", "application/json")
  response, _ := http.DefaultClient.Do(req)
  defer response.Body.Close()
  body, _ := io.ReadAll(response.Body)
  fmt.Println(string(body))
}
```

```java Java theme={"theme":{"light":"github-light","dark":"github-dark"}}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

var request = HttpRequest.newBuilder()
    .uri(URI.create("https://scan.sv-1.global.canton.network.sync.global/api/scan/v0/backfilling/votes-before"))
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("""
{
  "before_record_time": "2026-01-01T00:00:00Z",
  "before_event_number": 123,
  "count": 123
}
"""))
    .build();
var response = HttpClient.newHttpClient().send(
    request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

```ruby Ruby theme={"theme":{"light":"github-light","dark":"github-dark"}}
require 'net/http'
require 'uri'

uri = URI('https://scan.sv-1.global.canton.network.sync.global/api/scan/v0/backfilling/votes-before')
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request.body = <<~JSON
{
  "before_record_time": "2026-01-01T00:00:00Z",
  "before_event_number": 123,
  "count": 123
}
JSON
response = Net::HTTP.start(uri.hostname, uri.port) do |http|
  http.request(request)
end
puts response.body
```

```json 200 theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "votes": [
    {
      "record_time": "2026-01-01T00:00:00Z",
      "synchronizer_id": "<string>",
      "update_id": "<string>",
      "event_number": 123,
      "contract_id": "<string>",
      "choice_result": {}
    }
  ]
}
```

```json 400 theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "error": "<string>"
}
```

## Body

application/json

**before\_record\_time** `string` *required*

OpenAPI type: `string (date-time)`.

Only return vote results with a record time strictly smaller than this time, or with this record time and an event number strictly smaller than `before_event_number`.

**before\_event\_number** `number` *required*

OpenAPI type: `integer (int32)`.

**count** `number` *required*

OpenAPI type: `integer (int32)`.

Return at most this many vote results. The actual number returned may be smaller.

Minimum: 1; Maximum: 1000.

## Responses

### 200

ok

application/json

**votes** `VoteResultForBackfilling[]` *required*

**child attributes**

**record\_time** `string (date-time)` *required*

**synchronizer\_id** `string` *required*

**update\_id** `string` *required*

**event\_number** `integer (int32)` *required*

**contract\_id** `string` *required*

The contract id of the DsoRules on which the `DsoRules_CloseVoteRequest` choice was exercised.

**choice\_result** `object` *required*

The JSON-encoded `DsoRules_CloseVoteRequestResult`, as stored by the Scan that serves it.

### 400

bad request

application/json

**error** `string` *required*

## History

Added
`0.10.4`
