> ## 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 /v1/holdings/state

> Deprecated. Please use /v2/holdings/state instead. The only difference with this endpoint and that one is the type of the `after`/`next_page_token` pagination token. Returns the active amulet contracts for a given migration id and record time, in creation date ascending order, paged.

Scan API

# POST /v1/holdings/state

OpenAPI

[Added 0.6.0](#history-added-0-6-0)

[Updated 0.7.5](#history-updated-0-7-5)

[Deprecated 0.7.5](#history-deprecated-0-7-5)

[Removed in 0.9.0](#history-removed-0-9-0)

POST

`/v1/holdings/state`

**Removed in 0.9.0.** Historical definition from 0.8.4.

Deprecated. Please use /v2/holdings/state instead. The only difference with this endpoint and that one is the type of the `after`/`next_page_token` pagination token. Returns the active amulet contracts for a given migration id and record time, in creation date ascending order, paged.

## Protocol Details

Operation ID
getHoldingsStateAtV1

Published
0.8.4

## Inputs

### Body

application/json

`migration_id`
integer (int64)

required

The migration id for which to return the ACS.

`record_time`
string (date-time)

required

The timestamp at which the contract set was active. This needs to be an exact timestamp, i.e., needs to correspond to a timestamp reported by `/v0/state/acs/snapshot-timestamp` if `record_time_match` is set to `exact` (which is the default). If `record_time_match` is set to `at_or_before`, this can be any timestamp, and the most recent snapshot at or before the given `record_time` will be returned.

`record_time_match`
string

How to match the record\_time. "exact" requires the record\_time to match exactly. "at\_or\_before" finds the most recent snapshot at or before the given record\_time.

`after`
integer (int64)

Pagination token for the next page of results.

`page_size`
integer (int32)

required

The maximum number of created events returned for this request.

`owner_party_ids`
string\[]

required

Filters by contracts in which these party\_ids are the owners of the amulets.

## Outputs

### 200

application/json

`record_time`
string (date-time)

required

The same `record_time` as in the request.

`migration_id`
integer (int64)

required

The same `migration_id` as in the request.

`created_events`
ActiveContract\[]

required

Up to `page_size` contracts in the ACS. `create_arguments` are always encoded as `compact_json`.

`next_page_token`
integer (int64)

When requesting the next page of results, pass this as `after` to the `AcsRequest` or `HoldingsStateRequest`. Will be absent when there are no more pages.

### 400

application/json

`error`
string

required

### 404

application/json

`error`
string

required

### 500

application/json

`error`
string

required

## History

Removed in
`0.9.0`

Last available in 0.8.4. Retained for historical reference.

Deprecated
`0.7.5`

Updated
`0.7.5`

The POST /v1/holdings/state operation changed in this snapshot.

Added
`0.6.0`

cURL

```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/v1/holdings/state' \
  --header 'Content-Type: application/json' \
  --data '{
  "migration_id": 123,
  "record_time": "2026-01-01T00:00:00Z",
  "record_time_match": "exact",
  "after": 123,
  "page_size": 123,
  "owner_party_ids": [
    "<string>"
  ]
}'
```

Python

```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/v1/holdings/state"
headers = {'Content-Type': 'application/json'}
payload = json.loads(r'''{
  "migration_id": 123,
  "record_time": "2026-01-01T00:00:00Z",
  "record_time_match": "exact",
  "after": 123,
  "page_size": 123,
  "owner_party_ids": [
    "<string>"
  ]
}''')
response = requests.request(
    "POST", url, headers=headers, json=payload
)

print(response.text)
```

JavaScript

```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/v1/holdings/state', {
  method: 'POST',
  headers: {
  "Content-Type": "application/json"
},
  body: JSON.stringify({
  "migration_id": 123,
  "record_time": "2026-01-01T00:00:00Z",
  "record_time_match": "exact",
  "after": 123,
  "page_size": 123,
  "owner_party_ids": [
    "<string>"
  ]
}),
});

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

PHP

```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/v1/holdings/state',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => <<<'JSON'
{
  "migration_id": 123,
  "record_time": "2026-01-01T00:00:00Z",
  "record_time_match": "exact",
  "after": 123,
  "page_size": 123,
  "owner_party_ids": [
    "<string>"
  ]
}
JSON,
    CURLOPT_HTTPHEADER => [
        "Content-Type: application/json"
    ],
]);

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

Go

```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/v1/holdings/state", bytes.NewBufferString(`{
  "migration_id": 123,
  "record_time": "2026-01-01T00:00:00Z",
  "record_time_match": "exact",
  "after": 123,
  "page_size": 123,
  "owner_party_ids": [
    "<string>"
  ]
}`))
  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 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/v1/holdings/state"))
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("""
{
  "migration_id": 123,
  "record_time": "2026-01-01T00:00:00Z",
  "record_time_match": "exact",
  "after": 123,
  "page_size": 123,
  "owner_party_ids": [
    "<string>"
  ]
}
"""))
    .build();
var response = HttpClient.newHttpClient().send(
    request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

Ruby

```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/v1/holdings/state')
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request.body = <<~JSON
{
  "migration_id": 123,
  "record_time": "2026-01-01T00:00:00Z",
  "record_time_match": "exact",
  "after": 123,
  "page_size": 123,
  "owner_party_ids": [
    "<string>"
  ]
}
JSON
response = Net::HTTP.start(uri.hostname, uri.port) do |http|
  http.request(request)
end
puts response.body
```

200

application/json

```json 200 theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "record_time": "2026-01-01T00:00:00Z",
  "migration_id": 123,
  "created_events": [
    {
      "created_in_update_id": "<string>",
      "contract_id": "<string>",
      "template_id": "<string>",
      "package_name": "<string>",
      "create_arguments": {},
      "created_at": "2026-01-01T00:00:00Z",
      "signatories": [
        "<string>"
      ],
      "observers": [
        "<string>"
      ]
    }
  ],
  "next_page_token": 123
}
```

400

application/json

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

404

application/json

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

500

application/json

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