> ## 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/package-vetting/list

> Lists which participant node vetted what packages on which synchronizer. Can be called by any authenticated user.

Lists which participant node vetted what packages on which synchronizer. Can be called by any authenticated user.

OpenAPI

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

```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl --request POST \
  --url 'http://localhost:7575/v2/package-vetting/list' \
  --header 'Authorization: Bearer $TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
  "packageMetadataFilter": {
    "packageIds": [
      "<string>"
    ],
    "packageNamePrefixes": [
      "<string>"
    ]
  },
  "topologyStateFilter": {
    "participantIds": [
      "<string>"
    ],
    "synchronizerIds": [
      "<string>"
    ]
  },
  "pageToken": "<string>",
  "pageSize": 123
}'
```

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

url = "http://localhost:7575/v2/package-vetting/list"
headers = {'Authorization': 'Bearer <token>', 'Content-Type': 'application/json'}
payload = json.loads(r'''{
  "packageMetadataFilter": {
    "packageIds": [
      "<string>"
    ],
    "packageNamePrefixes": [
      "<string>"
    ]
  },
  "topologyStateFilter": {
    "participantIds": [
      "<string>"
    ],
    "synchronizerIds": [
      "<string>"
    ]
  },
  "pageToken": "<string>",
  "pageSize": 123
}''')
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('http://localhost:7575/v2/package-vetting/list', {
  method: 'POST',
  headers: {
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
},
  body: JSON.stringify({
  "packageMetadataFilter": {
    "packageIds": [
      "<string>"
    ],
    "packageNamePrefixes": [
      "<string>"
    ]
  },
  "topologyStateFilter": {
    "participantIds": [
      "<string>"
    ],
    "synchronizerIds": [
      "<string>"
    ]
  },
  "pageToken": "<string>",
  "pageSize": 123
}),
});

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 => 'http://localhost:7575/v2/package-vetting/list',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => <<<'JSON'
{
  "packageMetadataFilter": {
    "packageIds": [
      "<string>"
    ],
    "packageNamePrefixes": [
      "<string>"
    ]
  },
  "topologyStateFilter": {
    "participantIds": [
      "<string>"
    ],
    "synchronizerIds": [
      "<string>"
    ]
  },
  "pageToken": "<string>",
  "pageSize": 123
}
JSON,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer <token>",
        "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", "http://localhost:7575/v2/package-vetting/list", bytes.NewBufferString(`{
  "packageMetadataFilter": {
    "packageIds": [
      "<string>"
    ],
    "packageNamePrefixes": [
      "<string>"
    ]
  },
  "topologyStateFilter": {
    "participantIds": [
      "<string>"
    ],
    "synchronizerIds": [
      "<string>"
    ]
  },
  "pageToken": "<string>",
  "pageSize": 123
}`))
  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 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/package-vetting/list"))
    .header("Authorization", "Bearer <token>")
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("""
{
  "packageMetadataFilter": {
    "packageIds": [
      "<string>"
    ],
    "packageNamePrefixes": [
      "<string>"
    ]
  },
  "topologyStateFilter": {
    "participantIds": [
      "<string>"
    ],
    "synchronizerIds": [
      "<string>"
    ]
  },
  "pageToken": "<string>",
  "pageSize": 123
}
"""))
    .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('http://localhost:7575/v2/package-vetting/list')
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer <token>'
request['Content-Type'] = 'application/json'
request.body = <<~JSON
{
  "packageMetadataFilter": {
    "packageIds": [
      "<string>"
    ],
    "packageNamePrefixes": [
      "<string>"
    ]
  },
  "topologyStateFilter": {
    "participantIds": [
      "<string>"
    ],
    "synchronizerIds": [
      "<string>"
    ]
  },
  "pageToken": "<string>",
  "pageSize": 123
}
JSON
response = Net::HTTP.start(uri.hostname, uri.port) do |http|
  http.request(request)
end
puts response.body
```

```json 200 theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "vettedPackages": [
    {
      "packages": [
        {
          "packageId": "<string>",
          "validFromInclusive": "<string>",
          "validUntilExclusive": "<string>",
          "packageName": "<string>",
          "packageVersion": "<string>"
        }
      ],
      "participantId": "<string>",
      "synchronizerId": "<string>",
      "topologySerial": 123
    }
  ],
  "nextPageToken": "<string>"
}
```

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

```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
}
```

## Authorizations

### httpAuth

**Authorization** `string` *required*

HTTP bearer authentication. Send the token as `Authorization: Bearer &lt;token&gt;`. Ledger API standard JWT token

### apiKeyAuth

**Sec-WebSocket-Protocol** `string` *required*

API key authentication in the header. Ledger API standard JWT token (websocket)

## Body

application/json

**packageMetadataFilter** `object`

OpenAPI type: `PackageMetadataFilter`.

Filter the VettedPackages by package metadata. A PackageMetadataFilter without package\_ids and without package\_name\_prefixes matches any vetted package. Non-empty fields specify candidate values of which at least one must match. If both fields are set, then a candidate is returned if it matches one of the fields.

**child attributes**

**packageIds** `string[]`

If this list is non-empty, any vetted package with a package ID in this list will match the filter. Optional: can be empty

**packageNamePrefixes** `string[]`

If this list is non-empty, any vetted package with a name matching at least one prefix in this list will match the filter. Optional: can be empty

**topologyStateFilter** `object`

OpenAPI type: `TopologyStateFilter`.

Filter the vetted packages by the participant and synchronizer that they are hosted on. Empty fields are ignored, such that a `TopologyStateFilter` without participant\_ids and without synchronizer\_ids matches a vetted package hosted on any participant and synchronizer. Non-empty fields specify candidate values of which at least one must match. If both fields are set then at least one candidate value must match from each field.

**child attributes**

**participantIds** `string[]`

If this list is non-empty, only vetted packages hosted on participants listed in this field match the filter. Query the current Ledger API's participant's ID via the public `GetParticipantId` command in `PartyManagementService`. Optional: can be empty

**synchronizerIds** `string[]`

If this list is non-empty, only vetted packages from the topology state of the synchronizers in this list match the filter. Optional: can be empty

**pageToken** `string`

Pagination token to determine the specific page to fetch. Using the token guarantees that `VettedPackages` on a subsequent page are all greater (`VettedPackages` are sorted by synchronizer ID then participant ID) than the last `VettedPackages` on a previous page. The server does not store intermediate results between calls chained by a series of page tokens. As a consequence, if new vetted packages are being added and a page is requested twice using the same token, more packages can be returned on the second call. Leave unspecified (i.e. as empty string) to fetch the first page. Optional

**pageSize** `number`

OpenAPI type: `integer (int32)`.

Maximum number of `VettedPackages` results to return in a single page. If the page\_size is unspecified (i.e. left as 0), the server will decide the number of results to be returned. If the page\_size exceeds the maximum supported by the server, an error will be returned. To obtain the server's maximum consult the PackageService descriptor available in the VersionService. Optional

## Responses

### 200

application/json

**vettedPackages** `VettedPackages[]`

All `VettedPackages` that contain at least one `VettedPackage` matching both a `PackageMetadataFilter` and a `TopologyStateFilter`. Sorted by synchronizer\_id then participant\_id. Optional: can be empty

**child attributes**

**packages** `VettedPackage[]` *required*

Sorted by package\_name and package\_version where known, and package\_id as a last resort. Required: must be non-empty

**child attributes**

**packageId** `string` *required*

Package ID of this package Required

**validFromInclusive** `string`

The time from which this package is vetted. Empty if vetting time has no lower bound. Optional

**validUntilExclusive** `string`

The time until which this package is vetted. Empty if vetting time has no upper bound. Optional

**packageName** `string`

Name of this package. Only available if the package has been uploaded to the current participant. Optional

**packageVersion** `string`

Version of this package. Only available if the package has been uploaded to the current participant. Optional

**participantId** `string` *required*

Participant on which these packages are vetted. Required

**synchronizerId** `string` *required*

Synchronizer on which these packages are vetted. Required

**topologySerial** `integer (int32)` *required*

Serial of last `VettedPackages` topology transaction of this participant and on this synchronizer. Required

**nextPageToken** `string`

Pagination token to retrieve the next page. Empty string once there are no further results. `PackageMetadataFilter` is applied after `TopologyStateFilter` has already produced a page, so that page can end up empty even when it has a next token. Keep following the token until there's no token left. Optional

### 400

Invalid value, Invalid value for: body

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

Updated
`3.6`

The POST /v2/package-vetting/list operation changed in this snapshot.

Updated
`3.5`

The POST /v2/package-vetting/list operation changed in this snapshot.
