> ## Documentation Index
> Fetch the complete documentation index at: https://cantonfoundation-issue-698-scan-api-single-page.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# /v0/backfilling/import-updates



## OpenAPI

````yaml /openapi/splice/scan/scan.yaml post /v0/backfilling/import-updates
openapi: 3.0.0
info:
  title: Scan API
  version: 0.0.1
servers:
  - url: https://scan.sv-1.global.canton.network.sync.global/api/scan
security: []
tags:
  - name: common
    description: |
      Health and status endpoints available on all nodes.
  - name: external
    description: >
      These endpoints are intended for public usage and will remain
      backward-compatible.
  - name: internal
    description: >
      For internal usage only, not guaranteed to be stable or
      backward-compatible.
  - name: deprecated
    description: |
      These endpoints are deprecated and will be removed in a future release.
  - name: scan
    description: |
      The internal and external endpoints.
  - name: pre-alpha
    description: |
      Still under active development, highly unstable. Do not use in production.
paths:
  /v0/backfilling/import-updates:
    post:
      tags:
        - scan
      summary: /v0/backfilling/import-updates
      operationId: getImportUpdates
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetImportUpdatesRequest'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetImportUpdatesResponse'
        '404':
          $ref: '#/components/responses/404'
components:
  schemas:
    GetImportUpdatesRequest:
      type: object
      required:
        - migration_id
        - after_update_id
        - limit
      properties:
        migration_id:
          type: integer
          format: int64
        after_update_id:
          description: |
            Only return updates with an update id strictly greater than this.
          type: string
        limit:
          description: >
            Return at most this many updates. The actual number of updates
            returned may be smaller.
          type: integer
          format: int32
    GetImportUpdatesResponse:
      type: object
      required:
        - transactions
      properties:
        transactions:
          type: array
          items:
            $ref: '#/components/schemas/UpdateHistoryItem'
    UpdateHistoryItem:
      type: object
      description: >
        An individual item in the update history. May be a transaction or a
        contract reassignment.
      oneOf:
        - $ref: '#/components/schemas/UpdateHistoryTransaction'
        - $ref: '#/components/schemas/UpdateHistoryReassignment'
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
    UpdateHistoryTransaction:
      type: object
      required:
        - update_id
        - migration_id
        - workflow_id
        - record_time
        - synchronizer_id
        - effective_at
        - offset
        - root_event_ids
        - events_by_id
      properties:
        update_id:
          description: |
            The id of the update.
          type: string
        migration_id:
          description: |
            The migration id of the synchronizer.
          type: integer
          format: int64
        workflow_id:
          description: |
            This transaction's Daml workflow ID; a workflow ID can be associated
            with multiple transactions. If empty, no workflow ID was set.
          type: string
        record_time:
          description: |
            The time at which the transaction was sequenced, with microsecond
            resolution, using ISO-8601 representation.
          type: string
        synchronizer_id:
          description: >
            The id of the synchronizer through which this transaction was
            sequenced.
          type: string
        effective_at:
          description: >
            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.
          type: string
        offset:
          description: >
            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.
          type: string
        root_event_ids:
          description: |
            Roots of the transaction tree. These are guaranteed to occur as keys
            of the `events_by_id` object.
          type: array
          items:
            type: string
        events_by_id:
          description: >
            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.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/TreeEvent'
        external_transaction_hash:
          description: >
            For transaction externally signed, contains the external transaction
            hash

            signed by the external party. Can be used to correlate an external
            submission with a committed transaction.
          type: string
    UpdateHistoryReassignment:
      type: object
      description: >-
        A contract reassignment between synchronizer. May be an assignment or
        unassignment.
      required:
        - update_id
        - offset
        - record_time
        - event
      properties:
        update_id:
          description: |
            The id of the update.
          type: string
        offset:
          description: >
            The absolute offset.

            Note that this field may not be the same across nodes, and therefore
            should not be compared between SVs.
          type: string
        record_time:
          description: |
            The time at which the transaction was sequenced.
          type: string
        event:
          description: |
            The reassignment event. May be an assignment or unassignment.
          type: object
          oneOf:
            - $ref: '#/components/schemas/UpdateHistoryAssignment'
            - $ref: '#/components/schemas/UpdateHistoryUnassignment'
    TreeEvent:
      type: object
      description: |
        Either a creation or an exercise of a contract.
      oneOf:
        - $ref: '#/components/schemas/CreatedEvent'
        - $ref: '#/components/schemas/ExercisedEvent'
      discriminator:
        propertyName: event_type
        mapping:
          created_event:
            $ref: '#/components/schemas/CreatedEvent'
          exercised_event:
            $ref: '#/components/schemas/ExercisedEvent'
    UpdateHistoryAssignment:
      type: object
      required:
        - submitter
        - source_synchronizer
        - target_synchronizer
        - migration_id
        - unassign_id
        - created_event
        - reassignment_counter
      properties:
        submitter:
          description: |
            The party ID who submitted this reassignment
          type: string
        source_synchronizer:
          description: |
            The id of the synchronizer from which the contract was reassigned
          type: string
        target_synchronizer:
          description: |
            The id of the synchronizer to which the contract was reassigned
          type: string
        migration_id:
          description: |
            The migration id of the target synchronizer
          type: integer
          format: int64
        unassign_id:
          description: |
            The id of the corresponding unassign event; this assignment will
            usually, but not always, occur after the so-identified unassignment
            event.
          type: string
        created_event:
          $ref: '#/components/schemas/CreatedEvent'
          description: |
            The corresponding contract create event
        reassignment_counter:
          description: >-
            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.
          type: integer
          format: int64
    UpdateHistoryUnassignment:
      type: object
      required:
        - submitter
        - source_synchronizer
        - migration_id
        - target_synchronizer
        - unassign_id
        - reassignment_counter
        - contract_id
      properties:
        submitter:
          description: |
            The party who submitted this reassignment
          type: string
        source_synchronizer:
          description: |
            The id of the synchronizer from which the contract was reassigned
          type: string
        migration_id:
          description: >
            The migration id of the synchronizer from which the contract was
            reassigned
          type: integer
          format: int64
        target_synchronizer:
          description: |
            The id of the synchronizer to which the contract was reassigned
          type: string
        unassign_id:
          description: >
            The id of the unassign event, to later be correlated to an assign
            event
          type: string
        reassignment_counter:
          description: >-
            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.
          type: integer
          format: int64
        contract_id:
          description: |
            The id of the unassigned contract
          type: string
    CreatedEvent:
      type: object
      required:
        - event_type
        - event_id
        - contract_id
        - template_id
        - package_name
        - create_arguments
        - created_at
        - signatories
        - observers
      properties:
        event_type:
          type: string
        event_id:
          description: |
            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`.
          type: string
        contract_id:
          description: |
            The ID of the created contract.
          type: string
        template_id:
          description: |
            The template of the created contract.
          type: string
        package_name:
          description: |
            The package name of the created contract.
          type: string
        create_arguments:
          description: |
            The arguments that have been used to create the contract, in the
            form of JSON representation of a Daml record.
          type: object
        created_at:
          description: |
            Ledger effective time of the transaction that created the contract.
          type: string
          format: date-time
        signatories:
          description: |
            Signatories to the contract, in the form of party IDs.
          type: array
          items:
            type: string
        observers:
          description: |
            Observers to the contract, in the form of party IDs.
          type: array
          items:
            type: string
    ExercisedEvent:
      type: object
      required:
        - event_type
        - event_id
        - contract_id
        - template_id
        - package_name
        - choice
        - choice_argument
        - child_event_ids
        - exercise_result
        - consuming
        - acting_parties
      properties:
        event_type:
          type: string
        event_id:
          description: |
            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`.
          type: string
        contract_id:
          description: |
            The ID of the created contract.
          type: string
        template_id:
          description: |
            The template of the created contract.
          type: string
        package_name:
          description: |
            The package name of the created contract.
          type: string
        choice:
          description: >
            The choice that was exercised on the target contract, as an
            unqualified

            choice name, i.e. with no package or module name qualifiers.
          type: string
        choice_argument:
          description: >
            The argument of the exercised choice, in the form of JSON

            representation of a Daml value. This is usually a record with field

            names being the argument names, even in the case of a single
            apparent

            choice argument, which is represented as a single-element Daml
            record.
          type: object
        child_event_ids:
          description: >
            References to further events in the same transaction that appeared
            as a result of this ExercisedEvent.

            It contains only the immediate children of this event, not all
            members of the subtree rooted at this node.

            The order of the children is the same as the event order in the
            transaction.
          type: array
          items:
            type: string
        exercise_result:
          description: |
            The result of exercising the choice, as the JSON representation of a
            Daml value.
          type: object
        consuming:
          description: |
            If true, the target contract may no longer be exercised.
          type: boolean
        acting_parties:
          description: |
            The parties that exercised the choice, in the form of party IDs.
          type: array
          items:
            type: string
        interface_id:
          description: |
            The interface where the choice is defined, if inherited.
          type: string
  responses:
    '404':
      description: not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'

````