> This page is for version v1 (default).
> For other versions, use one of these documentation indexes:
> - v1 (default): https://docs.plextera.com/v-1/llms.txt

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

# Submit extraction feedback

POST https://api.plextera.com/api/public/v1/document-insights/extractions/{extractionId}/feedback
Content-Type: application/json

Submits feedback on an extraction result.

Provide `fieldId` for field-level feedback, or omit it for the whole extraction.


Reference: https://docs.plextera.com/api/api-reference/document-insights/submit-document-extraction-feedback

## Authentication

- `Authorization` header (required) — Use the API key format: `api-key <token>`.

## Request

### Path parameters

- `extractionId` (string, required) — Extraction identifier returned when the extraction was created.

### Body (application/json)

This endpoint expects a CreateDocumentInsightsFeedbackRequest.

- `message` (string, required) — Human-readable feedback message. Maximum length: 1024 characters.
- `type` (enum, optional) — Feedback type. `ERROR` marks the extraction as needing correction and review. `INFO` records a note without marking the extraction as incorrect. Defaults to `ERROR` when omitted.
  - Allowed values: `ERROR`, `INFO`
- `fieldId` (string, optional) — Optional extracted field identifier. Include it when feedback applies to a specific field from `output.fields`; omit it for general extraction feedback.

## Response

### 201

Feedback recorded.

- `id` (string, optional) — Feedback identifier.
- `extractionId` (string, optional) — The extraction this feedback belongs to.
- `message` (string, optional) — The submitted feedback text.
- `type` (enum, optional) — Feedback type accepted by Document Insights.
  - Allowed values: `ERROR`, `INFO`
- `fieldId` (string, optional, nullable) — The field identifier supplied in the request. Returned as null for general extraction feedback.
- `createdAt` (datetime, optional) — UTC timestamp when the feedback was accepted.

## Errors

### 400 Bad Request Error

INVALID_REQUEST — The request is malformed: unreadable JSON, an invalid parameter value, or a bad multipart body.

- `error` (ApiError, optional) — Machine-readable error details shared by every error response.

### 401 Unauthorized Error

UNAUTHORIZED — The API key is missing, malformed, or revoked.

- `error` (ApiError, optional) — Machine-readable error details shared by every error response.

### 403 Forbidden Error

FORBIDDEN — The API key is valid but not allowed to perform this operation.

- `error` (ApiError, optional) — Machine-readable error details shared by every error response.

### 404 Not Found Error

NOT_FOUND — The resource does not exist in your workspace.

- `error` (ApiError, optional) — Machine-readable error details shared by every error response.

### 405 Method Not Allowed Error

METHOD_NOT_ALLOWED — The HTTP method is not supported for this path.

- `error` (ApiError, optional) — Machine-readable error details shared by every error response.

### 406 Not Acceptable Error

NOT_ACCEPTABLE — The requested response media type is not supported.

- `error` (ApiError, optional) — Machine-readable error details shared by every error response.

### 409 Conflict Error

CONFLICT — The request conflicts with existing state in an upstream Plextera service.

- `error` (ApiError, optional) — Machine-readable error details shared by every error response.

### 422 Unprocessable Entity Error

VALIDATION_FAILED — one or more request fields are invalid. See `details`.

- `error` (ApiError, optional) — Machine-readable error details shared by every error response.

### 429 Too Many Requests Error

RATE_LIMITED — Too many requests in a short window. 429 responses are enforced at the network edge; the body may be plain text instead of this envelope, so rely on the status code and the Retry-After header.

- `error` (ApiError, optional) — Machine-readable error details shared by every error response.

### 500 Internal Server Error

INTERNAL_ERROR — Unexpected failure inside Plextera. Retry with backoff; contact support with the requestId if it persists.

- `error` (ApiError, optional) — Machine-readable error details shared by every error response.

### 502 Bad Gateway Error

DOWNSTREAM_ERROR — A downstream Plextera service failed while handling the request. Retry with backoff.

- `error` (ApiError, optional) — Machine-readable error details shared by every error response.

## Types

### ApiError

Machine-readable error details shared by every error response.

- `code` (string, optional) — Stable machine-readable error code. Branch your handling on this, not on `message`.
- `message` (string, optional) — Human-readable explanation. Wording may change; do not parse it.
- `requestId` (string, optional) — Unique request identifier, also returned in the X-Request-Id response header. Include it in support requests.
- `retryable` (boolean, optional) — True when retrying the same request later may succeed.
- `details` (list of ApiErrorDetail, optional) — Field-level validation issues. Present only for VALIDATION_FAILED.

### ApiErrorDetail

Field-level validation issue.

- `field` (string, optional) — Name of the invalid request field.
- `issue` (string, optional) — What is wrong with the field value.

## Examples

**Request**

```json
{
  "message": "The total amount should be reviewed."
}
```

**Response**

```json
{
  "id": "string",
  "extractionId": "string",
  "message": "string",
  "type": "ERROR",
  "fieldId": "string",
  "createdAt": "2024-01-15T09:30:00Z"
}
```

**SDK Code**

```python
import requests

url = "https://api.plextera.com/api/public/v1/document-insights/extractions/extractionId/feedback"

payload = { "message": "The total amount should be reviewed." }
headers = {
    "Authorization": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.plextera.com/api/public/v1/document-insights/extractions/extractionId/feedback';
const options = {
  method: 'POST',
  headers: {Authorization: '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"message":"The total amount should be reviewed."}'
};

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.plextera.com/api/public/v1/document-insights/extractions/extractionId/feedback"

	payload := strings.NewReader("{\n  \"message\": \"The total amount should be reviewed.\"\n}")

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

	req.Header.Add("Authorization", "<apiKey>")
	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.plextera.com/api/public/v1/document-insights/extractions/extractionId/feedback")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"message\": \"The total amount should be reviewed.\"\n}"

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.post("https://api.plextera.com/api/public/v1/document-insights/extractions/extractionId/feedback")
  .header("Authorization", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"message\": \"The total amount should be reviewed.\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.plextera.com/api/public/v1/document-insights/extractions/extractionId/feedback', [
  'body' => '{
  "message": "The total amount should be reviewed."
}',
  'headers' => [
    'Authorization' => '<apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.plextera.com/api/public/v1/document-insights/extractions/extractionId/feedback");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"message\": \"The total amount should be reviewed.\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["message": "The total amount should be reviewed."] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.plextera.com/api/public/v1/document-insights/extractions/extractionId/feedback")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```