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

# Download Dataset

POST https://api.staple.io/v2/master-data/{sheetId}/download

Download full dataset.

Reference: https://docs.staple.ai/api-reference/v2/master-data/download-dataset

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: v2
  version: 1.0.0
paths:
  /v2/master-data/{sheetId}/download:
    post:
      operationId: downloadDataset
      summary: Download Dataset
      description: Download full dataset.
      tags:
        - masterData
      parameters:
        - name: sheetId
          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/Master Data_downloadDataset_Response_200'
servers:
  - url: https://api.staple.io
    description: https://api.staple.io
components:
  schemas:
    Master Data_downloadDataset_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: Master Data_downloadDataset_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



**Request**

```json
{}
```

**Response**

```json
"PAN,Bank,Email,GlCode,Label1,Label2,Label3,Label4,Label5,Address,Vendor Code,Vendor Name,Account Name,Credit Terms,Account Number,ISO Country Code,Telephone Number,Vendor GST Number,Vendor Name Language,Vendor Default Currency\n1234567890123456,Chase,john.doe@example.com,4000,Electronics,Wholesale,Priority,Online,NA,123 Elm St,VC1001,Acme Corp,Acme Account,Net 30,987654321,US,+1-555-123-4567,GST123456,English,USD\n"
```

**SDK Code**

```python
import requests

url = "https://api.staple.io/v2/master-data/sheetId/download"

payload = {}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.staple.io/v2/master-data/sheetId/download';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{}'
};

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

```go
package main

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

func main() {

	url := "https://api.staple.io/v2/master-data/sheetId/download"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v2/master-data/sheetId/download")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{}"

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

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.staple.io/v2/master-data/sheetId/download")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v2/master-data/sheetId/download', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.staple.io/v2/master-data/sheetId/download");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v2/master-data/sheetId/download")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```