> 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.

# Get Matching Set By ID

GET https://api.staple.io/reconciliation/metadata/sets/{matchingId}

Get views, secondary doc types, match rules, and matched docs for a set.

Reference: https://docs.staple.ai/api-reference/v2/reconciliation/get-matching-set-by-id

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: v2
  version: 1.0.0
paths:
  /reconciliation/metadata/sets/{matchingId}:
    get:
      operationId: getMatchingSetById
      summary: Get Matching Set By ID
      description: Get views, secondary doc types, match rules, and matched docs for a set.
      tags:
        - reconciliation
      parameters:
        - name: matchingId
          in: path
          required: true
          schema:
            type: string
        - name: x-api-key
          in: header
          description: API key issued by Staple.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Reconciliation_getMatchingSetById_Response_200
servers:
  - url: https://api.staple.io
    description: https://api.staple.io
components:
  schemas:
    Reconciliation_getMatchingSetById_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: Reconciliation_getMatchingSetById_Response_200
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key issued by Staple.
    bearerAuth:
      type: http
      scheme: bearer
      description: JWT obtained from the login endpoint.

```

## Examples



**Response**

```json
{
  "id": "123",
  "views": [
    {
      "primary_doc_type": "invoice",
      "secondary_doc_types": [
        {
          "doc_type": "po",
          "match_rules": [
            {
              "match_rule_id": "rule-1",
              "reconcile_rules": [
                {
                  "reconcile_rule_id": "rr-1"
                }
              ]
            }
          ],
          "matched_docs": [
            {
              "doc_id": "INV-20301",
              "doc_name": "inv-20301.pdf",
              "last_matched_status": "Not Reconciled"
            }
          ]
        }
      ],
      "view_id": "ap_po"
    }
  ]
}
```

**SDK Code**

```python Get Matching Set By ID
import requests

url = "https://api.staple.io/reconciliation/metadata/sets/matchingId"

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

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

print(response.json())
```

```javascript Get Matching Set By ID
const url = 'https://api.staple.io/reconciliation/metadata/sets/matchingId';
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 Get Matching Set By ID
package main

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

func main() {

	url := "https://api.staple.io/reconciliation/metadata/sets/matchingId"

	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 Get Matching Set By ID
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/reconciliation/metadata/sets/matchingId")

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 Get Matching Set By ID
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.staple.io/reconciliation/metadata/sets/matchingId")
  .header("x-api-key", "<apiKey>")
  .asString();
```

```php Get Matching Set By ID
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.staple.io/reconciliation/metadata/sets/matchingId', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Get Matching Set By ID
using RestSharp;

var client = new RestClient("https://api.staple.io/reconciliation/metadata/sets/matchingId");
var request = new RestRequest(Method.GET);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Get Matching Set By ID
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/reconciliation/metadata/sets/matchingId")! 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()
```