# Patch one row (one table)

> Source: https://elaichi.ai/docs/api-reference/collections/collection/updatecollectionrowintable/

`PATCH /collection/{id}/table/{tableKey}/rows/{rowId}`

Resource: **Collection** · API: **Collections**

## Path parameters

- **`id`** _(string, required)_
  Resource id
- **`tableKey`** _(string, required)_
  Table key; `main` is the default table.
- **`rowId`** _(string, required)_
  Resource id

## Request body

- **`fields`** _(object)_
- **`typecast`** _(boolean)_

## Response body

- **`id`** _(string)_
- **`fields`** _(object)_
- **`created_at`** _(string)_
- **`updated_at`** _(string)_
- **`created_by`** _(string,null)_
- **`updated_by`** _(string,null)_

## Code examples

### curl

```bash
curl -X PATCH 'https://api.elaichi.ai/collection/<id>/table/<tableKey>/rows/<rowId>' \
  -H 'Authorization: Bearer $ELAICHI_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"fields":{},"typecast":true}'
```

### JavaScript

```javascript
const body = {
  "fields": {},
  "typecast": true
};

const response = await fetch('https://api.elaichi.ai/collection/<id>/table/<tableKey>/rows/<rowId>', {
  method: 'PATCH',
  headers: {
    'Authorization': 'Bearer ' + process.env.ELAICHI_API_TOKEN,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(body),
});

const data = await response.json();
console.log(data);
```

### Python

```python
import os
import requests

url = "https://api.elaichi.ai/collection/<id>/table/<tableKey>/rows/<rowId>"
headers = {
    "Authorization": f"Bearer {os.environ['ELAICHI_API_TOKEN']}",
    "Content-Type": "application/json",
}
payload = {
    "fields": {},
    "typecast": True
}

response = requests.patch(url, headers=headers, json=payload)
print(response.json())
```
