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

# Append Rows To A Sheet

POST https://api.staple.io/v2/master-data/{sheetId}/append
Content-Type: application/json

Append rows to an existing sheet.

Reference: https://docs.staple.ai/api-reference/v2/master-data/append-rows-to-a-sheet

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: v2
  version: 1.0.0
paths:
  /v2/master-data/{sheetId}/append:
    post:
      operationId: appendRowsToASheet
      summary: Append Rows To A Sheet
      description: Append rows to an existing sheet.
      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_appendRowsToASheet_Response_200
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                rows:
                  type: array
                  items:
                    $ref: >-
                      #/components/schemas/V2MasterDataSheetIdAppendPostRequestBodyContentApplicationJsonSchemaRowsItems
servers:
  - url: https://api.staple.io
    description: https://api.staple.io
components:
  schemas:
    V2MasterDataSheetIdAppendPostRequestBodyContentApplicationJsonSchemaRowsItems:
      type: object
      properties:
        customer_id:
          type: string
        name_raw:
          type: string
      title: >-
        V2MasterDataSheetIdAppendPostRequestBodyContentApplicationJsonSchemaRowsItems
    Master Data_appendRowsToASheet_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: Master Data_appendRowsToASheet_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

### Append Rows To A Sheet



**Request**

```json
undefined
```

**Response**

```json
{
  "appendMasterDataRows": {
    "master_data_id": "abc123",
    "status": "processing"
  }
}
```

**SDK Code**

```python Append Rows To A Sheet
import requests

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

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

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

print(response.json())
```

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

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

```go Append Rows To A Sheet
package main

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

func main() {

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

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

	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 Append Rows To A Sheet
require 'uri'
require 'net/http'

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

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'

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

```java Append Rows To A Sheet
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/append")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .asString();
```

```php Append Rows To A Sheet
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

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

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

```csharp Append Rows To A Sheet
using RestSharp;

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

```swift Append Rows To A Sheet
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v2/master-data/sheetId/append")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```

### Master Data_appendRowsToASheet_example



**Request**

```json
{
  "rows": [
    {
      "customer_id": "C-2001",
      "name_raw": "Acme Ltd"
    }
  ]
}
```

**Response**

```json
{
  "appendMasterDataRows": {
    "master_data_id": "abc123",
    "status": "processing"
  }
}
```

**SDK Code**

```python Master Data_appendRowsToASheet_example
import requests

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

payload = { "rows": [
        {
            "customer_id": "C-2001",
            "name_raw": "Acme Ltd"
        }
    ] }
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Master Data_appendRowsToASheet_example
const url = 'https://api.staple.io/v2/master-data/sheetId/append';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"rows":[{"customer_id":"C-2001","name_raw":"Acme Ltd"}]}'
};

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

```go Master Data_appendRowsToASheet_example
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"rows\": [\n    {\n      \"customer_id\": \"C-2001\",\n      \"name_raw\": \"Acme Ltd\"\n    }\n  ]\n}")

	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 Master Data_appendRowsToASheet_example
require 'uri'
require 'net/http'

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

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 = "{\n  \"rows\": [\n    {\n      \"customer_id\": \"C-2001\",\n      \"name_raw\": \"Acme Ltd\"\n    }\n  ]\n}"

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

```java Master Data_appendRowsToASheet_example
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/append")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"rows\": [\n    {\n      \"customer_id\": \"C-2001\",\n      \"name_raw\": \"Acme Ltd\"\n    }\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v2/master-data/sheetId/append', [
  'body' => '{
  "rows": [
    {
      "customer_id": "C-2001",
      "name_raw": "Acme Ltd"
    }
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Master Data_appendRowsToASheet_example
using RestSharp;

var client = new RestClient("https://api.staple.io/v2/master-data/sheetId/append");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"rows\": [\n    {\n      \"customer_id\": \"C-2001\",\n      \"name_raw\": \"Acme Ltd\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Master Data_appendRowsToASheet_example
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["rows": [
    [
      "customer_id": "C-2001",
      "name_raw": "Acme Ltd"
    ]
  ]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v2/master-data/sheetId/append")! 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()
```