> ## Documentation Index
> Fetch the complete documentation index at: https://cantonfoundation-generated-reference-full-stack-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# POST /v0/holdings/state

> Deprecated. Please use /v1/holdings/state instead. Returns the active amulet contracts for a given migration id and record time, in creation date ascending order, paged.

<div class="x2mdx-ref-page x2mdx-ref-page--operation x2mdx-ref-page--manual-api" />

<div class="x2mdx-ref-hero">
  <p class="x2mdx-ref-summary">Deprecated. Please use /v1/holdings/state instead. Returns the active amulet contracts for a given migration id and record time, in creation date ascending order, paged.</p>

  <div class="x2mdx-ref-badges">
    <span class="x2mdx-ref-badge x2mdx-ref-badge--protocol">OpenAPI</span>

    <a class="x2mdx-ref-badge x2mdx-ref-badge--changed" href="#history-updated-0-6-0">Updated 0.6.0</a>
  </div>
</div>

<RequestExample>
  ```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/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 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/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 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  const response = await fetch('https://scan.sv-1.global.canton.network.sync.global/api/scan/v0/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 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/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 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/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 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/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 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/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
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "record_time": "2026-01-01T00:00:00Z",
    "migration_id": 123,
    "created_events": [
      {
        "event_type": "<string>",
        "event_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
  }
  ```

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

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

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

## Body

<div class="x2mdx-ref-badges">
  <span class="x2mdx-ref-badge x2mdx-ref-badge--neutral">application/json</span>
</div>

<ParamField body="migration_id" type="number" required>
  OpenAPI type: <code>integer (int64)</code>.

  The migration id for which to return the ACS.
</ParamField>

<ParamField body="record_time" type="string" required>
  OpenAPI type: <code>string (date-time)</code>.

  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.
</ParamField>

<ParamField body="record_time_match" type="string" default="exact">
  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.

  Allowed values: <code>exact</code>, <code>at\_or\_before</code>.
</ParamField>

<ParamField body="after" type="number">
  OpenAPI type: <code>integer (int64)</code>.

  Pagination token for the next page of results.
</ParamField>

<ParamField body="page_size" type="number" required>
  OpenAPI type: <code>integer (int32)</code>.

  The maximum number of created events returned for this request.
</ParamField>

<ParamField body="owner_party_ids" type="string[]" required>
  Filters by contracts in which these party\_ids are the owners of the amulets.

  Minimum items: 1.
</ParamField>

## Responses

### 200

ok

<div class="x2mdx-ref-badges">
  <span class="x2mdx-ref-badge x2mdx-ref-badge--neutral">application/json</span>
</div>

<ResponseField name="record_time" type="string (date-time)" required>
  The same `record_time` as in the request.
</ResponseField>

<ResponseField name="migration_id" type="integer (int64)" required>
  The same `migration_id` as in the request.
</ResponseField>

<ResponseField name="created_events" type="CreatedEvent[]" required>
  Up to `page_size` contracts in the ACS. `create_arguments` are always encoded as `compact_json`.

  <Expandable title="child attributes">
    <ResponseField name="event_type" type="string" required />

    <ResponseField name="event_id" type="string" required>
      The ID of this particular event. Equal to the key of this element of the containing `events_by_id` if this is part of a `TreeEvent`.
    </ResponseField>

    <ResponseField name="contract_id" type="string" required>
      The ID of the created contract.
    </ResponseField>

    <ResponseField name="template_id" type="string" required>
      The template of the created contract.
    </ResponseField>

    <ResponseField name="package_name" type="string" required>
      The package name of the created contract.
    </ResponseField>

    <ResponseField name="create_arguments" type="object" required>
      The arguments that have been used to create the contract, in the form of JSON representation of a Daml record.
    </ResponseField>

    <ResponseField name="created_at" type="string (date-time)" required>
      Ledger effective time of the transaction that created the contract.
    </ResponseField>

    <ResponseField name="signatories" type="string[]" required>
      Signatories to the contract, in the form of party IDs.
    </ResponseField>

    <ResponseField name="observers" type="string[]" required>
      Observers to the contract, in the form of party IDs.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="next_page_token" type="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.
</ResponseField>

### 400

bad request

<div class="x2mdx-ref-badges">
  <span class="x2mdx-ref-badge x2mdx-ref-badge--neutral">application/json</span>
</div>

<ResponseField name="error" type="string" required />

### 404

not found

<div class="x2mdx-ref-badges">
  <span class="x2mdx-ref-badge x2mdx-ref-badge--neutral">application/json</span>
</div>

<ResponseField name="error" type="string" required />

### 500

internal server error

<div class="x2mdx-ref-badges">
  <span class="x2mdx-ref-badge x2mdx-ref-badge--neutral">application/json</span>
</div>

<ResponseField name="error" type="string" required />

## History

<div class="x2mdx-ref-history" aria-label="Reference history">
  <div class="x2mdx-ref-history-event x2mdx-ref-history-event--changed" id="history-updated-0-6-0">
    <div class="x2mdx-ref-history-event-head">
      <span class="x2mdx-ref-history-event-label">Updated</span>
      <code class="x2mdx-ref-history-event-version">0.6.0</code>
    </div>

    <p class="x2mdx-ref-history-event-detail">The POST /v0/holdings/state operation changed in this snapshot.</p>
  </div>
</div>
