> This page is for Workspace app.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.cloudraker.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.cloudraker.com/_mcp/server.

# Edit one row of an extracted document

PATCH https://api.cloudraker.com/spaces/{spaceId}/runs/{runId}/docs/{docId}/rows/{rowIndex}
Content-Type: application/json

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`.

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

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `spaceId` (string, required)
- `runId` (string, required)
- `docId` (string, required)
- `rowIndex` (string, required)

### Body (application/json)

This endpoint expects an object.

- `fields` (map from string to any, required) — Field key → new value. A field whose value changes loses its source citation; untouched fields keep theirs.

## Response

### 200

The edited row.

- `saved` (boolean, required)
- `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` (boolean, required) — False when nothing in the patch differed.
- `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` (integer, required) — Zero-based index of the edited row, echoed back.
- `data` (map from string to any, optional)
- `evidence` (map from string to list of map from string to any, optional)

## Errors

### 400 Bad Request Error

Validation Error

- `success` (boolean, required)
- `error` (list of any, required)
- `data` (any, required)

### 404 Not Found Error

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

- `any`

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "saved": true,
  "synced": true,
  "changed": true,
  "edited": true,
  "row": 1,
  "data": {},
  "evidence": {}
}
```

**SDK Code**

```python
import requests

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

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

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

print(response.json())
```

```javascript
const url = 'https://api.cloudraker.com/spaces/spaceId/runs/runId/docs/docId/rows/rowIndex';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

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

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.cloudraker.com/spaces/spaceId/runs/runId/docs/docId/rows/rowIndex")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.cloudraker.com/spaces/spaceId/runs/runId/docs/docId/rows/rowIndex")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.cloudraker.com/spaces/spaceId/runs/runId/docs/docId/rows/rowIndex', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.cloudraker.com/spaces/spaceId/runs/runId/docs/docId/rows/rowIndex");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.cloudraker.com/spaces/spaceId/runs/runId/docs/docId/rows/rowIndex")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```