# Process a record's documents

Sends one record's documents to the processor and answers the job. Three answers, and the middle one is the point: 201 when a job was created, 200 when the `idempotencyKey` already named a job — the reload case, where the caller is told THAT job rather than an error — and 409 `would_supersede` when the read would overwrite fields somebody entered by hand, with those fields NAMED so the caller can retry with `replace: true`. A record with no documents on it is refused: there would be nothing to read.

Access class: `def:read`.

## Endpoint

`POST /v1/definitions/{key}/rows/{rowId}/process`

## Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| key | path | string | Yes |
| rowId | path | string | Yes |

## Request body

Content type: `application/json`.

```json
{
  "body": {
    "idempotencyKey": "string",
    "replace": true
  },
  "params": {
    ":key": "string",
    ":rowId": ""
  },
  "query": {}
}
```

## Responses

### 201

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "created": true,
    "documentCount": 1,
    "job": {
      "documents": [
        "string"
      ],
      "events": [
        "string"
      ],
      "externalJobId": "",
      "findings": [
        "string"
      ],
      "finished": true,
      "finishedAt": "string",
      "id": "",
      "idempotencyKey": "string",
      "requestedAt": "string",
      "requestedBy": "string",
      "status": "string"
    },
    "superseded": [
      "string"
    ]
  }
}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
