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

> Deprecated. Please use /v2/state/acs instead. The only difference with this endpoint and that one is the type of the `after`/`next_page_token` pagination token. Returns the ACS in creation date ascending order, paged, for a given migration id and record time. Unlike /v0/state/acs, every contract is identified by an (optional) update_id (as opposed to the event ID in /v0/state/acs, which was not BFT-safe).

<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 /v2/state/acs instead. The only difference with this endpoint and that one is the type of the `after`/`next_page_token` pagination token. Returns the ACS in creation date ascending order, paged, for a given migration id and record time. Unlike /v0/state/acs, every contract is identified by an (optional) update\_id (as opposed to the event ID in /v0/state/acs, which was not BFT-safe).</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--removed" href="#history-deprecated-0-7-5">Deprecated 0.7.5</a>

    <a class="x2mdx-ref-badge x2mdx-ref-badge--changed" href="#history-updated-0-7-5">Updated 0.7.5</a>

    <a class="x2mdx-ref-badge x2mdx-ref-badge--added" href="#history-added-0-6-0">Added 0.6.0</a>
  </div>
</div>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://scan.sv-1.global.canton.network.sync.global/api/scan/v1/state/acs' \
    --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,
    "party_ids": [
      "<string>"
    ],
    "templates": [
      "<string>"
    ]
  }'
  ```

  ```python Python theme={null}
  import json
  import requests

  url = "https://scan.sv-1.global.canton.network.sync.global/api/scan/v1/state/acs"
  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,
    "party_ids": [
      "<string>"
    ],
    "templates": [
      "<string>"
    ]
  }''')
  response = requests.request(
      "POST", url, headers=headers, json=payload
  )

  print(response.text)
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://scan.sv-1.global.canton.network.sync.global/api/scan/v1/state/acs', {
    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,
    "party_ids": [
      "<string>"
    ],
    "templates": [
      "<string>"
    ]
  }),
  });

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

  ```php PHP theme={null}
  <?php
  $curl = curl_init();

  curl_setopt_array($curl, [
      CURLOPT_URL => 'https://scan.sv-1.global.canton.network.sync.global/api/scan/v1/state/acs',
      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,
    "party_ids": [
      "<string>"
    ],
    "templates": [
      "<string>"
    ]
  }
  JSON,
      CURLOPT_HTTPHEADER => [
          "Content-Type: application/json"
      ],
  ]);

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

  ```go Go theme={null}
  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/state/acs", bytes.NewBufferString(`{
    "migration_id": 123,
    "record_time": "2026-01-01T00:00:00Z",
    "record_time_match": "exact",
    "after": 123,
    "page_size": 123,
    "party_ids": [
      "<string>"
    ],
    "templates": [
      "<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={null}
  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/state/acs"))
      .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,
    "party_ids": [
      "<string>"
    ],
    "templates": [
      "<string>"
    ]
  }
  """))
      .build();
  var response = HttpClient.newHttpClient().send(
      request, HttpResponse.BodyHandlers.ofString());
  System.out.println(response.body());
  ```

  ```ruby Ruby theme={null}
  require 'net/http'
  require 'uri'

  uri = URI('https://scan.sv-1.global.canton.network.sync.global/api/scan/v1/state/acs')
  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,
    "party_ids": [
      "<string>"
    ],
    "templates": [
      "<string>"
    ]
  }
  JSON
  response = Net::HTTP.start(uri.hostname, uri.port) do |http|
    http.request(request)
  end
  puts response.body
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "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
  }
  ```

  ```json 400 theme={null}
  {
    "error": "<string>"
  }
  ```

  ```json 404 theme={null}
  {
    "error": "<string>"
  }
  ```

  ```json 500 theme={null}
  {
    "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. For this to be valid, this must be the `next_page_token` from a prior request with identical parameters aside from `after` and `page_size`; the response may be invalid otherwise.
</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="party_ids" type="string[]">
  Filters the ACS by contracts in which these party IDs are stakeholders.
</ParamField>

<ParamField body="templates" type="string[]">
  Filters the ACS by contracts with these template IDs, specified as "PACKAGE\_NAME:MODULE\_NAME:ENTITY\_NAME".
</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="ActiveContract[]" required>
  Up to `page_size` contracts in the ACS. `create_arguments` are always encoded as `compact_json`.

  <Expandable title="child attributes">
    <ResponseField name="created_in_update_id" type="string">
      The id of the update in which this contract was created. Optional and will be absent for contracts created in prior migration IDs.
    </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--deprecated" id="history-deprecated-0-7-5">
    <div class="x2mdx-ref-history-event-head">
      <span class="x2mdx-ref-history-event-label">Deprecated</span>
      <code class="x2mdx-ref-history-event-version">0.7.5</code>
    </div>
  </div>

  <div class="x2mdx-ref-history-event x2mdx-ref-history-event--changed" id="history-updated-0-7-5">
    <div class="x2mdx-ref-history-event-head">
      <span class="x2mdx-ref-history-event-label">Updated</span>
      <code class="x2mdx-ref-history-event-version">0.7.5</code>
    </div>

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

  <div class="x2mdx-ref-history-event x2mdx-ref-history-event--introduced" id="history-added-0-6-0">
    <div class="x2mdx-ref-history-event-head">
      <span class="x2mdx-ref-history-event-label">Added</span>
      <code class="x2mdx-ref-history-event-version">0.6.0</code>
    </div>
  </div>
</div>
