---
title: "Edit one row of an extracted document"
---

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

# Edit one row of an extracted document

Path: CloudRaker Workspace API › Space Runs

`PATCH /spaces/{spaceId}/runs/{runId}/docs/{docId}/rows/{rowIndex}`

Overwrites extracted field values on ONE row of a terminal `rows_per_document` extract run. Body: `{ fields: { <fieldKey>: <value> } }`, the same shape the document edit takes. A field whose value changes LOSES its source citation (the evidence no longer backs a human-supplied value); untouched fields, and every other row, keep theirs. Rows are addressed by their zero-based index in the extracted order, which is stable for a finished run. Requires `space:contribute` (denied → 403). A run stays editable for **7 days** after it starts; after that an edit answers 404 `state_gone`. The same 404 covers a document that is not a table-rows one and an index out of range. Results stay readable through `getRunResult`.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `spaceId` (`patchSpaceRunDocRow.path.spaceId`; string, required)
- `runId` (`patchSpaceRunDocRow.path.runId`; string, required)
- `docId` (`patchSpaceRunDocRow.path.docId`; string, required)
- `rowIndex` (`patchSpaceRunDocRow.path.rowIndex`; string, required)
  - pattern `^\d+$`

## Request body

_Required._

- `fields` (`patchSpaceRunDocRow.fields`; map<unknown>, required) — Field key → new value. A field whose value changes loses its source citation; untouched fields keep theirs.

## Example request

```json
{
  "fields": {
    "property1": null,
    "property2": null
  }
}
```

## Code samples

### cURL

```bash
curl --request PATCH \
  --url 'https://api.cloudraker.com/spaces/<spaceId>/runs/<runId>/docs/<docId>/rows/<rowIndex>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "fields": {
    "property1": null,
    "property2": null
  }
}
'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/spaces/<spaceId>/runs/<runId>/docs/<docId>/rows/<rowIndex>';
const options = {
  method: 'PATCH',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({fields: {property1: null, property2: null}})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.cloudraker.com/spaces/<spaceId>/runs/<runId>/docs/<docId>/rows/<rowIndex>"

payload = { "fields": {
        "property1": None,
        "property2": None
    } }
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

The edited row.

#### Example

```json
{
  "saved": true,
  "synced": true,
  "changed": true,
  "edited": true,
  "data": {
    "property1": null,
    "property2": null
  },
  "evidence": {
    "property1": [
      {
        "property1": null,
        "property2": null
      }
    ],
    "property2": [
      {
        "property1": null,
        "property2": null
      }
    ]
  },
  "row": -9007199254740991
}
```

- `saved` (`patchSpaceRunDocRow.response.200.saved`; boolean, required)
- `synced` (`patchSpaceRunDocRow.response.200.synced`; boolean, required) — False when the durable result was not refreshed. With `changed` or `edited` true, the edit is stored but a later read still returns the old value: save again to publish it. With both false, nothing needed publishing and there is nothing to retry.
- `changed` (`patchSpaceRunDocRow.response.200.changed`; boolean, required) — False when nothing in the patch differed.
- `edited` (`patchSpaceRunDocRow.response.200.edited`; boolean, required) — The stored document carries a human edit, from this request or an earlier one. Tells a `synced: false` that is waiting to be published apart from one that had nothing to publish.
- `row` (`patchSpaceRunDocRow.response.200.row`; integer, required) — Zero-based index of the edited row, echoed back.
  - min -9007199254740991; max 9007199254740991
- `data` (`patchSpaceRunDocRow.response.200.data`; map<unknown>, optional)
- `evidence` (`patchSpaceRunDocRow.response.200.evidence`; map<array<map<unknown>>>, optional)

### 400

Validation Error

#### Example

```json
{
  "success": false,
  "error": [
    null
  ],
  "data": null
}
```

- `success` (`patchSpaceRunDocRow.response.400.success`; boolean, required)
  - one of `false`
- `error` (`patchSpaceRunDocRow.response.400.error`; array<unknown>, required)
- `data` (`patchSpaceRunDocRow.response.400.data`; unknown, required)

### 404

No editable result, past the 7-day edit window, not a table-rows document, or no such row.


Source: https://docs.cloudraker.com/workspace/api/space-runs/patch-space-run-doc-row/index.md
