# Save an edit of one row through a public form

> Source: https://elaichi.ai/docs/api-reference/dashboards/public/updatepublicdashboardformrow/

`PATCH /public/dashboard/{token}/widget/{key}/row/{rowId}`

Resource: **Public** · API: **Dashboards**

## Path parameters

- **`token`** _(string, required)_
  The unguessable link token
- **`key`** _(string, required)_
  Widget key
- **`rowId`** _(string, required)_
  Row id

## Query parameters

- **`tz`** _(string)_
  The visitor's IANA time zone, for a read-only $today default. An unknown zone reads as UTC.

## Request body

- **`values`** _(object)_
- **`expected_version`** _(integer)_
  The version the visitor opened.
- **`submission_id`** _(string)_
  One per submission: a retry with the same id replays the first write.
- **`turnstile_token`** _(string)_
  The Turnstile token (action public_form) the page solved; required when the deployment has a secret set, else 400 turnstile_failed.

## Response body

- **`result`** _(string)_
  Allowed: `updated`, `unchanged`
- **`row_id`** _(string)_
- **`version`** _(integer)_
- **`replayed`** _(boolean)_
- **`message`** _(string)_
  The form's success message.

## Code examples

### curl

```bash
curl -X PATCH 'https://api.elaichi.ai/public/dashboard/<token>/widget/<key>/row/<rowId>' \
  -H 'Content-Type: application/json' \
  -d '{"values":{},"expected_version":0,"submission_id":"your_submission_id","turnstile_token":"your_turnstile_token"}'
```

### JavaScript

```javascript
const body = {
  "values": {},
  "expected_version": 0,
  "submission_id": "your_submission_id",
  "turnstile_token": "your_turnstile_token"
};

const response = await fetch('https://api.elaichi.ai/public/dashboard/<token>/widget/<key>/row/<rowId>', {
  method: 'PATCH',
  headers: {
    '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/public/dashboard/<token>/widget/<key>/row/<rowId>"
headers = {
    "Content-Type": "application/json",
}
payload = {
    "values": {},
    "expected_version": 0,
    "submission_id": "your_submission_id",
    "turnstile_token": "your_turnstile_token"
}

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