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

> Query flat transactions update list (blocking call). Notice: This endpoint should be used for small results set. When number of results exceeded node configuration limit (`http-list-max-elements-limit`) there will be an error (`413 Content Too Large`) returned. Increasing this limit may lead to performance issues and high memory consumption. Consider using websockets (asyncapi) for better efficiency with larger results.

JSON Ledger API

# POST /v2/updates/flats

OpenAPI

[Updated 3.6](#history-updated-3-6)

[Deprecated 3.4](#history-deprecated-3-4)

[Removed in 3.7](#history-removed-3-7)

POST

`/v2/updates/flats`

**Removed in 3.7.** Historical definition from 3.6.

Query flat transactions update list (blocking call). Notice: This endpoint should be used for small results set. When number of results exceeded node configuration limit (`http-list-max-elements-limit`) there will be an error (`413 Content Too Large`) returned. Increasing this limit may lead to performance issues and high memory consumption. Consider using websockets (asyncapi) for better efficiency with larger results.

## Protocol Details

Operation ID
postV2UpdatesFlats

Authentication
Bearer token

Published
3.6

## Inputs

### Query parameters

`limit`
integer (int64)

maximum number of elements to return, this param is ignored if is bigger than server setting

`stream_idle_timeout_ms`
integer (int64)

timeout to complete and send result if no new elements are received (for open ended streams)

### Body

application/json

`beginExclusive`
integer (int64)

required

Exclusive lower bound offset of the requested ledger section (non-negative integer). The response will only contain transactions whose offset is strictly greater than this. If set to zero, the lower bound is set to the beginning of the ledger. If the participant has been pruned, this parameter must be greater or equal than the pruning offset. Required

`endInclusive`
integer (int64)

Inclusive higher bound offset of the requested ledger section. If specified the response will only contain transactions whose offset is less than or equal to this. If not specified, - the descending\_order must not be selected, - the stream will not terminate. Optional

`filter`
TransactionFilter

Deprecated: disabled unless `canton.participants.&lt;participant&gt;.features.deprecated.enable-deprecated-parameters-34 = true`; it will be removed in the Canton version 3.7.0. Used both for filtering create and archive events as well as for filtering transaction trees.

`verbose`
boolean

Deprecated: disabled unless `canton.participants.&lt;participant&gt;.features.deprecated.enable-deprecated-parameters-34 = true`; it will be removed in the Canton version 3.7.0. If enabled, values served over the API will contain more information than strictly necessary to interpret the data. In particular, setting the verbose flag to true triggers the ledger to include labels, record and variant type ids for record fields. Optional for backwards compatibility, if defined update\_format must be unset

`updateFormat`
UpdateFormat

A format specifying what updates to include and how to render them.

`descendingOrder`
boolean

If set, the stream will populate the elements in descending order. Optional

## Outputs

### 200

application/json

`value`
JsGetUpdatesResponse\[]

required

### 400

text/plain

`value`
string

required

### default

application/json

`code`
string

required

`cause`
string

required

`correlationId`
string

`traceId`
string

`context`
Map\_String

required

`resources`
Tuple2\_String\_String\[]

`errorCategory`
integer (int32)

required

`grpcCodeValue`
integer (int32)

`retryInfo`
string

`definiteAnswer`
boolean

## History

Removed in
`3.7`

Last available in 3.6. Retained for historical reference.

Updated
`3.6`

The POST /v2/updates/flats operation changed in this snapshot.

Updated
`3.5`

The POST /v2/updates/flats operation changed in this snapshot.

Deprecated
`3.4`

cURL

```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl --request POST \
  --url 'http://localhost:7575/v2/updates/flats' \
  --header 'Authorization: Bearer $TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
  "beginExclusive": 123,
  "endInclusive": 123,
  "filter": {
    "filtersByParty": {},
    "filtersForAnyParty": {
      "cumulative": [
        {
          "identifierFilter": {
            "Empty": "<object>"
          }
        }
      ]
    }
  },
  "verbose": false,
  "updateFormat": {
    "includeTransactions": {
      "eventFormat": {
        "filtersByParty": {},
        "filtersForAnyParty": {
          "cumulative": [
            "<object>"
          ]
        },
        "verbose": false
      },
      "transactionShape": "TRANSACTION_SHAPE_UNSPECIFIED"
    },
    "includeReassignments": {
      "filtersByParty": {},
      "filtersForAnyParty": {
        "cumulative": [
          {
            "identifierFilter": "<object>"
          }
        ]
      },
      "verbose": false
    },
    "includeTopologyEvents": {
      "includeParticipantAuthorizationEvents": {
        "parties": [
          "<string>"
        ]
      }
    }
  },
  "descendingOrder": false
}'
```

Python

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
import json
import requests

url = "http://localhost:7575/v2/updates/flats"
headers = {'Authorization': 'Bearer <token>', 'Content-Type': 'application/json'}
payload = json.loads(r'''{
  "beginExclusive": 123,
  "endInclusive": 123,
  "filter": {
    "filtersByParty": {},
    "filtersForAnyParty": {
      "cumulative": [
        {
          "identifierFilter": {
            "Empty": "<object>"
          }
        }
      ]
    }
  },
  "verbose": false,
  "updateFormat": {
    "includeTransactions": {
      "eventFormat": {
        "filtersByParty": {},
        "filtersForAnyParty": {
          "cumulative": [
            "<object>"
          ]
        },
        "verbose": false
      },
      "transactionShape": "TRANSACTION_SHAPE_UNSPECIFIED"
    },
    "includeReassignments": {
      "filtersByParty": {},
      "filtersForAnyParty": {
        "cumulative": [
          {
            "identifierFilter": "<object>"
          }
        ]
      },
      "verbose": false
    },
    "includeTopologyEvents": {
      "includeParticipantAuthorizationEvents": {
        "parties": [
          "<string>"
        ]
      }
    }
  },
  "descendingOrder": false
}''')
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('http://localhost:7575/v2/updates/flats', {
  method: 'POST',
  headers: {
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
},
  body: JSON.stringify({
  "beginExclusive": 123,
  "endInclusive": 123,
  "filter": {
    "filtersByParty": {},
    "filtersForAnyParty": {
      "cumulative": [
        {
          "identifierFilter": {
            "Empty": "<object>"
          }
        }
      ]
    }
  },
  "verbose": false,
  "updateFormat": {
    "includeTransactions": {
      "eventFormat": {
        "filtersByParty": {},
        "filtersForAnyParty": {
          "cumulative": [
            "<object>"
          ]
        },
        "verbose": false
      },
      "transactionShape": "TRANSACTION_SHAPE_UNSPECIFIED"
    },
    "includeReassignments": {
      "filtersByParty": {},
      "filtersForAnyParty": {
        "cumulative": [
          {
            "identifierFilter": "<object>"
          }
        ]
      },
      "verbose": false
    },
    "includeTopologyEvents": {
      "includeParticipantAuthorizationEvents": {
        "parties": [
          "<string>"
        ]
      }
    }
  },
  "descendingOrder": false
}),
});

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 => 'http://localhost:7575/v2/updates/flats',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => <<<'JSON'
{
  "beginExclusive": 123,
  "endInclusive": 123,
  "filter": {
    "filtersByParty": {},
    "filtersForAnyParty": {
      "cumulative": [
        {
          "identifierFilter": {
            "Empty": "<object>"
          }
        }
      ]
    }
  },
  "verbose": false,
  "updateFormat": {
    "includeTransactions": {
      "eventFormat": {
        "filtersByParty": {},
        "filtersForAnyParty": {
          "cumulative": [
            "<object>"
          ]
        },
        "verbose": false
      },
      "transactionShape": "TRANSACTION_SHAPE_UNSPECIFIED"
    },
    "includeReassignments": {
      "filtersByParty": {},
      "filtersForAnyParty": {
        "cumulative": [
          {
            "identifierFilter": "<object>"
          }
        ]
      },
      "verbose": false
    },
    "includeTopologyEvents": {
      "includeParticipantAuthorizationEvents": {
        "parties": [
          "<string>"
        ]
      }
    }
  },
  "descendingOrder": false
}
JSON,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer <token>",
        "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", "http://localhost:7575/v2/updates/flats", bytes.NewBufferString(`{
  "beginExclusive": 123,
  "endInclusive": 123,
  "filter": {
    "filtersByParty": {},
    "filtersForAnyParty": {
      "cumulative": [
        {
          "identifierFilter": {
            "Empty": "<object>"
          }
        }
      ]
    }
  },
  "verbose": false,
  "updateFormat": {
    "includeTransactions": {
      "eventFormat": {
        "filtersByParty": {},
        "filtersForAnyParty": {
          "cumulative": [
            "<object>"
          ]
        },
        "verbose": false
      },
      "transactionShape": "TRANSACTION_SHAPE_UNSPECIFIED"
    },
    "includeReassignments": {
      "filtersByParty": {},
      "filtersForAnyParty": {
        "cumulative": [
          {
            "identifierFilter": "<object>"
          }
        ]
      },
      "verbose": false
    },
    "includeTopologyEvents": {
      "includeParticipantAuthorizationEvents": {
        "parties": [
          "<string>"
        ]
      }
    }
  },
  "descendingOrder": false
}`))
  req.Header.Set("Authorization", "Bearer <token>")
  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("http://localhost:7575/v2/updates/flats"))
    .header("Authorization", "Bearer <token>")
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("""
{
  "beginExclusive": 123,
  "endInclusive": 123,
  "filter": {
    "filtersByParty": {},
    "filtersForAnyParty": {
      "cumulative": [
        {
          "identifierFilter": {
            "Empty": "<object>"
          }
        }
      ]
    }
  },
  "verbose": false,
  "updateFormat": {
    "includeTransactions": {
      "eventFormat": {
        "filtersByParty": {},
        "filtersForAnyParty": {
          "cumulative": [
            "<object>"
          ]
        },
        "verbose": false
      },
      "transactionShape": "TRANSACTION_SHAPE_UNSPECIFIED"
    },
    "includeReassignments": {
      "filtersByParty": {},
      "filtersForAnyParty": {
        "cumulative": [
          {
            "identifierFilter": "<object>"
          }
        ]
      },
      "verbose": false
    },
    "includeTopologyEvents": {
      "includeParticipantAuthorizationEvents": {
        "parties": [
          "<string>"
        ]
      }
    }
  },
  "descendingOrder": false
}
"""))
    .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('http://localhost:7575/v2/updates/flats')
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer <token>'
request['Content-Type'] = 'application/json'
request.body = <<~JSON
{
  "beginExclusive": 123,
  "endInclusive": 123,
  "filter": {
    "filtersByParty": {},
    "filtersForAnyParty": {
      "cumulative": [
        {
          "identifierFilter": {
            "Empty": "<object>"
          }
        }
      ]
    }
  },
  "verbose": false,
  "updateFormat": {
    "includeTransactions": {
      "eventFormat": {
        "filtersByParty": {},
        "filtersForAnyParty": {
          "cumulative": [
            "<object>"
          ]
        },
        "verbose": false
      },
      "transactionShape": "TRANSACTION_SHAPE_UNSPECIFIED"
    },
    "includeReassignments": {
      "filtersByParty": {},
      "filtersForAnyParty": {
        "cumulative": [
          {
            "identifierFilter": "<object>"
          }
        ]
      },
      "verbose": false
    },
    "includeTopologyEvents": {
      "includeParticipantAuthorizationEvents": {
        "parties": [
          "<string>"
        ]
      }
    }
  },
  "descendingOrder": false
}
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"}}
[
  {
    "update": {
      "OffsetCheckpoint": {
        "value": {
          "offset": 123,
          "synchronizerTimes": [
            "<object>"
          ]
        }
      }
    }
  }
]
```

400

text/plain

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

default

application/json

```json default theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "code": "<string>",
  "cause": "<string>",
  "correlationId": "<string>",
  "traceId": "<string>",
  "context": {},
  "resources": [
    [
      "<string>"
    ]
  ],
  "errorCategory": 123,
  "grpcCodeValue": 123,
  "retryInfo": "<string>",
  "definiteAnswer": false
}
```
