> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.staple.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.staple.ai/_mcp/server.

# List Document Sets

GET https://api.staple.io/reconciliation/v1/linking-sets/{uuid}/document-sets

Lists the document sets produced by one linking set. A document set is one anchor document (usually the invoice) together with the documents linked to it and the current reconciliation outcome.

This is an index, not the card grid: each item carries the anchor, `state`, `overall_status`, `exception_count`, and labels. `facets` gives the counts behind the status tabs. Use `document_set_id` with the export endpoint to pull the full result.

Requires reconciliation v2 on the organisation; other tenants receive `404`.

Reference: https://docs.staple.ai/api-reference/v2/reconciliation/list-document-sets

## Authentication

- `x-api-key` header (required) — API key issued by Staple.
- `Authorization` header (bearer token, required) — JWT obtained from the login endpoint.

## Request

### Path parameters

- `uuid` (string, required) — Linking set UUID, as returned by List Linking Sets.

### Query parameters

- `state` (enum, optional) — Filter by document set state. Omit to return both.
  - Allowed values: `OPEN`, `CLOSED`
- `status` (list of enum, optional) — Filter by overall status. Repeat the parameter or pass a comma-separated list to select several, for example `status=RECONCILED&status=NOT_FOUND`.
  - Allowed values: `RECONCILED`, `NOT_RECONCILED`, `NOT_FOUND`, `ERROR`
- `anchor_doc_id` (list of integer, optional) — Return only the document sets whose anchor (primary) document is one of these document IDs. Repeat the parameter or pass a comma-separated list, for example `anchor_doc_id=101&anchor_doc_id=102` or `anchor_doc_id=101,102`, up to 200 IDs. It matches the anchor only, never a document that is just linked into a set, so one uploaded document gives at most one document set per linking set. An empty `items` means the document has not been reconciled in this linking set yet. A value that is not a positive integer returns `400`. Use it to open the reconcile details screen for a document you uploaded: `/linking-sets/{uuid}/document-sets/{document_set_id}`, with `document_set_id` URL-encoded.
- `limit` (integer, optional, default: 50) — Page size. Defaults to 50 and is capped at 200.
- `offset` (integer, optional, default: 0) — Number of records to skip for pagination.

## Response

### 200

OK

## Examples

**Response**

```json
{
  "facets": {
    "all_open": 1,
    "closed": 0,
    "not_reconciled": 0,
    "reconciled": 1
  },
  "items": [
    {
      "anchor": {
        "doc_id": 500,
        "file_name": "invoice-500.pdf",
        "group_name": "Invoice",
        "group_uuid": "a1111111-0000-4000-8000-000000000001",
        "identifier": "INV-500"
      },
      "document_set_id": "ds:7c2a1b90-4d3e-4f81-9a0c-11b2c3d4e5f6:500",
      "exception_count": 0,
      "labels": [
        {
          "color": "#E4572E",
          "count": 1,
          "name": "Price mismatch"
        }
      ],
      "last_reconciled_at": "2026-01-10T09:00:04Z",
      "overall_status": "RECONCILED",
      "state": "OPEN"
    }
  ],
  "limit": 50,
  "linking_set": {
    "created_at": "2026-08-01T10:00:00Z",
    "name": "Invoice 3-way match",
    "status": "active",
    "updated_at": "2026-08-02T11:00:00Z",
    "uuid": "7c2a1b90-4d3e-4f81-9a0c-11b2c3d4e5f6",
    "version": "2026-01-14"
  },
  "offset": 0,
  "total_count": 1
}
```

**SDK Code**

```python List Document Sets
import requests

url = "https://api.staple.io/reconciliation/v1/linking-sets/7c2a1b90-4d3e-4f81-9a0c-11b2c3d4e5f6/document-sets"

querystring = {"anchor_doc_id":"[101]","limit":"50","offset":"0","state":"OPEN","status":"[\"RECONCILED\"]"}

headers = {"x-api-key": "<apiKey>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript List Document Sets
const url = 'https://api.staple.io/reconciliation/v1/linking-sets/7c2a1b90-4d3e-4f81-9a0c-11b2c3d4e5f6/document-sets?anchor_doc_id=%5B101%5D&limit=50&offset=0&state=OPEN&status=%5B%22RECONCILED%22%5D';
const options = {method: 'GET', headers: {'x-api-key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go List Document Sets
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.staple.io/reconciliation/v1/linking-sets/7c2a1b90-4d3e-4f81-9a0c-11b2c3d4e5f6/document-sets?anchor_doc_id=%5B101%5D&limit=50&offset=0&state=OPEN&status=%5B%22RECONCILED%22%5D"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby List Document Sets
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/reconciliation/v1/linking-sets/7c2a1b90-4d3e-4f81-9a0c-11b2c3d4e5f6/document-sets?anchor_doc_id=%5B101%5D&limit=50&offset=0&state=OPEN&status=%5B%22RECONCILED%22%5D")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java List Document Sets
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.staple.io/reconciliation/v1/linking-sets/7c2a1b90-4d3e-4f81-9a0c-11b2c3d4e5f6/document-sets?anchor_doc_id=%5B101%5D&limit=50&offset=0&state=OPEN&status=%5B%22RECONCILED%22%5D")
  .header("x-api-key", "<apiKey>")
  .asString();
```

```php List Document Sets
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.staple.io/reconciliation/v1/linking-sets/7c2a1b90-4d3e-4f81-9a0c-11b2c3d4e5f6/document-sets?anchor_doc_id=%5B101%5D&limit=50&offset=0&state=OPEN&status=%5B%22RECONCILED%22%5D', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp List Document Sets
using RestSharp;

var client = new RestClient("https://api.staple.io/reconciliation/v1/linking-sets/7c2a1b90-4d3e-4f81-9a0c-11b2c3d4e5f6/document-sets?anchor_doc_id=%5B101%5D&limit=50&offset=0&state=OPEN&status=%5B%22RECONCILED%22%5D");
var request = new RestRequest(Method.GET);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift List Document Sets
import Foundation

let headers = ["x-api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/reconciliation/v1/linking-sets/7c2a1b90-4d3e-4f81-9a0c-11b2c3d4e5f6/document-sets?anchor_doc_id=%5B101%5D&limit=50&offset=0&state=OPEN&status=%5B%22RECONCILED%22%5D")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```