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

# Tables & Cells

> Read table data and manage its columns, rows, and cells.

<Note>
  Authenticate every request with `Authorization: Bearer clr_live_YOUR_API_KEY`.
</Note>

## Get table grid

<Badge color="green">GET</Badge> `/tables/{tableId}`

Get table grid through the Claro Public API.

**Required scope:** `objects`

### Parameters

| Name      | Location | Type   | Required |
| --------- | -------- | ------ | -------- |
| `tableId` | path     | string | Yes      |

### Example request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://platform.getclaro.ai/api/public/v1/tables/$TABLE_ID" \
    -H "Authorization: Bearer clr_live_YOUR_API_KEY"
  ```

  ```python Python theme={null}
  import requests
  table_id = "YOUR_TABLE_ID"
  url = f"https://platform.getclaro.ai/api/public/v1/tables/{table_id}"
  headers = {"Authorization": "Bearer clr_live_YOUR_API_KEY"}
  response = requests.get(url, headers=headers)
  response.raise_for_status()
  print(response.text)
  ```

  ```javascript JavaScript theme={null}
  const tableId = "YOUR_TABLE_ID";

  const response = await fetch(`https://platform.getclaro.ai/api/public/v1/tables/${tableId}`, {
    method: "GET",
    headers: {
      Authorization: "Bearer clr_live_YOUR_API_KEY",
    },
  });

  if (!response.ok) throw new Error(await response.text());
  const data = await response.json();
  ```
</CodeGroup>

### Responses

* `200` - Successful response
* `Default` - Error response. Rate-limited responses use HTTP 429.

***

## Get table columns

<Badge color="green">GET</Badge> `/tables/columns/{tableId}`

Get table columns through the Claro Public API.

**Required scope:** `objects`

### Parameters

| Name      | Location | Type   | Required |
| --------- | -------- | ------ | -------- |
| `tableId` | path     | string | Yes      |

### Example request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://platform.getclaro.ai/api/public/v1/tables/columns/$TABLE_ID" \
    -H "Authorization: Bearer clr_live_YOUR_API_KEY"
  ```

  ```python Python theme={null}
  import requests
  table_id = "YOUR_TABLE_ID"
  url = f"https://platform.getclaro.ai/api/public/v1/tables/columns/{table_id}"
  headers = {"Authorization": "Bearer clr_live_YOUR_API_KEY"}
  response = requests.get(url, headers=headers)
  response.raise_for_status()
  print(response.text)
  ```

  ```javascript JavaScript theme={null}
  const tableId = "YOUR_TABLE_ID";

  const response = await fetch(`https://platform.getclaro.ai/api/public/v1/tables/columns/${tableId}`, {
    method: "GET",
    headers: {
      Authorization: "Bearer clr_live_YOUR_API_KEY",
    },
  });

  if (!response.ok) throw new Error(await response.text());
  const data = await response.json();
  ```
</CodeGroup>

### Responses

* `200` - Successful response
* `Default` - Error response. Rate-limited responses use HTTP 429.

***

## Get table rows

<Badge color="green">GET</Badge> `/tables/rows/{tableId}`

Get table rows through the Claro Public API.

**Required scope:** `objects`

### Parameters

| Name      | Location | Type   | Required |
| --------- | -------- | ------ | -------- |
| `tableId` | path     | string | Yes      |

### Example request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://platform.getclaro.ai/api/public/v1/tables/rows/$TABLE_ID" \
    -H "Authorization: Bearer clr_live_YOUR_API_KEY"
  ```

  ```python Python theme={null}
  import requests
  table_id = "YOUR_TABLE_ID"
  url = f"https://platform.getclaro.ai/api/public/v1/tables/rows/{table_id}"
  headers = {"Authorization": "Bearer clr_live_YOUR_API_KEY"}
  response = requests.get(url, headers=headers)
  response.raise_for_status()
  print(response.text)
  ```

  ```javascript JavaScript theme={null}
  const tableId = "YOUR_TABLE_ID";

  const response = await fetch(`https://platform.getclaro.ai/api/public/v1/tables/rows/${tableId}`, {
    method: "GET",
    headers: {
      Authorization: "Bearer clr_live_YOUR_API_KEY",
    },
  });

  if (!response.ok) throw new Error(await response.text());
  const data = await response.json();
  ```
</CodeGroup>

### Responses

* `200` - Successful response
* `Default` - Error response. Rate-limited responses use HTTP 429.

***

## Add table column

<Badge color="blue">POST</Badge> `/tables/{tableId}/add-column`

Add table column through the Claro Public API.

**Required scope:** `objects`

### Parameters

| Name      | Location | Type   | Required |
| --------- | -------- | ------ | -------- |
| `tableId` | path     | string | Yes      |

### Request body

Content type: `application/json` (required)

```json Request example theme={null}
{
  "name": "Brand",
  "type": "string",
  "metadata": {}
}
```

### Example request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://platform.getclaro.ai/api/public/v1/tables/$TABLE_ID/add-column" \
    -H "Authorization: Bearer clr_live_YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    --data '{
    "name": "Brand",
    "type": "string",
    "metadata": {}
  }'
  ```

  ```python Python theme={null}
  import json
  import requests
  table_id = "YOUR_TABLE_ID"
  url = f"https://platform.getclaro.ai/api/public/v1/tables/{table_id}/add-column"
  headers = {"Authorization": "Bearer clr_live_YOUR_API_KEY"}
  payload = json.loads(r'''{
    "name": "Brand",
    "type": "string",
    "metadata": {}
  }''')
  response = requests.post(url, headers=headers, json=payload)
  response.raise_for_status()
  print(response.text)
  ```

  ```javascript JavaScript theme={null}
  const tableId = "YOUR_TABLE_ID";

  const response = await fetch(`https://platform.getclaro.ai/api/public/v1/tables/${tableId}/add-column`, {
    method: "POST",
    headers: {
      Authorization: "Bearer clr_live_YOUR_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "name": "Brand",
      "type": "string",
      "metadata": {}
    }),
  });

  if (!response.ok) throw new Error(await response.text());
  const data = await response.json();
  ```
</CodeGroup>

### Responses

* `201` - Successful response
* `Default` - Error response. Rate-limited responses use HTTP 429.

***

## Add table row

<Badge color="blue">POST</Badge> `/tables/{tableId}/add-row`

Add table row through the Claro Public API.

**Required scope:** `objects`

### Parameters

| Name      | Location | Type   | Required |
| --------- | -------- | ------ | -------- |
| `tableId` | path     | string | Yes      |

### Request body

Content type: `application/json` (required)

```json Request example theme={null}
{
  "rowsData": {
    "00000000-0000-4000-8000-000000000005": "Example product"
  }
}
```

### Example request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://platform.getclaro.ai/api/public/v1/tables/$TABLE_ID/add-row" \
    -H "Authorization: Bearer clr_live_YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    --data '{
    "rowsData": {
      "00000000-0000-4000-8000-000000000005": "Example product"
    }
  }'
  ```

  ```python Python theme={null}
  import json
  import requests
  table_id = "YOUR_TABLE_ID"
  url = f"https://platform.getclaro.ai/api/public/v1/tables/{table_id}/add-row"
  headers = {"Authorization": "Bearer clr_live_YOUR_API_KEY"}
  payload = json.loads(r'''{
    "rowsData": {
      "00000000-0000-4000-8000-000000000005": "Example product"
    }
  }''')
  response = requests.post(url, headers=headers, json=payload)
  response.raise_for_status()
  print(response.text)
  ```

  ```javascript JavaScript theme={null}
  const tableId = "YOUR_TABLE_ID";

  const response = await fetch(`https://platform.getclaro.ai/api/public/v1/tables/${tableId}/add-row`, {
    method: "POST",
    headers: {
      Authorization: "Bearer clr_live_YOUR_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "rowsData": {
        "00000000-0000-4000-8000-000000000005": "Example product"
      }
    }),
  });

  if (!response.ok) throw new Error(await response.text());
  const data = await response.json();
  ```
</CodeGroup>

### Responses

* `201` - Successful response
* `Default` - Error response. Rate-limited responses use HTTP 429.

***

## Update table cell

<Badge color="yellow">PUT</Badge> `/tables/cells`

Update table cell through the Claro Public API.

**Required scope:** `objects`

### Request body

Content type: `application/json` (required)

```json Request example theme={null}
{
  "columnId": "00000000-0000-4000-8000-000000000005",
  "rowId": "00000000-0000-4000-8000-000000000004",
  "data": "Example product"
}
```

### Example request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT "https://platform.getclaro.ai/api/public/v1/tables/cells" \
    -H "Authorization: Bearer clr_live_YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    --data '{
    "columnId": "00000000-0000-4000-8000-000000000005",
    "rowId": "00000000-0000-4000-8000-000000000004",
    "data": "Example product"
  }'
  ```

  ```python Python theme={null}
  import json
  import requests
  url = f"https://platform.getclaro.ai/api/public/v1/tables/cells"
  headers = {"Authorization": "Bearer clr_live_YOUR_API_KEY"}
  payload = json.loads(r'''{
    "columnId": "00000000-0000-4000-8000-000000000005",
    "rowId": "00000000-0000-4000-8000-000000000004",
    "data": "Example product"
  }''')
  response = requests.put(url, headers=headers, json=payload)
  response.raise_for_status()
  print(response.text)
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(`https://platform.getclaro.ai/api/public/v1/tables/cells`, {
    method: "PUT",
    headers: {
      Authorization: "Bearer clr_live_YOUR_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "columnId": "00000000-0000-4000-8000-000000000005",
      "rowId": "00000000-0000-4000-8000-000000000004",
      "data": "Example product"
    }),
  });

  if (!response.ok) throw new Error(await response.text());
  const data = await response.json();
  ```
</CodeGroup>

### Responses

* `200` - Successful response
* `Default` - Error response. Rate-limited responses use HTTP 429.
