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

# Get extraction

GET https://api.plextera.com/api/public/v1/document-insights/extractions/{extractionId}

Returns the current extraction state and full `output` when `outputAvailable` is true.

Poll this endpoint until `status` is `COMPLETED`, `FAILED`, or `REJECTED`.
For terminal error codes and corrective actions, see [Handle failures](/guides/core-guides/document-extraction#handle-failures).


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

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

## Response

### 200

Current extraction state. Includes `output` when `outputAvailable` is true.

- `id` (string, optional) — Extraction identifier. Store this value for polling, feedback, and event correlation. Example: `69654f0bc073ef404baec649`.
- `status` (enum, optional) — Current processing state. `FAILED` covers routing, processing, or extracted-data validation problems. `REJECTED` covers document-level problems such as duplicate content or an unsupported language. Stop polling when the value is `COMPLETED`, `FAILED`, or `REJECTED`.
  - Allowed values: `QUEUED`, `PROCESSING`, `COMPLETED`, `FAILED`, `REJECTED`
- `outputAvailable` (boolean, optional) — `true` means the final `output` is ready and included in the extraction details or completed event payload.
- `createdAt` (datetime, optional) — UTC timestamp when Plextera accepted the extraction request. Example: `2026-04-07T10:05:04Z`.
- `updatedAt` (datetime, optional) — UTC timestamp of the latest known state change. Example: `2026-04-07T10:22:00Z`.
- `completedAt` (datetime, optional) — UTC timestamp when the extraction reached `COMPLETED`, `FAILED`, or `REJECTED`. Omitted while the extraction is still queued or processing.
- `error` (RunError, optional) — Failure or rejection details. Present only when `status` is `FAILED` or `REJECTED`.
- `labels` (map from string to string, optional) — String key-value pairs submitted with the extraction and returned for correlation.
- `document` (DocumentInsightsDocument, optional) — Summary of the source document that was processed.
- `output` (ExtractionOutput, optional) — Final structured extraction output. Present when `outputAvailable` is `true`.

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

### 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

### RunError

Terminal failure details. Present only for failed or rejected extractions and workflow runs.

- `code` (string, optional) — Stable machine-readable reason code. Document Insights returns `DOCUMENT_NOT_ROUTED` with `FAILED` for routing problems, `DOCUMENT_EXTRACTION_FAILED` with `FAILED` for processing or extracted-data validation problems, and `DOCUMENT_REJECTED` with `REJECTED` for document-level problems such as duplicate content or an unsupported language.
- `message` (string, optional) — Human-readable explanation of the failure or rejection.

### DocumentInsightsDocument

Document summary used inside Document Insights extraction and event payloads. Includes file metadata returned by File Service and page count returned by Document Insights; optional fields are omitted if the upstream service does not return them.

- `fileId` (string, optional) — Plextera File Service identifier for the source document.
- `fileName` (string, optional) — Source file name returned by File Service. Omitted when the upstream file record does not include a name.
- `mimeType` (string, optional) — Standard MIME media type of the source document, for example `application/pdf`. Omitted when Document Insights cannot determine the media type.
- `size` (long, optional) — Source document size in bytes returned by File Service. Omitted when file size is unavailable.
- `pageCount` (integer, optional) — Source document page count returned by Document Insights. Omitted when page count has not been computed.
- `contentUrl` (string, optional, nullable) — Short-lived pre-signed URL to download the source document directly from File Service. Returned only by Get extraction (`GET /extractions/{id}`); it is minted per request and expires, so use it promptly and do not store it. Omitted from List extractions responses and whenever the download URL cannot be resolved.

### ExtractionOutput

Final structured output produced by a document extraction.

- `fieldCount` (integer, optional) — Total number of extracted fields represented in the result.
- `fields` (list of ExtractedField, optional) — Document Insights-style typed field results. Structured field types preserve nested values inside value.

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

### ExtractedField

Document Insights-style typed field result.

- `name` (string, required) — Field name configured for your workspace.
- `type` (enum, required) — Field type, for example `text` or `group`.
  - Allowed values: `text`, `group`
- `id` (string, optional) — Field identifier. Pass it as `fieldId` when submitting feedback.
- `value` (ExtractedFieldValue, optional) — The extracted value. Text fields usually return a scalar such as `Acme Industries Ltd`; group fields return nested extracted fields.
- `metadata` (ExtractedFieldMetadata, optional) — Extraction details: confidence, page, and placement.

### ApiErrorDetail

Field-level validation issue.

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

### ExtractedFieldValue

The extracted value. Text fields usually return a scalar such as `Acme Industries Ltd`; group fields return nested extracted fields.

### ExtractedFieldMetadata

How and where the field value was extracted.

- `extracted` (boolean, optional) — True when Document Insights found a value for this field.
- `confidence` (double, optional) — Model confidence score from 0.0 to 1.0. Omitted if Document Insights does not return a confidence score for this field.
- `page` (integer, optional) — 1-based page number where the field value was found. Omitted when Document Insights does not return a positive page number.
- `placement` (FieldPlacement, optional) — Bounding-box coordinates for the extracted value on the page. Coordinates or dimensions may be -1 when Document Insights cannot determine them.

### FieldPlacement

Bounding box of the extracted value on the page. A value of -1 means Document Insights could not determine that coordinate or dimension.

- `x` (integer, optional) — Left coordinate of the field bounding box, or -1 when unavailable.
- `y` (integer, optional) — Top coordinate of the field bounding box, or -1 when unavailable.
- `width` (integer, optional) — Width of the field bounding box, or -1 when unavailable.
- `height` (integer, optional) — Height of the field bounding box, or -1 when unavailable.

## Examples

### Processing extraction

**Response**

```json
{
  "id": "69654f0bc073ef404baec649",
  "status": "PROCESSING",
  "outputAvailable": false,
  "createdAt": "2026-04-07T10:05:04Z",
  "updatedAt": "2026-04-07T10:06:10Z",
  "labels": {
    "customerDocumentId": "doc-42",
    "docType": "invoice"
  },
  "document": {
    "fileId": "file_01JY7M4ZVX5R1P3M3Q0TA1S7ZM",
    "fileName": "invoice.pdf",
    "mimeType": "application/pdf"
  }
}
```

**SDK Code**

```python Processing extraction
import requests

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

headers = {"Authorization": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Processing extraction
const url = 'https://api.plextera.com/api/public/v1/document-insights/extractions/extractionId';
const options = {method: 'GET', headers: {Authorization: '<apiKey>'}};

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

```go Processing extraction
package main

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

func main() {

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

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "<apiKey>")

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

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

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

}
```

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

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

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = '<apiKey>'

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

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

HttpResponse<String> response = Unirest.get("https://api.plextera.com/api/public/v1/document-insights/extractions/extractionId")
  .header("Authorization", "<apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.plextera.com/api/public/v1/document-insights/extractions/extractionId', [
  'headers' => [
    'Authorization' => '<apiKey>',
  ],
]);

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

```csharp Processing extraction
using RestSharp;

var client = new RestClient("https://api.plextera.com/api/public/v1/document-insights/extractions/extractionId");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Processing extraction
import Foundation

let headers = ["Authorization": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.plextera.com/api/public/v1/document-insights/extractions/extractionId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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()
```

### Completed extraction

**Response**

```json
{
  "id": "69654f0bc073ef404baec649",
  "status": "COMPLETED",
  "outputAvailable": true,
  "createdAt": "2026-04-07T10:05:04Z",
  "updatedAt": "2026-04-07T10:22:00Z",
  "completedAt": "2026-04-07T10:22:00Z",
  "labels": {
    "customerDocumentId": "doc-42",
    "docType": "invoice"
  },
  "document": {
    "fileId": "file_01JY7M4ZVX5R1P3M3Q0TA1S7ZM",
    "fileName": "invoice.pdf",
    "mimeType": "application/pdf",
    "size": 63877,
    "pageCount": 1,
    "contentUrl": "https://files.plextera.com/acme/2026/04/07/invoice_9f1c8b2e.pdf?Expires=1775900000&KeyName=cdn-key&Signature=Zm9vYmFyc2lnbmF0dXJl"
  },
  "output": {
    "fieldCount": 5,
    "fields": [
      {
        "name": "vendorName",
        "type": "text",
        "id": "field_01",
        "value": "Acme Industries Ltd",
        "metadata": {
          "extracted": true,
          "confidence": 1,
          "page": 1,
          "placement": {
            "x": 43,
            "y": 12,
            "width": 22,
            "height": 4
          }
        }
      },
      {
        "name": "invoiceNumber",
        "type": "text",
        "id": "field_02",
        "value": "INV-0042",
        "metadata": {
          "extracted": true,
          "confidence": 0.98,
          "page": 1,
          "placement": {
            "x": 316,
            "y": 48,
            "width": 147,
            "height": 10
          }
        }
      },
      {
        "name": "totalAmount",
        "type": "text",
        "id": "field_03",
        "value": "1,024.33 USD",
        "metadata": {
          "extracted": true,
          "confidence": 0.99,
          "page": 1,
          "placement": {
            "x": 316,
            "y": 209,
            "width": 147,
            "height": 10
          }
        }
      },
      {
        "name": "lineItems",
        "type": "group",
        "id": "field_04",
        "value": [
          {
            "id": "field_04_01",
            "metadata": {
              "confidence": 0.96,
              "extracted": true,
              "page": 1,
              "placement": {
                "height": 10,
                "width": 220,
                "x": 43,
                "y": 340
              }
            },
            "name": "description",
            "type": "text",
            "value": "Consulting services"
          }
        ],
        "metadata": {
          "extracted": true,
          "placement": {
            "x": -1,
            "y": -1,
            "width": -1,
            "height": -1
          }
        }
      }
    ]
  }
}
```

**SDK Code**

```python Completed extraction
import requests

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

headers = {"Authorization": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Completed extraction
const url = 'https://api.plextera.com/api/public/v1/document-insights/extractions/extractionId';
const options = {method: 'GET', headers: {Authorization: '<apiKey>'}};

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

```go Completed extraction
package main

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

func main() {

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

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "<apiKey>")

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

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

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

}
```

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

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

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = '<apiKey>'

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

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

HttpResponse<String> response = Unirest.get("https://api.plextera.com/api/public/v1/document-insights/extractions/extractionId")
  .header("Authorization", "<apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.plextera.com/api/public/v1/document-insights/extractions/extractionId', [
  'headers' => [
    'Authorization' => '<apiKey>',
  ],
]);

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

```csharp Completed extraction
using RestSharp;

var client = new RestClient("https://api.plextera.com/api/public/v1/document-insights/extractions/extractionId");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Completed extraction
import Foundation

let headers = ["Authorization": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.plextera.com/api/public/v1/document-insights/extractions/extractionId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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()
```

### Failed extraction

**Response**

```json
{
  "id": "69654f0bc073ef404baec649",
  "status": "FAILED",
  "outputAvailable": false,
  "createdAt": "2026-04-07T10:05:04Z",
  "updatedAt": "2026-04-07T10:18:00Z",
  "completedAt": "2026-04-07T10:18:00Z",
  "error": {
    "code": "DOCUMENT_EXTRACTION_FAILED",
    "message": "The document could not be processed."
  },
  "labels": {
    "customerDocumentId": "doc-42",
    "docType": "invoice"
  },
  "document": {
    "fileId": "file_01JY7M4ZVX5R1P3M3Q0TA1S7ZM",
    "fileName": "invoice.pdf",
    "mimeType": "application/pdf"
  }
}
```

**SDK Code**

```python Failed extraction
import requests

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

headers = {"Authorization": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Failed extraction
const url = 'https://api.plextera.com/api/public/v1/document-insights/extractions/extractionId';
const options = {method: 'GET', headers: {Authorization: '<apiKey>'}};

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

```go Failed extraction
package main

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

func main() {

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

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "<apiKey>")

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

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

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

}
```

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

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

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = '<apiKey>'

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

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

HttpResponse<String> response = Unirest.get("https://api.plextera.com/api/public/v1/document-insights/extractions/extractionId")
  .header("Authorization", "<apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.plextera.com/api/public/v1/document-insights/extractions/extractionId', [
  'headers' => [
    'Authorization' => '<apiKey>',
  ],
]);

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

```csharp Failed extraction
using RestSharp;

var client = new RestClient("https://api.plextera.com/api/public/v1/document-insights/extractions/extractionId");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Failed extraction
import Foundation

let headers = ["Authorization": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.plextera.com/api/public/v1/document-insights/extractions/extractionId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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()
```

### Rejected extraction

**Response**

```json
{
  "id": "69654f0bc073ef404baec649",
  "status": "REJECTED",
  "outputAvailable": false,
  "createdAt": "2026-04-07T10:05:04Z",
  "updatedAt": "2026-04-07T10:05:20Z",
  "completedAt": "2026-04-07T10:05:20Z",
  "error": {
    "code": "DOCUMENT_REJECTED",
    "message": "Duplicate document. Original document ID: 69654f0bc073ef404baec600"
  },
  "labels": {
    "customerDocumentId": "doc-42",
    "docType": "invoice"
  }
}
```

**SDK Code**

```python Rejected extraction
import requests

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

headers = {"Authorization": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Rejected extraction
const url = 'https://api.plextera.com/api/public/v1/document-insights/extractions/extractionId';
const options = {method: 'GET', headers: {Authorization: '<apiKey>'}};

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

```go Rejected extraction
package main

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

func main() {

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

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "<apiKey>")

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

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

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

}
```

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

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

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = '<apiKey>'

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

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

HttpResponse<String> response = Unirest.get("https://api.plextera.com/api/public/v1/document-insights/extractions/extractionId")
  .header("Authorization", "<apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.plextera.com/api/public/v1/document-insights/extractions/extractionId', [
  'headers' => [
    'Authorization' => '<apiKey>',
  ],
]);

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

```csharp Rejected extraction
using RestSharp;

var client = new RestClient("https://api.plextera.com/api/public/v1/document-insights/extractions/extractionId");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Rejected extraction
import Foundation

let headers = ["Authorization": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.plextera.com/api/public/v1/document-insights/extractions/extractionId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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()
```

### Document not routed

**Response**

```json
{
  "id": "69654f0bc073ef404baec650",
  "status": "FAILED",
  "outputAvailable": false,
  "createdAt": "2026-04-07T10:05:04Z",
  "updatedAt": "2026-04-07T10:05:20Z",
  "completedAt": "2026-04-07T10:05:20Z",
  "error": {
    "code": "DOCUMENT_NOT_ROUTED",
    "message": "No Document Insights configuration matched this document. Verify labels.docType or contact your workspace administrator."
  },
  "labels": {
    "docType": "unknown-document-type"
  }
}
```

**SDK Code**

```python Document not routed
import requests

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

headers = {"Authorization": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Document not routed
const url = 'https://api.plextera.com/api/public/v1/document-insights/extractions/extractionId';
const options = {method: 'GET', headers: {Authorization: '<apiKey>'}};

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

```go Document not routed
package main

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

func main() {

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

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "<apiKey>")

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

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

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

}
```

```ruby Document not routed
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = '<apiKey>'

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

```java Document not routed
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.plextera.com/api/public/v1/document-insights/extractions/extractionId")
  .header("Authorization", "<apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.plextera.com/api/public/v1/document-insights/extractions/extractionId', [
  'headers' => [
    'Authorization' => '<apiKey>',
  ],
]);

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

```csharp Document not routed
using RestSharp;

var client = new RestClient("https://api.plextera.com/api/public/v1/document-insights/extractions/extractionId");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Document not routed
import Foundation

let headers = ["Authorization": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.plextera.com/api/public/v1/document-insights/extractions/extractionId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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()
```