> ## 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/updates

> **Deprecated**, use /v2/updates instead. Returns the update history in ascending order, paged, from ledger begin or optionally starting after a record time.

<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**, use /v2/updates instead. Returns the update history in ascending order, paged, from ledger begin or optionally starting after a record time.</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>

    <a class="x2mdx-ref-badge x2mdx-ref-badge--removed" href="#history-deprecated-0-5-10">Deprecated 0.5.10</a>

    <a class="x2mdx-ref-badge x2mdx-ref-badge--added" href="#history-added-0-5-10">Added 0.5.10</a>
  </div>
</div>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://scan.sv-1.global.canton.network.sync.global/api/scan/v0/updates' \
    --header 'Content-Type: application/json' \
    --data '{
    "after": {
      "after_migration_id": 123,
      "after_record_time": "<string>"
    },
    "page_size": 123,
    "lossless": false
  }'
  ```

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

  url = "https://scan.sv-1.global.canton.network.sync.global/api/scan/v0/updates"
  headers = {'Content-Type': 'application/json'}
  payload = json.loads(r'''{
    "after": {
      "after_migration_id": 123,
      "after_record_time": "<string>"
    },
    "page_size": 123,
    "lossless": false
  }''')
  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/v0/updates', {
    method: 'POST',
    headers: {
    "Content-Type": "application/json"
  },
    body: JSON.stringify({
    "after": {
      "after_migration_id": 123,
      "after_record_time": "<string>"
    },
    "page_size": 123,
    "lossless": false
  }),
  });

  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/v0/updates',
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_CUSTOMREQUEST => 'POST',
      CURLOPT_POSTFIELDS => <<<'JSON'
  {
    "after": {
      "after_migration_id": 123,
      "after_record_time": "<string>"
    },
    "page_size": 123,
    "lossless": false
  }
  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/v0/updates", bytes.NewBufferString(`{
    "after": {
      "after_migration_id": 123,
      "after_record_time": "<string>"
    },
    "page_size": 123,
    "lossless": false
  }`))
    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/v0/updates"))
      .header("Content-Type", "application/json")
      .method("POST", HttpRequest.BodyPublishers.ofString("""
  {
    "after": {
      "after_migration_id": 123,
      "after_record_time": "<string>"
    },
    "page_size": 123,
    "lossless": false
  }
  """))
      .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/v0/updates')
  request = Net::HTTP::Post.new(uri)
  request['Content-Type'] = 'application/json'
  request.body = <<~JSON
  {
    "after": {
      "after_migration_id": 123,
      "after_record_time": "<string>"
    },
    "page_size": 123,
    "lossless": false
  }
  JSON
  response = Net::HTTP.start(uri.hostname, uri.port) do |http|
    http.request(request)
  end
  puts response.body
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "transactions": [
      {
        "update_id": "<string>",
        "migration_id": 123,
        "workflow_id": "<string>",
        "record_time": "<string>",
        "synchronizer_id": "<string>",
        "effective_at": "<string>",
        "offset": "<string>",
        "root_event_ids": [
          "<string>"
        ],
        "events_by_id": {},
        "external_transaction_hash": "<string>"
      }
    ]
  }
  ```

  ```json 400 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="after" type="object">
  OpenAPI type: <code>UpdateHistoryRequestAfter</code>.

  The transactions returned will either have a higher migration id or the same migration id and a record\_time greater than the migration id and record time specified.

  <Expandable title="child attributes">
    <ParamField body="after_migration_id" type="number" required>
      OpenAPI type: <code>integer (int64)</code>.

      The migration id from which to start returning transactions. This is inclusive.
    </ParamField>

    <ParamField body="after_record_time" type="string" required>
      The record time to start returning transactions from. This only affects transactions with the same migration id as after\_migration\_id. Higher migration ids are always considered to be later.
    </ParamField>
  </Expandable>
</ParamField>

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

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

<ParamField body="lossless" type="boolean">
  Whether contract payload should be encoded into json using a lossless, but much harder to process, encoding. This is mostly used for backend calls, and is not recommended for external users. Optional and defaults to false.
</ParamField>

## Responses

### 200

ok

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

<ResponseField name="transactions" type="UpdateHistoryItem[]" required>
  <Expandable title="child attributes">
    <ResponseField name="UpdateHistoryTransaction" type="UpdateHistoryTransaction">
      <Expandable title="child attributes">
        <ResponseField name="update_id" type="string" required>
          The id of the update.
        </ResponseField>

        <ResponseField name="migration_id" type="integer (int64)" required>
          The migration id of the synchronizer.
        </ResponseField>

        <ResponseField name="workflow_id" type="string" required>
          This transaction's Daml workflow ID; a workflow ID can be associated with multiple transactions. If empty, no workflow ID was set.
        </ResponseField>

        <ResponseField name="record_time" type="string" required>
          The time at which the transaction was sequenced, with microsecond resolution, using ISO-8601 representation.
        </ResponseField>

        <ResponseField name="synchronizer_id" type="string" required>
          The id of the synchronizer through which this transaction was sequenced.
        </ResponseField>

        <ResponseField name="effective_at" type="string" required>
          Ledger effective time, using ISO-8601 representation. This is the time returned by `getTime` for all Daml executed as part of this transaction, both by the submitting participant and all confirming participants.
        </ResponseField>

        <ResponseField name="offset" type="string" required>
          The absolute offset. Note that this field may not be the same across nodes, and therefore should not be compared between SVs. However, within a single SV's scan, it is monotonically, lexicographically increasing.
        </ResponseField>

        <ResponseField name="root_event_ids" type="string[]" required>
          Roots of the transaction tree. These are guaranteed to occur as keys of the `events_by_id` object.
        </ResponseField>

        <ResponseField name="events_by_id" type="object" required>
          Changes to the ledger that were caused by this transaction, keyed by ID. Values are nodes of the transaction tree. Within a transaction, IDs may be referenced by `root_event_ids` or `child_event_ids` in `ExercisedEvent` herein.
        </ResponseField>

        <ResponseField name="external_transaction_hash" type="string">
          For an externally signed transaction, contains the external transaction hash signed by the external party. Can be used to correlate an external submission with a committed transaction. This field is conditionally omitted from JSON when null (see OmitNullString).
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="UpdateHistoryReassignment" type="UpdateHistoryReassignment">
      A contract reassignment between synchronizer. May be an assignment or unassignment.

      <Expandable title="child attributes">
        <ResponseField name="update_id" type="string" required>
          The id of the update.
        </ResponseField>

        <ResponseField name="offset" type="string" required>
          The absolute offset. Note that this field may not be the same across nodes, and therefore should not be compared between SVs.
        </ResponseField>

        <ResponseField name="record_time" type="string" required>
          The time at which the transaction was sequenced.
        </ResponseField>

        <ResponseField name="event" type="oneOf" required>
          The reassignment event. May be an assignment or unassignment.

          <Expandable title="child attributes">
            <ResponseField name="UpdateHistoryAssignment" type="UpdateHistoryAssignment">
              <Expandable title="child attributes">
                <ResponseField name="submitter" type="string" required>
                  The party ID who submitted this reassignment
                </ResponseField>

                <ResponseField name="source_synchronizer" type="string" required>
                  The id of the synchronizer from which the contract was reassigned
                </ResponseField>

                <ResponseField name="target_synchronizer" type="string" required>
                  The id of the synchronizer to which the contract was reassigned
                </ResponseField>

                <ResponseField name="migration_id" type="integer (int64)" required>
                  The migration id of the target synchronizer
                </ResponseField>

                <ResponseField name="unassign_id" type="string" required>
                  The id of the corresponding unassign event; this assignment will usually, but not always, occur after the so-identified unassignment event.
                </ResponseField>

                <ResponseField name="created_event" type="CreatedEvent" required>
                  The corresponding contract create event

                  <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="reassignment_counter" type="integer (int64)" required>
                  Each corresponding assigned and unassigned event has the same reassignment\_counter. This strictly increases with each unassign command for the same contract. Creation of the contract corresponds to reassignment\_counter 0.
                </ResponseField>
              </Expandable>
            </ResponseField>

            <ResponseField name="UpdateHistoryUnassignment" type="UpdateHistoryUnassignment">
              <Expandable title="child attributes">
                <ResponseField name="submitter" type="string" required>
                  The party who submitted this reassignment
                </ResponseField>

                <ResponseField name="source_synchronizer" type="string" required>
                  The id of the synchronizer from which the contract was reassigned
                </ResponseField>

                <ResponseField name="migration_id" type="integer (int64)" required>
                  The migration id of the synchronizer from which the contract was reassigned
                </ResponseField>

                <ResponseField name="target_synchronizer" type="string" required>
                  The id of the synchronizer to which the contract was reassigned
                </ResponseField>

                <ResponseField name="unassign_id" type="string" required>
                  The id of the unassign event, to later be correlated to an assign event
                </ResponseField>

                <ResponseField name="reassignment_counter" type="integer (int64)" required>
                  Each corresponding assigned and unassigned event has the same reassignment\_counter. This strictly increases with each unassign command for the same contract. Creation of the contract corresponds to reassignment\_counter 0.
                </ResponseField>

                <ResponseField name="contract_id" type="string" required>
                  The id of the unassigned contract
                </ResponseField>
              </Expandable>
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</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 />

### 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/updates operation changed in this snapshot.</p>
  </div>

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

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

  <div class="x2mdx-ref-history-event x2mdx-ref-history-event--deprecated" id="history-deprecated-0-5-10">
    <div class="x2mdx-ref-history-event-head">
      <span class="x2mdx-ref-history-event-label">Deprecated</span>
      <code class="x2mdx-ref-history-event-version">0.5.10</code>
    </div>
  </div>

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