> ## Documentation Index
> Fetch the complete documentation index at: https://productlasso.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create rows

> Add one or more rows with data to an existing table.

## Path parameters

<ParamField path="table_id" type="string" required>
  The unique identifier of the table.
</ParamField>

## Request body

<ParamField body="rows" type="object[]" required>
  Array of row objects to insert. Each object maps column keys to values. All keys must match columns defined in the table's schema. Maximum 1000 rows per request.

  <Expandable title="Row object">
    Each key-value pair corresponds to a column in the table's schema. For example, if the schema has columns `name` (text) and `price` (number), a valid row would be `{ "name": "Widget", "price": 9.99 }`.
  </Expandable>
</ParamField>

<Warning>
  Column keys are strictly validated against the table's schema. If any row contains a key that doesn't match a schema column, the entire request is rejected with a `422` error listing the unknown keys.
</Warning>

## Response

<ResponseField name="data" type="array">
  <Expandable title="Row object">
    <ResponseField name="id" type="string">Unique row identifier.</ResponseField>
    <ResponseField name="row_index" type="integer">Position of the row in the table.</ResponseField>
    <ResponseField name="data" type="object">The inserted data keyed by column key.</ResponseField>
    <ResponseField name="created_at" type="string">ISO 8601 timestamp.</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="inserted_count" type="integer">Number of rows successfully inserted.</ResponseField>

<RequestExample>
  ```typescript TypeScript theme={null}
  const result = await client.tables.createRows("tbl_abc123", {
    rows: [
      { name: "Widget A", price: 9.99, brand: "Acme" },
      { name: "Widget B", price: 14.99, brand: "Acme" },
    ],
  });

  console.log(result.inserted_count); // 2
  for (const row of result.data) {
    console.log(row.id, row.data.name);
  }
  ```

  ```python Python theme={null}
  result = client.tables.create_rows(
      "tbl_abc123",
      rows=[
          {"name": "Widget A", "price": 9.99, "brand": "Acme"},
          {"name": "Widget B", "price": 14.99, "brand": "Acme"},
      ],
  )

  print(result["inserted_count"])  # 2
  for row in result["data"]:
      print(row["id"], row["data"]["name"])
  ```

  ```bash cURL theme={null}
  curl -X POST "https://hub.banditshq.com/api/v1/tables/tbl_abc123/rows" \
    -H "Authorization: Bearer lasso_..." \
    -H "Content-Type: application/json" \
    -d '{
      "rows": [
        { "name": "Widget A", "price": 9.99, "brand": "Acme" },
        { "name": "Widget B", "price": 14.99, "brand": "Acme" }
      ]
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "data": [
      {
        "id": "row_def456",
        "row_index": 5,
        "data": {
          "name": "Widget A",
          "price": 9.99,
          "brand": "Acme"
        },
        "created_at": "2025-03-10T14:30:00.000Z"
      },
      {
        "id": "row_ghi789",
        "row_index": 6,
        "data": {
          "name": "Widget B",
          "price": 14.99,
          "brand": "Acme"
        },
        "created_at": "2025-03-10T14:30:00.000Z"
      }
    ],
    "inserted_count": 2
  }
  ```
</ResponseExample>
