<!-- https://staircase.co/platform/data/ml -->
# ML

# ML

Document and image models: signature detection, hosted document extraction, and the training-data pipelines behind them.

Two model families. Signature detection answers whether a page carries a signature and where, which is what makes an executed-document check automatic. Document extraction reads fields from a page image.

Training data comes from a labelling pipeline that annotates real mortgage documents rather than generated ones, and accuracy per vendor and per document type is reported by Document.

## How it works

Hosting a vendor's extraction engine rather than calling its API was a deliberate option, and the deployment path for it is Host. The choice turns on where the document is allowed to be, not on which is easier to integrate.

## Operations

<!--source:api-specifications-->

### AWSDocumentAI
<!--/source-->

`POST` `/document`

<!--source:api-specifications-->

#### OCR process document
<!--/source-->

`document`

<!--source:api-specifications-->
Long-running operation endpoint to process document by AWS Textract OCR.

<!--/source-->

##### Request

<!--source:api-specifications-->
application/json Copy An example of a batch request. Presigned URLs shown here are just examples, you need to provide valid and active Presigned URLs when making the request.

```
{
 "urls": [
 "https://somebucketname.s3.us-east-1.amazonaws.com/test.pdf?X-Amz-Algorithm=<redacted>&X-Amz-Credential=<redacted>%2F20180210%2Feu-west-2%2Fs3%2Faws4_request&X-Amz-Date=<redacted>&X-Amz-Expires=1800&X-Amz-Signature=<redacted>&X-Amz-SignedHeaders=host",
 "https://somebucketname.s3.us-east-1.amazonaws.com/MultiDocs_10_pages.pdf?X-Amz-Algorithm=<redacted>&X-Amz-Credential=<redacted>%2F20180210%2Feu-west-2%2Fs3%2Faws4_request&X-Amz-Date=<redacted>&X-Amz-Expires=1800&X-Amz-Signature=<redacted>&X-Amz-SignedHeaders=host",
 "https://somebucketname.s3.us-east-1.amazonaws.com/Form1040_Leo.pdf?X-Amz-Algorithm=<redacted>&X-Amz-Credential=<redacted>%2F20180210%2Feu-west-2%2Fs3%2Faws4_request&X-Amz-Date=<redacted>&X-Amz-Expires=1800&X-Amz-Signature=<redacted>&X-Amz-SignedHeaders=host"
 ]
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
200400 application/json400 text/html401403
<!--/source-->

<!--source:api-specifications-->
application/json Copy Ok.

```
{
 "documents_info": [
 {
 "uuid": "2db2abe018862e9c4e4cf340696da14ecf3ff37ba153d68ab6796433468e5e48",
 "url": "https://files.consumerfinance.gov/f/201311_cfpb_kbyo_closing-disclosure.pdf"
 }
 ]
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Request.

```
{
 "code": "Bad Request",
 "message": "Bad request syntax or unsupported method"
}
```

<!--/source-->

<!--source:api-specifications-->
text/html Copy Bad Request.

```
Bad request syntax or unsupported method
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Unauthorized.

```
{
 "code": "401",
 "message": "This token is not valid for this service."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Forbidden

```
{
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post",
 "message": "This key is not valid for this service."
}
```

<!--/source-->

##### Request body`application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `urls`required | `string[]` | <!--source:api-specifications-->One or more Presigned URLs of PDFs to extract data from.<!--/source--> |
| `processor` | `string` | <!--source:api-specifications-->Name of AWS DocumentAI processor to be used for data extraction<!--/source-->Example `irs_w2` |

##### Response `200``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Ok.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `documents_info` | `object[]` | <!--source:api-specifications-->Array of IDs for query results of OCR.<!--/source--> |
| `uuids` | `object` | <!--source:api-specifications-->UUIDs associated with the documents being processed as part of the batch.<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Request.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Bad Request error.<!--/source--> |
| `code`required | `one of` | <!--source:api-specifications-->Bad Request<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `401``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unauthorized.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unauthorized error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Forbidden
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `url` | `string` | <!--source:api-specifications-->The URL.<!--/source--> |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |

##### Response `422``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unprocessable entity
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

`GET` `/test-model/{job_id}`

<!--source:api-specifications-->

#### Retrieve Extracted Data
<!--/source-->

`test-model-status`

<!--source:api-specifications-->
Get test train document status
<!--/source-->

<!--source:api-specifications-->
This service allows getting result of test model.

<!--/source-->

##### Response

<!--source:api-specifications-->
200401403404
<!--/source-->

<!--source:api-specifications-->
application/json Copy Ok.

```
{
 "code": 200,
 "pages": [
 {
 "num": 1,
 "width": 612,
 "height": 792,
 "id": "01FQ1V5WYZCKMAZ0DQQNTVPC3C"
 }
 ],
 "annotations": [
 {
 "annotation_spec_id": 5708576960238584000,
 "display_name": "has_social_security_number",
 "text_extraction": {
 "score": 0.9998301267623901,
 "text_segment": {
 "start_offset": 86,
 "end_offset": 96,
 "content": "123-45-678"
 }
 },
 "page": "01FQ1V5WYZCKMAZ0DQQNTVPC3C",
 "bounding_box": {
 "top_ratio": 0.7323232293128967,
 "left_ratio": 0.4901960790157318,
 "height_ratio": 0.012626290321350098,
 "width_ratio": 0.09477123618125916
 }
 }
 ],
 "document_text": "For Official Use Only\nOMB No. XXXXXXX\n22222\na Employee's social security number\nVoid\n123-45-678",
 "transaction_id": "df5039ba-c650-4e73-8b0a-af6e0b031c15",
 "train_product_id": "01FQBA6JJNHHN57RBKP0VZPYV4",
 "processed_pages_count": 8,
 "units": 33
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Unauthorized.

```
{
 "code": "401",
 "message": "This token is not valid for this service."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Forbidden

```
{
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post",
 "message": "This key is not valid for this service."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy File not found

```
{
 "code": "Not Found",
 "message": "Nothing matches the given URI"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `job_id` required | `string` path | `d8b01c18-10f7-4a71-962-43eeaed5ae6b` | <!--source:api-specifications-->Job ID of the test document operation.<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
8 fields
<!--/source-->
<!--source:api-specifications-->
Ok.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `code` | `number` | <!--source:api-specifications-->Test model status code.<!--/source-->Example `200` |
| `pages` | `object[]` | <!--source:api-specifications-->List of pages.<!--/source--> |
| `id` | `string` | <!--source:api-specifications-->Unique page identifier.<!--/source-->Example `01FQ1V5WYZMGW5SQTKQH1DSMTX` |
| `num` | `number` | <!--source:api-specifications-->Page number.<!--/source-->Example `1` |
| `width` | `number` | <!--source:api-specifications-->Page width in points.<!--/source-->Example `612` |
| `height` | `number` | <!--source:api-specifications-->Page height in points.<!--/source-->Example `792` |
| `annotations` | `object[]` | <!--source:api-specifications-->Annotations elements<!--/source--> |
| `annotation_spec_id` | `integer` | <!--source:api-specifications-->Annotation identification.<!--/source--> |
| `display_name` | `string` | <!--source:api-specifications-->Annotation name.<!--/source--> |
| `text_extraction` | `object` | <!--source:api-specifications-->Extraction object.<!--/source--> |
| `score` | `number` | <!--source:api-specifications-->Annotation score.<!--/source--> |
| `text_segment` | `object` | <!--source:api-specifications-->Text Segment object.<!--/source--> |
| `start_offset` | `integer` | <!--source:api-specifications-->Character offsets rather than byte offsets.<!--/source--> |
| `end_offset` | `integer` | <!--source:api-specifications-->Character offsets rather than byte offsets.<!--/source--> |
| `content` | `string` | <!--source:api-specifications-->Annotation content.<!--/source--> |
| `page` | `string` | <!--source:api-specifications-->Page identifier.<!--/source-->Example `01FQ1V5WYZMGW5SQTKQH1DSMTX` |
| `bounding_box` | `object` | <!--source:api-specifications-->Bounding boxes of extracted text.<!--/source--> |
| `top_ratio` | `number` | <!--source:api-specifications-->Top ratio of bounding box<!--/source-->Example `0.7462121248245239` |
| `left_ratio` | `number` | <!--source:api-specifications-->Left ratio of bounding box<!--/source-->Example `0.779411792755127` |
| `height_ratio` | `number` | <!--source:api-specifications-->Height ratio of bounding box<!--/source-->Example `0.010101020336151123` |
| `width_ratio` | `number` | <!--source:api-specifications-->Width ratio of bounding box<!--/source-->Example `0.026143789291381836` |
| `train_product_id` | `string` | <!--source:api-specifications-->Unique train product execution ID.<!--/source-->Example `01FQBA6JJNHHN57RBKP0VZPYV4` |
| `transaction_id` | `string` | <!--source:api-specifications-->Transaction ID for the generated health metrics.<!--/source-->Example `df5039ba-c650-4e73-8b0a-af6e0b031c15` |
| `document_text` | `string` | <!--source:api-specifications-->Content of extract file.<!--/source-->Example `For Official Use Only OMB No. XXXXXXX 22222 a Employee's social security number Void 123-45-678` |
| `processed_pages_count` | `number` | <!--source:api-specifications-->Count of processed pages. It can be the same or less than in the original document.<!--/source-->Example `8` |
| `units` | `number` | <!--source:api-specifications-->Count of comprehend units used for extraction.<!--/source-->Example `33` |

##### Response `401``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unauthorized.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unauthorized error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Forbidden
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `url` | `string` | <!--source:api-specifications-->The URL.<!--/source--> |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
File not found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->File not found error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `422``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unprocessable entity
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Reason why document was not extracted.<!--/source-->Example `Test model result contains overlapped annotations` |

`POST` `/generate-gs`

<!--source:api-specifications-->

#### Convert GTL and OCR to annotations
<!--/source-->

`generate-gs`

<!--source:api-specifications-->
Convert GTL and OCR input to annotations. Annotations will be used for training models for AWS Comprehend.
<!--/source-->

##### Request

<!--source:api-specifications-->
application/json Copy
```
{
 "gtl": {
 "documents": [
 {
 "@type": "closing_disclosure"
 }
 ]
 },
 "gc_presigned_download_urls": [
 "https://dev-data-manager-blobs-bucket-us-east-1-1111111.s3.amazonaws.com/foo.json?"
 ]
}
```

<!--/source-->

##### Request body`application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `gtl`required | `object` | <!--source:api-specifications-->Input from GTL<!--/source--> |
| `documents` | `object[]` | <!--source:api-specifications-->Array of documents from GTL<!--/source--> |
| `@type`required | `string` | <!--source:api-specifications-->Document type<!--/source-->Example `closing_disclosure` |
| `gc_presigned_download_urls`required | `string[]` | <!--source:api-specifications-->Presigned URL for document<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Successful response.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `annotations` | `object[]` | <!--source:api-specifications-->Array of labels, contains label name, value, GTL value and text segment info.<!--/source--> |
| `displayName` | `string` | <!--source:api-specifications-->Data point (label) name<!--/source--> |
| `value` | `string` | <!--source:api-specifications-->Value for this data point<!--/source--> |
| `gtlValue` | `string` | <!--source:api-specifications-->GTL value for this data point, usually V2 output<!--/source--> |
| `textExtraction` | `object` | <!--source:api-specifications-->Data about where this data point is located in document<!--/source--> |
| `page` | `number` | <!--source:api-specifications-->Page number<!--/source-->Example `1` |
| `textSegment` | `object` | <!--source:api-specifications-->Where data point text starts and ends.<!--/source--> |
| `startOffset` | `number` | <!--source:api-specifications-->Index of text start<!--/source--> |
| `endOffset` | `number` | <!--source:api-specifications-->Index of text end<!--/source--> |
| `document` | `object` | <!--source:api-specifications-->Data about text for each page in document<!--/source--> |
| `documentText` | `object` | <!--source:api-specifications-->Object with data for text extracted<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Incorrect payload
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Reason why request was not processed.<!--/source-->Example `Error on getting data from presigned URL` |

`GET` `/models`

<!--source:api-specifications-->

#### Retrieve Trained Models
<!--/source-->

`get-models`

<!--source:api-specifications-->
Get trained models
<!--/source-->

<!--source:api-specifications-->
This service allows getting a list of trained Comprehend models.

<!--/source-->

##### Response

<!--source:api-specifications-->
200401
<!--/source-->

<!--source:api-specifications-->
application/json Copy Ok.

```
{
 "count": 2,
 "models": [
 {
 "name": "mortgage-insurance-certificate",
 "versions": [
 {
 "name": "2022-05-12-10-25-09",
 "precision": 62.68656716417911,
 "annotations": [
 "has_organization_name",
 "has_insurance_policy_identifier",
 "has_insurance_policy_effective_date",
 "has_mortgage_insurance_premium_rate_percent",
 "has_mortgage_insurance_duration_type",
 "has_mortgage_insurance_premium_paid_by_type",
 "has_mortgage_insurance_coverage_percent",
 "has_mortgage_insurance_premium_refundable_type",
 "has_mortgage_insurance_premium_calculation_type",
 "has_mortgage_insurance_third_premium_rate_percent",
 "has_mortgage_insurance_subsequent_premium_rate_percent"
 ]
 }
 ]
 },
 {
 "name": "closing-disclosure",
 "versions": [
 {
 "name": "2022-05-12-13-49-36",
 "precision": 72.83441367118444,
 "annotations": [
 "applicant_document_date",
 "product",
 "loan_type",
 "sale_price",
 "interest_rate",
 "monthly_principal_interest",
 "mortgage_insurance_required",
 "property_taxes_in_escrow",
 "homeowners_insurance_in_escrow",
 "prepaid_property_taxes_months",
 "prepaid_property_taxes_amount",
 "loan_disclosures_assumption",
 "loan_disclosures_late_payment",
 "applicant_document_signature"
 ]
 },
 {
 "name": "2022-03-31-20-54-33",
 "precision": 58.03921568627452,
 "annotations": [
 "has_prepaid_taxes_months_count",
 "has_prepaid_taxes_amount",
 "has_assumability_indicator",
 "has_late_charge_type",
 "has_document_date",
 "has_loan_amortization_type",
 "has_mortgage_insurance_required_indicator",
 "has_tax_escrow_required_indicator",
 "has_hazard_insurance_escrow_required_indicator"
 ]
 }
 ]
 }
 ]
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Unauthorized.

```
{
 "code": "401",
 "message": "This token is not valid for this service."
}
```

<!--/source-->

##### Response `200``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Ok.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `count` | `number` | <!--source:api-specifications-->Count of trained models<!--/source-->Example `11` |
| `models` | `object[]` | <!--source:api-specifications-->List of models.<!--/source--> |
| `name` | `string` | <!--source:api-specifications-->Model name.<!--/source-->Example `closing-disclosure` |
| `versions` | `object[]` | <!--source:api-specifications-->List of versions.<!--/source--> |
| `name` | `string` | <!--source:api-specifications-->Version name.<!--/source-->Example `2022-05-12-10-25-09` |
| `precision` | `number` | <!--source:api-specifications-->Version precision.<!--/source-->Example `70.35830618892508` |
| `annotations` | `string[]` | <!--source:api-specifications-->List of trained annotations.<!--/source--> |
| `status` | `string` | <!--source:api-specifications-->Status of the version. Only trained or imported models are used for extraction.<!--/source-->Example `TRAINED` |
| `message` | `string` | <!--source:api-specifications-->Message about model version status.<!--/source-->Example `TRAINED` |

##### Response `401``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unauthorized.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unauthorized error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

`POST` `/setting`

<!--source:api-specifications-->

#### Settings
<!--/source-->

`settings`

<!--source:api-specifications-->
AWS Comprehend settings. Can be used for update inference units count to increase throughput. 1 inference unit corresponds to throughput in 100 characters per second.

<!--/source-->

##### Request

<!--source:api-specifications-->
application/json Copy
```
{
 "inference_units_count": 3
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
202400 application/json400 text/html403
<!--/source-->

<!--source:api-specifications-->
application/json Copy Request accepted.

```
{
 "message": "Settings have been successfully updated"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Request.

```
{
 "code": "Bad Request",
 "message": "Bad request syntax or unsupported method"
}
```

<!--/source-->

<!--source:api-specifications-->
text/html Copy Bad Request.

```
Bad request syntax or unsupported method
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Forbidden

```
{
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post",
 "message": "This key is not valid for this service."
}
```

<!--/source-->

##### Request body`application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `inference_units_count`required | `integer` | <!--source:api-specifications-->Comprehend inference units count.<!--/source--> |

##### Response `202``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Request accepted.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Response message<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Request.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Bad Request error.<!--/source--> |
| `code`required | `one of` | <!--source:api-specifications-->Bad Request<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Forbidden
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `url` | `string` | <!--source:api-specifications-->The URL.<!--/source--> |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |

<!--source:api-specifications-->

### ML
<!--/source-->

`POST` `/extract`

<!--source:api-specifications-->

#### Detect human signature
<!--/source-->

`detectSignature`

<!--source:api-specifications-->
Check if PDF contains a human written signature

<!--/source-->

##### Response

<!--source:api-specifications-->
200400 application/json400 text/html403
<!--/source-->

<!--source:api-specifications-->
application/json Copy Ok.

```
{
 "job_id": "WB6XV833KNWF0GZ7"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Request.

```
{
 "message": "Bad request syntax or unsupported method"
}
```

<!--/source-->

<!--source:api-specifications-->
text/html Copy Bad Request.

```
Bad request syntax or unsupported method
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Forbidden

```
{
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post",
 "message": "This key is not valid for this service."
}
```

<!--/source-->

##### Response `200``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Ok.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `job_id` | `string` | <!--source:api-specifications-->Extraction job ID<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Request.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Forbidden
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `url` | `string` | <!--source:api-specifications-->The URL.<!--/source--> |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |

`POST` `/extract/{job_id}`

<!--source:api-specifications-->

#### Detect human signature status
<!--/source-->

`detectSignatureStatus`

<!--source:api-specifications-->
Check status of extraction job

<!--/source-->

##### Response

<!--source:api-specifications-->
200400 application/json400 text/html403404
<!--/source-->

<!--source:api-specifications-->
application/json Copy Ok.

```
{
 "is_signed": true,
 "page": 7
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Request.

```
{
 "message": "Bad request syntax or unsupported method"
}
```

<!--/source-->

<!--source:api-specifications-->
text/html Copy Bad Request.

```
Bad request syntax or unsupported method
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Forbidden

```
{
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post",
 "message": "This key is not valid for this service."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Forbidden

```
{
 "message": "Extraction job not found"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `job_id` required | `string` path | `WB6XV833KNWF0GZ7` | <!--source:api-specifications-->Extraction Job ID.<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Ok.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `is_signed` | `boolean` | <!--source:api-specifications-->Is document signed<!--/source--> |
| `page` | `number` | <!--source:api-specifications-->Page with signature<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Request.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Forbidden
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `url` | `string` | <!--source:api-specifications-->The URL.<!--/source--> |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Forbidden
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |

<!--source:api-specifications-->

### Platform
<!--/source-->

`GET` `/products/train_data_extraction/response-schema`

<!--source:api-specifications-->

#### Retrieve Response Schema
<!--/source-->

`retrieveResponseSchema`

<!--source:api-specifications-->
Retrieve Schema retrieves a JSON schema for the response returned by the product. It can also return an example for the response output object through return_example attribute.

<!--/source-->

##### Response

<!--source:api-specifications-->
200400 InvalidReturnExamplesValue400 text/html403404 GetProduct404 text/html500
<!--/source-->

<!--source:api-specifications-->
application/json Copy Successfully returned the list of elements of response of the product waterfall.

```
{
 "addresses": [
 {
 "address_line_1_text": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "56319 Underwood Views",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1MQEN90HSCMPQWCAD",
 "has_bounding_box_height_ratio": 0.017272727272727273,
 "has_bounding_box_left_ratio": 0.07588235294117647,
 "has_bounding_box_top_ratio": 0.13863636363636364,
 "has_bounding_box_width_ratio": 0.23529411764705882,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "address_line_2_text": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "Lake Debramouth NE 33667-9751",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ110EKH48ZQEK3YQFF",
 "has_bounding_box_height_ratio": 0.015909090909090907,
 "has_bounding_box_left_ratio": 0.07352941176470588,
 "has_bounding_box_top_ratio": 0.15636363636363637,
 "has_bounding_box_width_ratio": 0.31411764705882356,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ],
 "documents": [
 {
 "@id": "01FBHN4YR48XC75HJF5Z9VRBTV",
 "@type": "irs_w2",
 "has_staircase_blob_identifier": {
 "has_value": "01FBHN11S8SF835QXB8M1EBZGG"
 },
 "with_page_extraction_metadata": [
 {
 "@id": "01FBHPXCJ03V0AAHVGW6G1YE08",
 "page_height": 2200,
 "page_number": 1,
 "page_width": 1700
 }
 ]
 }
 ],
 "employment": [
 {
 "retirement_plan_participant_indicator": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "x",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1BN0A4XXXG5ZSD8K0",
 "has_bounding_box_height_ratio": 0.013181818181818182,
 "has_bounding_box_left_ratio": 0.6194117647058823,
 "has_bounding_box_top_ratio": 0.26590909090909093,
 "has_bounding_box_width_ratio": 0.02,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ],
 "income": [
 {
 "allocated_tips_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "152406.79",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1ZTCHXGVK108FHVHE",
 "has_bounding_box_height_ratio": 0.016363636363636365,
 "has_bounding_box_left_ratio": 0.8182352941176471,
 "has_bounding_box_top_ratio": 0.17227272727272727,
 "has_bounding_box_width_ratio": 0.10058823529411764,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "dependent_care_benefits_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "219",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1MM5FMP6HGKC606ZD",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.8129411764705883,
 "has_bounding_box_top_ratio": 0.2018181818181818,
 "has_bounding_box_width_ratio": 0.04352941176470588,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "employer_state_1_identifier": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "678-77-709",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1W0SMD3JVDE47N116",
 "has_bounding_box_height_ratio": 0.015909090909090907,
 "has_bounding_box_left_ratio": 0.1288235294117647,
 "has_bounding_box_top_ratio": 0.3663636363636364,
 "has_bounding_box_width_ratio": 0.11411764705882353,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "employer_state_2_identifier": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "940-46-434",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ12M1K4ASVZBF68XHJ",
 "has_bounding_box_height_ratio": 0.017272727272727273,
 "has_bounding_box_left_ratio": 0.12823529411764706,
 "has_bounding_box_top_ratio": 0.39181818181818184,
 "has_bounding_box_width_ratio": 0.11588235294117646,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "federal_tax_withheld_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "40043.57",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1FE1EQ8X9Q3N12W4F",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.77,
 "has_bounding_box_top_ratio": 0.09181818181818181,
 "has_bounding_box_width_ratio": 0.09058823529411765,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12a_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "9966",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1P0KJ87SMG4T98B75",
 "has_bounding_box_height_ratio": 0.015454545454545455,
 "has_bounding_box_left_ratio": 0.8182352941176471,
 "has_bounding_box_top_ratio": 0.23318181818181818,
 "has_bounding_box_width_ratio": 0.05058823529411765,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12a_code": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "P",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1FF708969HFCH40NT",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.7847058823529411,
 "has_bounding_box_top_ratio": 0.23272727272727273,
 "has_bounding_box_width_ratio": 0.021176470588235293,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12b_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "284",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1VT54M1WB8JCK60N2",
 "has_bounding_box_height_ratio": 0.015454545454545455,
 "has_bounding_box_left_ratio": 0.8188235294117647,
 "has_bounding_box_top_ratio": 0.2636363636363636,
 "has_bounding_box_width_ratio": 0.04176470588235294,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12c_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "307",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1122YD0V4AVKZENYF",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.8176470588235294,
 "has_bounding_box_top_ratio": 0.295,
 "has_bounding_box_width_ratio": 0.03705882352941176,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12c_code": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "P",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ17CSM3TM4RXJ81SBQ",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.7817647058823529,
 "has_bounding_box_top_ratio": 0.29545454545454547,
 "has_bounding_box_width_ratio": 0.02823529411764706,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12d_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "242",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ14CVKQT2JE5BGCGCG",
 "has_bounding_box_height_ratio": 0.015454545454545455,
 "has_bounding_box_left_ratio": 0.8188235294117647,
 "has_bounding_box_top_ratio": 0.3277272727272727,
 "has_bounding_box_width_ratio": 0.03764705882352941,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12d_code": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "H",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ15PYMH0E9SDPSFAFS",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.7817647058823529,
 "has_bounding_box_top_ratio": 0.3286363636363636,
 "has_bounding_box_width_ratio": 0.02588235294117647,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "medicare_income_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "152406.79",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1FRRA33BQ5Y1WPBZB",
 "has_bounding_box_height_ratio": 0.015,
 "has_bounding_box_left_ratio": 0.5735294117647058,
 "has_bounding_box_top_ratio": 0.14772727272727273,
 "has_bounding_box_width_ratio": 0.09823529411764706,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "medicare_tax_withheld_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "4419.8",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ165FBQES8CNY03WXV",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.8176470588235294,
 "has_bounding_box_top_ratio": 0.14772727272727273,
 "has_bounding_box_width_ratio": 0.07176470588235294,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "nonqualified_retirement_plan_distribution_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "233",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1SH6XFDXZEW448H6A",
 "has_bounding_box_height_ratio": 0.015909090909090907,
 "has_bounding_box_left_ratio": 0.571764705882353,
 "has_bounding_box_top_ratio": 0.23272727272727273,
 "has_bounding_box_width_ratio": 0.04176470588235294,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "social_security_income_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "123655.86",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1MX04VCHK51H8RMF2",
 "has_bounding_box_height_ratio": 0.017272727272727273,
 "has_bounding_box_left_ratio": 0.571764705882353,
 "has_bounding_box_top_ratio": 0.11818181818181818,
 "has_bounding_box_width_ratio": 0.10705882352941176,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "social_security_tax_withheld_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "9459.67",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1X5EE4TPRBM2CH0M3",
 "has_bounding_box_height_ratio": 0.017272727272727273,
 "has_bounding_box_left_ratio": 0.768235294117647,
 "has_bounding_box_top_ratio": 0.11818181818181818,
 "has_bounding_box_width_ratio": 0.07882352941176471,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "social_security_tips_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "123655.86",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1P9044AEFH8EF6QT7",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.571764705882353,
 "has_bounding_box_top_ratio": 0.175,
 "has_bounding_box_width_ratio": 0.10470588235294118,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "wages_salaries_tips_and_other_compensation_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "126204.09",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1Y43WKTXBJJWHE106",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.571764705882353,
 "has_bounding_box_top_ratio": 0.08954545454545454,
 "has_bounding_box_width_ratio": 0.10588235294117647,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ],
 "mortgage_products": [
 {
 "@id": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "@type": "groundtruth_labeling",
 "has_service_request_date": {
 "has_value": "2021-07-26"
 },
 "has_service_response_date": {
 "has_value": "2021-07-26"
 },
 "product_used_for": "01FBHN4YR48XC75HJF5Z9VRBTV"
 }
 ],
 "organizations": [
 {
 "organization_identifier": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "39-3114215",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ0H5YE99DKRNXTVR5W",
 "has_bounding_box_height_ratio": 0.015454545454545455,
 "has_bounding_box_left_ratio": 0.08058823529411764,
 "has_bounding_box_top_ratio": 0.09136363636363637,
 "has_bounding_box_width_ratio": 0.12,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "organization_name": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "Carlson Group Group",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1NYMK9JRAAMF3GXRH",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.07470588235294118,
 "has_bounding_box_top_ratio": 0.11954545454545455,
 "has_bounding_box_width_ratio": 0.2211764705882353,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ],
 "people": [
 {
 "full_name": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "Taylor Cox",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1011XSCSZ76ZE1CX0",
 "has_bounding_box_height_ratio": 0.02181818181818182,
 "has_bounding_box_left_ratio": 0.07588235294117647,
 "has_bounding_box_top_ratio": 0.2381818181818182,
 "has_bounding_box_width_ratio": 0.13470588235294118,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "social_security_number": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "999-00-0000",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ0VCNHZCXPKJ3WY9C8",
 "has_bounding_box_height_ratio": 0.015909090909090907,
 "has_bounding_box_left_ratio": 0.26588235294117646,
 "has_bounding_box_top_ratio": 0.06363636363636363,
 "has_bounding_box_width_ratio": 0.1288235294117647,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ]
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Error

```
{
 "message": "Please provide one of valid return examples values: true, false"
}
```

<!--/source-->

<!--source:api-specifications-->
text/html Copy Error

```
<html>\r\n<head><title>400 Bad Request</title></head>\r\n<body>\r\n<center><h1>400 Bad Request</h1></center>\r\n</body>\r\n</html>\r\n
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy 403 invalid error

```
{
 "message": "Please check the key you used to call this service",
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Resource not found

```
{
 "description": "Error Message.",
 "type": "string"
}
```

<!--/source-->

<!--source:api-specifications-->
text/html Copy Resource not found

```
<html>\r\n<head><title>400 Bad Request</title></head>\r\n<body>\r\n<center><h1>400 Bad Request</h1></center>\r\n</body>\r\n</html>\r\n
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Internal server error

```
{
 "message": "The product has encountered an internal server error. If you have used a transaction_id to call our services, please submit it to Staircase support"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
2
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `x-api-key` required | `string` header | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` | <!--source:api-specifications-->The environment API key.<!--/source--> |
| `return_examples` | `boolean` query | `false` | <!--source:api-specifications-->If included and set to `true`, returns one or more pre-filled examples that conform to the schema. Default to `false`<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Successfully returned the list of elements of response of the product waterfall.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `schema` | `object` | <!--source:api-specifications-->Element key / value element<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Message<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
403 invalid error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |
| `url` | `string` | <!--source:api-specifications-->Error additional URL.<!--/source--> |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Resource not found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error Message.<!--/source--> |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Internal server error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |

`GET` `/transactions/{transaction_id}/collections`

<!--source:api-specifications-->

#### Retrieve Transaction Collections
<!--/source-->

`RetrieveTransactionCollections`

<!--source:api-specifications-->
Retrieve Transaction Collections returns the content of a given `collection_id` associated with a specific `transaction_id`.

<!--/source-->

##### Response

<!--source:api-specifications-->
200400403404500
<!--/source-->

<!--source:api-specifications-->
application/json Copy Transaction collection retrieved successfully

```
{
 "data": {}
}
```

<!--/source-->

<!--source:api-specifications-->
text/html Copy Error

```
<html>\r\n<head><title>400 Bad Request</title></head>\r\n<body>\r\n<center><h1>400 Bad Request</h1></center>\r\n</body>\r\n</html>\r\n
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy 403 invalid error

```
{
 "message": "Please check the key you used to call this service",
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Resource not found

```
{
 "message": "Unable to get collections of given transaction. Please check the transaction id"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Internal server error

```
{
 "message": "The product has encountered an internal server error. If you have used a transaction_id to call our services, please submit it to Staircase support"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
2
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `x-api-key` required | `string` header | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` | <!--source:api-specifications-->The environment API key.<!--/source--> |
| `transaction_id` required | `string (ulid)` path | `01F0KHK7DN3H5JZ4QJKMYAM6GB` | <!--source:api-specifications-->Staircase Transaction Identifier<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
4 fields
<!--/source-->
<!--source:api-specifications-->
Transaction collection retrieved successfully
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `collection_id` | `string (ulid)` | <!--source:api-specifications-->Collection id<!--/source-->Example `01EZQ32PJQGKRA6HR8D72Q9FFF` |
| `data` | `array` | <!--source:api-specifications-->The data<!--/source--> |
| `metadata` | `object` | <!--source:api-specifications-->Metadata about collection, f.e version of used Staircase schema<!--/source--> |
| `transaction_id` | `string (ulid)` | <!--source:api-specifications-->Transaction id<!--/source-->Example `01EZQ32PJQGKRA6HR8D72Q9FFF` |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `one of` | <!--source:api-specifications-->Either message object with more properties.<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
403 invalid error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |
| `url` | `string` | <!--source:api-specifications-->Error additional URL.<!--/source--> |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Resource not found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Message<!--/source--> |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Internal server error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |

`PUT` `/transactions/{transaction_id}/collections/{collection_id}`

<!--source:api-specifications-->

#### Update Collection
<!--/source-->

`updateCollection`

<!--source:api-specifications-->
Update Collection allows you to update the content of a given `collection_id` associated with a `transaction_id`.

<!--/source-->

##### Request

<!--source:api-specifications-->
application/json Copy
```
{
 "addresses": [
 {
 "address_line_1_text": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "56319 Underwood Views",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1MQEN90HSCMPQWCAD",
 "has_bounding_box_height_ratio": 0.017272727272727273,
 "has_bounding_box_left_ratio": 0.07588235294117647,
 "has_bounding_box_top_ratio": 0.13863636363636364,
 "has_bounding_box_width_ratio": 0.23529411764705882,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "address_line_2_text": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "Lake Debramouth NE 33667-9751",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ110EKH48ZQEK3YQFF",
 "has_bounding_box_height_ratio": 0.015909090909090907,
 "has_bounding_box_left_ratio": 0.07352941176470588,
 "has_bounding_box_top_ratio": 0.15636363636363637,
 "has_bounding_box_width_ratio": 0.31411764705882356,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ],
 "documents": [
 {
 "@id": "01FBHN4YR48XC75HJF5Z9VRBTV",
 "@type": "irs_w2",
 "has_staircase_blob_identifier": {
 "has_value": "01FBHN11S8SF835QXB8M1EBZGG"
 },
 "with_page_extraction_metadata": [
 {
 "@id": "01FBHPXCJ03V0AAHVGW6G1YE08",
 "page_height": 2200,
 "page_number": 1,
 "page_width": 1700
 }
 ]
 }
 ],
 "employment": [
 {
 "retirement_plan_participant_indicator": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "x",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1BN0A4XXXG5ZSD8K0",
 "has_bounding_box_height_ratio": 0.013181818181818182,
 "has_bounding_box_left_ratio": 0.6194117647058823,
 "has_bounding_box_top_ratio": 0.26590909090909093,
 "has_bounding_box_width_ratio": 0.02,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ],
 "income": [
 {
 "allocated_tips_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "152406.79",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1ZTCHXGVK108FHVHE",
 "has_bounding_box_height_ratio": 0.016363636363636365,
 "has_bounding_box_left_ratio": 0.8182352941176471,
 "has_bounding_box_top_ratio": 0.17227272727272727,
 "has_bounding_box_width_ratio": 0.10058823529411764,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "dependent_care_benefits_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "219",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1MM5FMP6HGKC606ZD",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.8129411764705883,
 "has_bounding_box_top_ratio": 0.2018181818181818,
 "has_bounding_box_width_ratio": 0.04352941176470588,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "employer_state_1_identifier": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "678-77-709",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1W0SMD3JVDE47N116",
 "has_bounding_box_height_ratio": 0.015909090909090907,
 "has_bounding_box_left_ratio": 0.1288235294117647,
 "has_bounding_box_top_ratio": 0.3663636363636364,
 "has_bounding_box_width_ratio": 0.11411764705882353,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "employer_state_2_identifier": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "940-46-434",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ12M1K4ASVZBF68XHJ",
 "has_bounding_box_height_ratio": 0.017272727272727273,
 "has_bounding_box_left_ratio": 0.12823529411764706,
 "has_bounding_box_top_ratio": 0.39181818181818184,
 "has_bounding_box_width_ratio": 0.11588235294117646,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "federal_tax_withheld_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "40043.57",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1FE1EQ8X9Q3N12W4F",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.77,
 "has_bounding_box_top_ratio": 0.09181818181818181,
 "has_bounding_box_width_ratio": 0.09058823529411765,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12a_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "9966",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1P0KJ87SMG4T98B75",
 "has_bounding_box_height_ratio": 0.015454545454545455,
 "has_bounding_box_left_ratio": 0.8182352941176471,
 "has_bounding_box_top_ratio": 0.23318181818181818,
 "has_bounding_box_width_ratio": 0.05058823529411765,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12a_code": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "P",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1FF708969HFCH40NT",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.7847058823529411,
 "has_bounding_box_top_ratio": 0.23272727272727273,
 "has_bounding_box_width_ratio": 0.021176470588235293,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12b_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "284",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1VT54M1WB8JCK60N2",
 "has_bounding_box_height_ratio": 0.015454545454545455,
 "has_bounding_box_left_ratio": 0.8188235294117647,
 "has_bounding_box_top_ratio": 0.2636363636363636,
 "has_bounding_box_width_ratio": 0.04176470588235294,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12c_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "307",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1122YD0V4AVKZENYF",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.8176470588235294,
 "has_bounding_box_top_ratio": 0.295,
 "has_bounding_box_width_ratio": 0.03705882352941176,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12c_code": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "P",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ17CSM3TM4RXJ81SBQ",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.7817647058823529,
 "has_bounding_box_top_ratio": 0.29545454545454547,
 "has_bounding_box_width_ratio": 0.02823529411764706,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12d_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "242",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ14CVKQT2JE5BGCGCG",
 "has_bounding_box_height_ratio": 0.015454545454545455,
 "has_bounding_box_left_ratio": 0.8188235294117647,
 "has_bounding_box_top_ratio": 0.3277272727272727,
 "has_bounding_box_width_ratio": 0.03764705882352941,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12d_code": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "H",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ15PYMH0E9SDPSFAFS",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.7817647058823529,
 "has_bounding_box_top_ratio": 0.3286363636363636,
 "has_bounding_box_width_ratio": 0.02588235294117647,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "medicare_income_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "152406.79",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1FRRA33BQ5Y1WPBZB",
 "has_bounding_box_height_ratio": 0.015,
 "has_bounding_box_left_ratio": 0.5735294117647058,
 "has_bounding_box_top_ratio": 0.14772727272727273,
 "has_bounding_box_width_ratio": 0.09823529411764706,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "medicare_tax_withheld_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "4419.8",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ165FBQES8CNY03WXV",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.8176470588235294,
 "has_bounding_box_top_ratio": 0.14772727272727273,
 "has_bounding_box_width_ratio": 0.07176470588235294,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "nonqualified_retirement_plan_distribution_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "233",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1SH6XFDXZEW448H6A",
 "has_bounding_box_height_ratio": 0.015909090909090907,
 "has_bounding_box_left_ratio": 0.571764705882353,
 "has_bounding_box_top_ratio": 0.23272727272727273,
 "has_bounding_box_width_ratio": 0.04176470588235294,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "social_security_income_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "123655.86",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1MX04VCHK51H8RMF2",
 "has_bounding_box_height_ratio": 0.017272727272727273,
 "has_bounding_box_left_ratio": 0.571764705882353,
 "has_bounding_box_top_ratio": 0.11818181818181818,
 "has_bounding_box_width_ratio": 0.10705882352941176,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "social_security_tax_withheld_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "9459.67",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1X5EE4TPRBM2CH0M3",
 "has_bounding_box_height_ratio": 0.017272727272727273,
 "has_bounding_box_left_ratio": 0.768235294117647,
 "has_bounding_box_top_ratio": 0.11818181818181818,
 "has_bounding_box_width_ratio": 0.07882352941176471,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "social_security_tips_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "123655.86",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1P9044AEFH8EF6QT7",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.571764705882353,
 "has_bounding_box_top_ratio": 0.175,
 "has_bounding_box_width_ratio": 0.10470588235294118,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "wages_salaries_tips_and_other_compensation_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "126204.09",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1Y43WKTXBJJWHE106",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.571764705882353,
 "has_bounding_box_top_ratio": 0.08954545454545454,
 "has_bounding_box_width_ratio": 0.10588235294117647,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ],
 "mortgage_products": [
 {
 "@id": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "@type": "groundtruth_labeling",
 "has_service_request_date": {
 "has_value": "2021-07-26"
 },
 "has_service_response_date": {
 "has_value": "2021-07-26"
 },
 "product_used_for": "01FBHN4YR48XC75HJF5Z9VRBTV"
 }
 ],
 "organizations": [
 {
 "organization_identifier": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "39-3114215",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ0H5YE99DKRNXTVR5W",
 "has_bounding_box_height_ratio": 0.015454545454545455,
 "has_bounding_box_left_ratio": 0.08058823529411764,
 "has_bounding_box_top_ratio": 0.09136363636363637,
 "has_bounding_box_width_ratio": 0.12,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "organization_name": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "Carlson Group Group",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1NYMK9JRAAMF3GXRH",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.07470588235294118,
 "has_bounding_box_top_ratio": 0.11954545454545455,
 "has_bounding_box_width_ratio": 0.2211764705882353,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ],
 "people": [
 {
 "full_name": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "Taylor Cox",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1011XSCSZ76ZE1CX0",
 "has_bounding_box_height_ratio": 0.02181818181818182,
 "has_bounding_box_left_ratio": 0.07588235294117647,
 "has_bounding_box_top_ratio": 0.2381818181818182,
 "has_bounding_box_width_ratio": 0.13470588235294118,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "social_security_number": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "999-00-0000",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ0VCNHZCXPKJ3WY9C8",
 "has_bounding_box_height_ratio": 0.015909090909090907,
 "has_bounding_box_left_ratio": 0.26588235294117646,
 "has_bounding_box_top_ratio": 0.06363636363636363,
 "has_bounding_box_width_ratio": 0.1288235294117647,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ]
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
200400 UpdateCollectionError400 text/html403404 UpdateCollectionError404 text/html500
<!--/source-->

<!--source:api-specifications-->
application/json Copy Collection updated successfully

```
{
 "addresses": [
 {
 "address_line_1_text": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "56319 Underwood Views",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1MQEN90HSCMPQWCAD",
 "has_bounding_box_height_ratio": 0.017272727272727273,
 "has_bounding_box_left_ratio": 0.07588235294117647,
 "has_bounding_box_top_ratio": 0.13863636363636364,
 "has_bounding_box_width_ratio": 0.23529411764705882,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "address_line_2_text": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "Lake Debramouth NE 33667-9751",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ110EKH48ZQEK3YQFF",
 "has_bounding_box_height_ratio": 0.015909090909090907,
 "has_bounding_box_left_ratio": 0.07352941176470588,
 "has_bounding_box_top_ratio": 0.15636363636363637,
 "has_bounding_box_width_ratio": 0.31411764705882356,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ],
 "documents": [
 {
 "@id": "01FBHN4YR48XC75HJF5Z9VRBTV",
 "@type": "irs_w2",
 "has_staircase_blob_identifier": {
 "has_value": "01FBHN11S8SF835QXB8M1EBZGG"
 },
 "with_page_extraction_metadata": [
 {
 "@id": "01FBHPXCJ03V0AAHVGW6G1YE08",
 "page_height": 2200,
 "page_number": 1,
 "page_width": 1700
 }
 ]
 }
 ],
 "employment": [
 {
 "retirement_plan_participant_indicator": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "x",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1BN0A4XXXG5ZSD8K0",
 "has_bounding_box_height_ratio": 0.013181818181818182,
 "has_bounding_box_left_ratio": 0.6194117647058823,
 "has_bounding_box_top_ratio": 0.26590909090909093,
 "has_bounding_box_width_ratio": 0.02,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ],
 "income": [
 {
 "allocated_tips_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "152406.79",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1ZTCHXGVK108FHVHE",
 "has_bounding_box_height_ratio": 0.016363636363636365,
 "has_bounding_box_left_ratio": 0.8182352941176471,
 "has_bounding_box_top_ratio": 0.17227272727272727,
 "has_bounding_box_width_ratio": 0.10058823529411764,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "dependent_care_benefits_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "219",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1MM5FMP6HGKC606ZD",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.8129411764705883,
 "has_bounding_box_top_ratio": 0.2018181818181818,
 "has_bounding_box_width_ratio": 0.04352941176470588,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "employer_state_1_identifier": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "678-77-709",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1W0SMD3JVDE47N116",
 "has_bounding_box_height_ratio": 0.015909090909090907,
 "has_bounding_box_left_ratio": 0.1288235294117647,
 "has_bounding_box_top_ratio": 0.3663636363636364,
 "has_bounding_box_width_ratio": 0.11411764705882353,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "employer_state_2_identifier": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "940-46-434",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ12M1K4ASVZBF68XHJ",
 "has_bounding_box_height_ratio": 0.017272727272727273,
 "has_bounding_box_left_ratio": 0.12823529411764706,
 "has_bounding_box_top_ratio": 0.39181818181818184,
 "has_bounding_box_width_ratio": 0.11588235294117646,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "federal_tax_withheld_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "40043.57",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1FE1EQ8X9Q3N12W4F",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.77,
 "has_bounding_box_top_ratio": 0.09181818181818181,
 "has_bounding_box_width_ratio": 0.09058823529411765,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12a_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "9966",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1P0KJ87SMG4T98B75",
 "has_bounding_box_height_ratio": 0.015454545454545455,
 "has_bounding_box_left_ratio": 0.8182352941176471,
 "has_bounding_box_top_ratio": 0.23318181818181818,
 "has_bounding_box_width_ratio": 0.05058823529411765,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12a_code": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "P",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1FF708969HFCH40NT",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.7847058823529411,
 "has_bounding_box_top_ratio": 0.23272727272727273,
 "has_bounding_box_width_ratio": 0.021176470588235293,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12b_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "284",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1VT54M1WB8JCK60N2",
 "has_bounding_box_height_ratio": 0.015454545454545455,
 "has_bounding_box_left_ratio": 0.8188235294117647,
 "has_bounding_box_top_ratio": 0.2636363636363636,
 "has_bounding_box_width_ratio": 0.04176470588235294,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12c_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "307",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1122YD0V4AVKZENYF",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.8176470588235294,
 "has_bounding_box_top_ratio": 0.295,
 "has_bounding_box_width_ratio": 0.03705882352941176,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12c_code": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "P",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ17CSM3TM4RXJ81SBQ",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.7817647058823529,
 "has_bounding_box_top_ratio": 0.29545454545454547,
 "has_bounding_box_width_ratio": 0.02823529411764706,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12d_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "242",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ14CVKQT2JE5BGCGCG",
 "has_bounding_box_height_ratio": 0.015454545454545455,
 "has_bounding_box_left_ratio": 0.8188235294117647,
 "has_bounding_box_top_ratio": 0.3277272727272727,
 "has_bounding_box_width_ratio": 0.03764705882352941,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12d_code": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "H",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ15PYMH0E9SDPSFAFS",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.7817647058823529,
 "has_bounding_box_top_ratio": 0.3286363636363636,
 "has_bounding_box_width_ratio": 0.02588235294117647,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "medicare_income_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "152406.79",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1FRRA33BQ5Y1WPBZB",
 "has_bounding_box_height_ratio": 0.015,
 "has_bounding_box_left_ratio": 0.5735294117647058,
 "has_bounding_box_top_ratio": 0.14772727272727273,
 "has_bounding_box_width_ratio": 0.09823529411764706,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "medicare_tax_withheld_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "4419.8",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ165FBQES8CNY03WXV",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.8176470588235294,
 "has_bounding_box_top_ratio": 0.14772727272727273,
 "has_bounding_box_width_ratio": 0.07176470588235294,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "nonqualified_retirement_plan_distribution_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "233",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1SH6XFDXZEW448H6A",
 "has_bounding_box_height_ratio": 0.015909090909090907,
 "has_bounding_box_left_ratio": 0.571764705882353,
 "has_bounding_box_top_ratio": 0.23272727272727273,
 "has_bounding_box_width_ratio": 0.04176470588235294,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "social_security_income_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "123655.86",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1MX04VCHK51H8RMF2",
 "has_bounding_box_height_ratio": 0.017272727272727273,
 "has_bounding_box_left_ratio": 0.571764705882353,
 "has_bounding_box_top_ratio": 0.11818181818181818,
 "has_bounding_box_width_ratio": 0.10705882352941176,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "social_security_tax_withheld_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "9459.67",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1X5EE4TPRBM2CH0M3",
 "has_bounding_box_height_ratio": 0.017272727272727273,
 "has_bounding_box_left_ratio": 0.768235294117647,
 "has_bounding_box_top_ratio": 0.11818181818181818,
 "has_bounding_box_width_ratio": 0.07882352941176471,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "social_security_tips_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "123655.86",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1P9044AEFH8EF6QT7",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.571764705882353,
 "has_bounding_box_top_ratio": 0.175,
 "has_bounding_box_width_ratio": 0.10470588235294118,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "wages_salaries_tips_and_other_compensation_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "126204.09",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1Y43WKTXBJJWHE106",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.571764705882353,
 "has_bounding_box_top_ratio": 0.08954545454545454,
 "has_bounding_box_width_ratio": 0.10588235294117647,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ],
 "mortgage_products": [
 {
 "@id": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "@type": "groundtruth_labeling",
 "has_service_request_date": {
 "has_value": "2021-07-26"
 },
 "has_service_response_date": {
 "has_value": "2021-07-26"
 },
 "product_used_for": "01FBHN4YR48XC75HJF5Z9VRBTV"
 }
 ],
 "organizations": [
 {
 "organization_identifier": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "39-3114215",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ0H5YE99DKRNXTVR5W",
 "has_bounding_box_height_ratio": 0.015454545454545455,
 "has_bounding_box_left_ratio": 0.08058823529411764,
 "has_bounding_box_top_ratio": 0.09136363636363637,
 "has_bounding_box_width_ratio": 0.12,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "organization_name": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "Carlson Group Group",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1NYMK9JRAAMF3GXRH",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.07470588235294118,
 "has_bounding_box_top_ratio": 0.11954545454545455,
 "has_bounding_box_width_ratio": 0.2211764705882353,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ],
 "people": [
 {
 "full_name": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "Taylor Cox",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1011XSCSZ76ZE1CX0",
 "has_bounding_box_height_ratio": 0.02181818181818182,
 "has_bounding_box_left_ratio": 0.07588235294117647,
 "has_bounding_box_top_ratio": 0.2381818181818182,
 "has_bounding_box_width_ratio": 0.13470588235294118,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "social_security_number": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "999-00-0000",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ0VCNHZCXPKJ3WY9C8",
 "has_bounding_box_height_ratio": 0.015909090909090907,
 "has_bounding_box_left_ratio": 0.26588235294117646,
 "has_bounding_box_top_ratio": 0.06363636363636363,
 "has_bounding_box_width_ratio": 0.1288235294117647,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ]
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Error

```
{
 "description": "Error details.",
 "message": "Unable to update collection. Please check the collection data"
}
```

<!--/source-->

<!--source:api-specifications-->
text/html Copy Error

```
<html>\r\n<head><title>400 Bad Request</title></head>\r\n<body>\r\n<center><h1>400 Bad Request</h1></center>\r\n</body>\r\n</html>\r\n
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy 403 invalid error

```
{
 "message": "Please check the key you used to call this service",
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Resource not found

```
{
 "message": "Unable to update collection. Please check the given ids"
}
```

<!--/source-->

<!--source:api-specifications-->
text/html Copy Resource not found

```
<html>\r\n<head><title>400 Bad Request</title></head>\r\n<body>\r\n<center><h1>400 Bad Request</h1></center>\r\n</body>\r\n</html>\r\n
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Internal server error

```
{
 "message": "The product has encountered an internal server error. If you have used a transaction_id to call our services, please submit it to Staircase support"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
3
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `x-api-key` required | `string` header | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` | <!--source:api-specifications-->The environment API key.<!--/source--> |
| `transaction_id` required | `string (ulid)` path | `01F0KHK7DN3H5JZ4QJKMYAM6GB` | <!--source:api-specifications-->Staircase Transaction Identifier<!--/source--> |
| `collection_id` required | `string (ulid)` path | `01F0KHKADN0HRFXMCQQXPA6AFZ` | <!--source:api-specifications-->Staircase collection_id<!--/source--> |

##### Request body`application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `data` | `object` | <!--source:api-specifications-->The data object<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Collection updated successfully
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `data` | `object` | <!--source:api-specifications-->The data object<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `one of` | <!--source:api-specifications-->Either message object with more properties.<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
403 invalid error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |
| `url` | `string` | <!--source:api-specifications-->Error additional URL.<!--/source--> |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Resource not found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Message<!--/source--> |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Internal server error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |

<!--source:api-specifications-->

### DocumentAI
<!--/source-->

`POST` `/setup-credentials`

<!--source:api-specifications-->

#### Set Up Google Cloud Account Credentials
<!--/source-->

`setup-credentials`

<!--source:api-specifications-->
Setup Google Cloud service account credentials
<!--/source-->

<!--source:api-specifications-->
Setup Google Cloud credentials in the form of a service account key in order to authenticate an application as a service account.

<!--/source-->

##### Request

<!--source:api-specifications-->
application/json Copy An example of a Google Cloud service account key. The key shown is just an example, you need to provide a valid key in order to use the service.

```
{
 "type": "service_account",
 "project_id": "my-great-project-1234560",
 "private_key_id": "aeb28addda999e5dde66de00041a1fd99ed7e4a32",
 "private_key": "<redacted>",
 "client_email": "name-of-the-service-account@my-great-project-1234560.iam.gserviceaccount.com",
 "client_id": "378463746364563353673",
 "auth_uri": "https://accounts.google.com/o/oauth2/auth",
 "token_uri": "https://oauth2.googleapis.com/token",
 "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
 "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/name-of-the-service-account%40my-great-project-1234560.iam.gserviceaccount.com"
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
200400 application/json400 text/html401403408409500501502503
<!--/source-->

<!--source:api-specifications-->
application/json Copy Ok.

```
{
 "code": "200",
 "message": "The credentials have been saved."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Request.

```
{
 "code": "Bad Request",
 "message": "Bad request syntax or unsupported method"
}
```

<!--/source-->

<!--source:api-specifications-->
text/html Copy Bad Request.

```
Bad request syntax or unsupported method
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Unauthorized.

```
{
 "code": "401",
 "message": "This token is not valid for this service."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Forbidden

```
{
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post",
 "message": "This key is not valid for this service."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Request Timeout.

```
{
 "code": "408",
 "message": "SoftworksAI partner is not available."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Conflict

```
{
 "code": "409",
 "message": "Batch already exists"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Internal Server Error

```
{
 "code": "500",
 "message": "Internal Server Error"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Not Implemented

```
{
 "code": "501",
 "message": "Error"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Gateway

```
{
 "code": "502",
 "message": "Error"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Service Unavailable

```
{
 "code": "503",
 "message": "Error"
}
```

<!--/source-->

##### Request body`application/json`

<!--source:api-specifications-->
10 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `type`required | `string` | <!--source:api-specifications-->The type of member this key is for.<!--/source-->Example `service_account` |
| `project_id`required | `string` | <!--source:api-specifications-->The project identifier.<!--/source-->Example `my-great-project-1234560` |
| `private_key_id`required | `string` | <!--source:api-specifications-->The project key identifier.<!--/source-->Example `aeb28addda999e5dde66de00041a1fd99ed7e4a32` |
| `private_key`required | `string` | <!--source:api-specifications-->The private key contents.<!--/source-->Example `<redacted>` |
| `client_email`required | `string` | <!--source:api-specifications-->The client emails.<!--/source-->Example `name-of-the-service-account@my-great-project-1234560.iam.gserviceaccount.com` |
| `client_id`required | `string` | <!--source:api-specifications-->The client id.<!--/source-->Example `378463746364563353673` |
| `auth_uri`required | `string` | <!--source:api-specifications-->The authorization URI.<!--/source-->Example `https://accounts.google.com/o/oauth2/auth` |
| `token_uri`required | `string` | <!--source:api-specifications-->The token URI.<!--/source-->Example `https://oauth2.googleapis.com/token` |
| `auth_provider_x509_cert_url`required | `string` | <!--source:api-specifications-->The URL of the public x509 certificate provider.<!--/source-->Example `https://www.googleapis.com/oauth2/v1/certs` |
| `client_x509_cert_url`required | `string` | <!--source:api-specifications-->The RL of the public x509 certificate.<!--/source-->Example `https://www.googleapis.com/robot/v1/metadata/x509/name-of-the-service-account%40my-great-project-1234560.iam.gserviceaccount.com` |

##### Response `200``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Ok.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `code` | `string` | <!--source:api-specifications-->Status code.<!--/source--> |
| `message` | `string` | <!--source:api-specifications-->The message.<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Request.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Bad Request error.<!--/source--> |
| `code`required | `one of` | <!--source:api-specifications-->Bad Request<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `401``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unauthorized.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unauthorized error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Forbidden
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `url` | `string` | <!--source:api-specifications-->The URL.<!--/source--> |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |

##### Response `408``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Request Timeout.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Timeout error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `409``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Conflict
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `422``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unprocessable entity
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Internal Server Error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `501``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Not Implemented
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `502``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Gateway
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `503``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Service Unavailable
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

`POST` `/batch-process-document`

<!--source:api-specifications-->

#### Process Batch
<!--/source-->

`new-batch`

<!--source:api-specifications-->
Long-running operation endpoint to batch process many documents.

<!--/source-->

##### Request

<!--source:api-specifications-->
application/json Copy An example of a batch request. Presigned URLs shown here are just examples, you need to provide valid and active Presigned URLs when making the request.

```
{
 "urls": [
 "https://somebucketname.s3.us-east-1.amazonaws.com/test.pdf?X-Amz-Algorithm=<redacted>&X-Amz-Credential=<redacted>%2F20180210%2Feu-west-2%2Fs3%2Faws4_request&X-Amz-Date=<redacted>&X-Amz-Expires=1800&X-Amz-Signature=<redacted>&X-Amz-SignedHeaders=host",
 "https://somebucketname.s3.us-east-1.amazonaws.com/MultiDocs_10_pages.pdf?X-Amz-Algorithm=<redacted>&X-Amz-Credential=<redacted>%2F20180210%2Feu-west-2%2Fs3%2Faws4_request&X-Amz-Date=<redacted>&X-Amz-Expires=1800&X-Amz-Signature=<redacted>&X-Amz-SignedHeaders=host",
 "https://somebucketname.s3.us-east-1.amazonaws.com/Form1040_Leo.pdf?X-Amz-Algorithm=<redacted>&X-Amz-Credential=<redacted>%2F20180210%2Feu-west-2%2Fs3%2Faws4_request&X-Amz-Date=<redacted>&X-Amz-Expires=1800&X-Amz-Signature=<redacted>&X-Amz-SignedHeaders=host"
 ]
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
200400 application/json400 text/html401403408409500501502503
<!--/source-->

<!--source:api-specifications-->
application/json Copy Ok.

```
{
 "documents_info": [
 {
 "uuid": "4a58346a-dc5b-4678-bc9c-3553952a896b",
 "url": "https://files.consumerfinance.gov/f/201311_cfpb_kbyo_closing-disclosure.pdf"
 }
 ]
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Request.

```
{
 "code": "Bad Request",
 "message": "Bad request syntax or unsupported method"
}
```

<!--/source-->

<!--source:api-specifications-->
text/html Copy Bad Request.

```
Bad request syntax or unsupported method
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Unauthorized.

```
{
 "code": "401",
 "message": "This token is not valid for this service."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Forbidden

```
{
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post",
 "message": "This key is not valid for this service."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Request Timeout.

```
{
 "code": "408",
 "message": "SoftworksAI partner is not available."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Conflict

```
{
 "code": "409",
 "message": "Batch already exists"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Internal Server Error

```
{
 "code": "500",
 "message": "Internal Server Error"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Not Implemented

```
{
 "code": "501",
 "message": "Error"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Gateway

```
{
 "code": "502",
 "message": "Error"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Service Unavailable

```
{
 "code": "503",
 "message": "Error"
}
```

<!--/source-->

##### Request body`application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `urls`required | `string[]` | <!--source:api-specifications-->One or more Presigned URLs of PDFs to extract data from.<!--/source--> |
| `processor` | `string` | <!--source:api-specifications-->Name of DocumentAI processor to be used for data extraction<!--/source-->Example `irs_w2` |

##### Response `200``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Ok.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `documents_info` | `object[]` | <!--source:api-specifications-->UUIDs associated with the documents being processed as part of the batch.<!--/source--> |
| `uuid` | `string (uuid)` | <!--source:api-specifications-->Unique ID for querying results.<!--/source-->Example `4a58346a-dc5b-4678-bc9c-3553952a896b` |
| `url` | `string (uri)` | <!--source:api-specifications-->URL for file from request.<!--/source-->Example `https://files.consumerfinance.gov/f/201311_cfpb_kbyo_closing-disclosure.pdf` |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Request.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Bad Request error.<!--/source--> |
| `code`required | `one of` | <!--source:api-specifications-->Bad Request<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `401``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unauthorized.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unauthorized error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Forbidden
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `url` | `string` | <!--source:api-specifications-->The URL.<!--/source--> |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |

##### Response `408``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Request Timeout.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Timeout error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `409``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Conflict
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `422``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unprocessable entity
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Internal Server Error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `501``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Not Implemented
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `502``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Gateway
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `503``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Service Unavailable
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

`GET` `/document/{uuid}`

<!--source:api-specifications-->

#### Retrieve Extracted Data
<!--/source-->

`retrieve-extracted-data`

<!--source:api-specifications-->
Retrieve extracted data
<!--/source-->

<!--source:api-specifications-->
Retrieves the extracted data of a document based on the UUID assigned to it when accepted to be processed as part of a batch operation.

<!--/source-->

##### Response

<!--source:api-specifications-->
400 application/json400 text/html401403408409500501502503
<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Request.

```
{
 "code": "Bad Request",
 "message": "Bad request syntax or unsupported method"
}
```

<!--/source-->

<!--source:api-specifications-->
text/html Copy Bad Request.

```
Bad request syntax or unsupported method
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Unauthorized.

```
{
 "code": "401",
 "message": "This token is not valid for this service."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Forbidden

```
{
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post",
 "message": "This key is not valid for this service."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Request Timeout.

```
{
 "code": "408",
 "message": "SoftworksAI partner is not available."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Conflict

```
{
 "code": "409",
 "message": "Batch already exists"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Internal Server Error

```
{
 "code": "500",
 "message": "Internal Server Error"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Not Implemented

```
{
 "code": "501",
 "message": "Error"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Gateway

```
{
 "code": "502",
 "message": "Error"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Service Unavailable

```
{
 "code": "503",
 "message": "Error"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `uuid` required | `string` path | `d8b01c18-10f7-4a71-962-43eeaed5ae6b` | <!--source:api-specifications-->UUID of the document which extracted data it's being requested.<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
6 fields
<!--/source-->
<!--source:api-specifications-->
Ok.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `uri` | `string` | <!--source:api-specifications-->Google Storage location where the file was uploaded to be processed by Document AI.<!--/source-->Example `gs://staircase-host-documentai/batch/input/d8b01c18-10f7-4a71-9612-43eeaed5ae6b-test.pdf` |
| `mimeType` | `string` | <!--source:api-specifications-->Mime type of the document<!--/source-->Example `application/pdf` |
| `text` | `string` | <!--source:api-specifications-->Extracted data as plain text<!--/source-->Example `22222 Void 999-00-0000 a Employee’s social security number For Official Use Only ▶ OMB No. 1545-0008 b Employer identification number (EIN) 1 Wages, tips, other compensation 2 Federal income tax withheld 12-3456789 c Employer’s name, address, and ZIP code 3 Social security wages 4 Social security tax withheld Ocrolus Inc. 101 Greenwich Street, Floor 23 New York, NY 10006 5 Medicare wages and tips 6 6 Medicare tax withheld 7 Social security tips 8 Allocated tips d Control number 9 10 Dependent care benefits e Employee’s first name and initial Last name Suff. M99999 John Doe 123 Main Street New York, NY 10001 100000.00 15000.00 98750.00 7500.00 98750.00 4500.00 0.00 0.00 0.00 D 1000.00 x 11 Nonqualified plans 12a See instructions for box 12 C o d e 13 Statutory Retirement Third-party employee plan sick pay 12b C o d e 14 Other 12c C o d e 12d C o d e NY-PFR 223.25 f Employee’s address and ZIP code 15 State Employer’s state ID number 16 State wages, tips, etc. 17 State income tax 18 Local wages, tips, etc. 19 Local income tax 20 Locality name NY | 999999999 100000.00 9000.00 W-2 Wage and Tax Statement Form 2019 Copy A For Social Security Administration — Send this entire page with Form W-3 to the Social Security Administration; photocopies are not acceptable. Department of the Treasury—Internal Revenue Service For Privacy Act and Paperwork Reduction Act Notice, see the separate instructions. Cat. No. 10134D Do Not Cut, Fold, or Staple Forms on This Page` |
| `pages` | `object[]` | <!--source:api-specifications-->Pages of the document<!--/source--> |
| `entities` | `object[]` | <!--source:api-specifications-->Entities of the document<!--/source--> |
| `shardInfo` | `object` | <!--source:api-specifications-->Share info of the document<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Request.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Bad Request error.<!--/source--> |
| `code`required | `one of` | <!--source:api-specifications-->Bad Request<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `401``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unauthorized.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unauthorized error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Forbidden
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `url` | `string` | <!--source:api-specifications-->The URL.<!--/source--> |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |

##### Response `404``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Not found.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `code` | `string` | <!--source:api-specifications-->Error type.<!--/source-->Example `Not Found` |
| `message` | `string` | <!--source:api-specifications-->Reason of error<!--/source-->Example `Nothing matches the given uuid` |

##### Response `408``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Request Timeout.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Timeout error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `409``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Conflict
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `422``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unprocessable entity
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Internal Server Error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `501``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Not Implemented
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `502``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Gateway
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `503``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Service Unavailable
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

`POST` `/document-type`

<!--source:api-specifications-->

#### Create New Document Type
<!--/source-->

`document-type`

<!--source:api-specifications-->
Create new document type.
<!--/source-->

<!--source:api-specifications-->
Create new document type to train a model with DocumentAI.

<!--/source-->

##### Request

<!--source:api-specifications-->
application/json Copy An example of a document type.

```
{
 "name": "W-2"
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
201400 application/json400 text/html401403408409500501502503
<!--/source-->

<!--source:api-specifications-->
application/json Copy Ok.

```
{
 "message": "The data started to import successfully"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Request.

```
{
 "code": "Bad Request",
 "message": "Bad request syntax or unsupported method"
}
```

<!--/source-->

<!--source:api-specifications-->
text/html Copy Bad Request.

```
Bad request syntax or unsupported method
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Unauthorized.

```
{
 "code": "401",
 "message": "This token is not valid for this service."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Forbidden

```
{
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post",
 "message": "This key is not valid for this service."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Request Timeout.

```
{
 "code": "408",
 "message": "SoftworksAI partner is not available."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Conflict

```
{
 "code": "409",
 "message": "Batch already exists"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Internal Server Error

```
{
 "code": "500",
 "message": "Internal Server Error"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Not Implemented

```
{
 "code": "501",
 "message": "Error"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Gateway

```
{
 "code": "502",
 "message": "Error"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Service Unavailable

```
{
 "code": "503",
 "message": "Error"
}
```

<!--/source-->

##### Request body`application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `name`required | `string` | <!--source:api-specifications-->The name of document type.<!--/source--> |

##### Response `201``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Ok.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->The message.<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Request.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Bad Request error.<!--/source--> |
| `code`required | `one of` | <!--source:api-specifications-->Bad Request<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `401``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unauthorized.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unauthorized error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Forbidden
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `url` | `string` | <!--source:api-specifications-->The URL.<!--/source--> |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |

##### Response `408``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Request Timeout.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Timeout error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `409``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Conflict
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Internal Server Error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `501``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Not Implemented
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `502``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Gateway
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `503``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Service Unavailable
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

`GET` `/auto-train`

<!--source:api-specifications-->

#### Retrieve auto train configurations
<!--/source-->

`reetrieve-auto-train-configurations`

<!--source:api-specifications-->
Get a list of automatic training configurations with statuses and ready-to-train document counts.

<!--/source-->

##### Response

<!--source:api-specifications-->
200403
<!--/source-->

<!--source:api-specifications-->
application/json Copy Ok.

```
[
 {
 "documentType": "W-2",
 "enabled": true,
 "readyForTrainCount": 12
 },
 {
 "documentType": "closing_disclosure",
 "enabled": false,
 "readyForTrainCount": 20
 }
]
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Forbidden

```
{
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post",
 "message": "This key is not valid for this service."
}
```

<!--/source-->

##### Response `200``application/json`

<!--source:api-specifications-->
3 fields
<!--/source-->
<!--source:api-specifications-->
Ok.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `documentType` | `string` | <!--source:api-specifications-->Document type.<!--/source-->Example `W-2` |
| `enabled` | `boolean` | <!--source:api-specifications-->Is auto training enabled.<!--/source-->Example `true` |
| `readyForTrainCount` | `number` | <!--source:api-specifications-->Ready for training documents count.<!--/source-->Example `12` |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Forbidden
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `url` | `string` | <!--source:api-specifications-->The URL.<!--/source--> |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |

`PUT` `/auto-train/{document_type_name}`

<!--source:api-specifications-->

#### Auto Train Document Type
<!--/source-->

`auto-train-document`

<!--source:api-specifications-->
Auto train document type
<!--/source-->

<!--source:api-specifications-->
Inserting a configuration to enable automatic training of document type.

<!--/source-->

##### Request

<!--source:api-specifications-->
application/json Copy An example of configuration.

```
{
 "enabled": true
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
201400 application/json400 text/html403
<!--/source-->

<!--source:api-specifications-->
application/json Copy Ok.

```
{
 "message": "Auto training configuration successfully created"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Request.

```
{
 "code": "Bad Request",
 "message": "Bad request syntax or unsupported method"
}
```

<!--/source-->

<!--source:api-specifications-->
text/html Copy Bad Request.

```
Bad request syntax or unsupported method
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Forbidden

```
{
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post",
 "message": "This key is not valid for this service."
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `document_type_name` required | `string` path | `W-2` | <!--source:api-specifications-->The name of document type<!--/source--> |

##### Request body`application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `enabled`required | `boolean` | <!--source:api-specifications-->Status of auto training.<!--/source-->Example `true` |

##### Response `201``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Ok.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Configuration creation message.<!--/source-->Example `Auto training configuration successfully created` |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Request.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Bad Request error.<!--/source--> |
| `code`required | `one of` | <!--source:api-specifications-->Bad Request<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Forbidden
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `url` | `string` | <!--source:api-specifications-->The URL.<!--/source--> |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Not found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->message<!--/source--> |

`PUT` `/train-document/{document_type_name}`

<!--source:api-specifications-->

#### Train Document Type
<!--/source-->

`train-document`

<!--source:api-specifications-->
Train document type
<!--/source-->

<!--source:api-specifications-->
This service imports documents annotations and labels to a document type created. The model is trained when the number of documents is enough to train, validate and test.

<!--/source-->

##### Request

<!--source:api-specifications-->
application/json Copy An example of document.

```
[
 {
 "annotations": [
 {
 "displayName": "Employee_lastname",
 "textExtraction": {
 "textSegment": {
 "startOffset": "794",
 "endOffset": "800"
 }
 }
 }
 ],
 "document": {
 "documentText": {
 "content": "Safe, Accurate,\nVisit the IRS Website\na Employee's social"
 }
 }
 }
]
```

<!--/source-->

##### Response

<!--source:api-specifications-->
200400 application/json400 text/html401403408409500501502503
<!--/source-->

<!--source:api-specifications-->
application/json Copy Ok.

```
{
 "code": "200",
 "message": "The data started to import successfully"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Request.

```
{
 "code": "Bad Request",
 "message": "Bad request syntax or unsupported method"
}
```

<!--/source-->

<!--source:api-specifications-->
text/html Copy Bad Request.

```
Bad request syntax or unsupported method
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Unauthorized.

```
{
 "code": "401",
 "message": "This token is not valid for this service."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Forbidden

```
{
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post",
 "message": "This key is not valid for this service."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Request Timeout.

```
{
 "code": "408",
 "message": "SoftworksAI partner is not available."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Conflict

```
{
 "code": "409",
 "message": "Batch already exists"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Internal Server Error

```
{
 "code": "500",
 "message": "Internal Server Error"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Not Implemented

```
{
 "code": "501",
 "message": "Error"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Gateway

```
{
 "code": "502",
 "message": "Error"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Service Unavailable

```
{
 "code": "503",
 "message": "Error"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `document_type_name` required | `string` path | `W-2` | <!--source:api-specifications-->The name of document type<!--/source--> |

##### Request body`application/json`

<!--source:api-specifications-->
4 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `annotations` | `object[]` | — |
| `displayName` | `string` | <!--source:api-specifications-->Name of annotations.<!--/source-->Example `Employee_lastname` |
| `textExtraction` | `object` | — |
| `textSegment` | `object` | — |
| `startOffset` | `string` | <!--source:api-specifications-->Start of annotation.<!--/source-->Example `794` |
| `endOffset` | `string` | <!--source:api-specifications-->End of annotation.<!--/source-->Example `800` |
| `document` | `object` | — |
| `documentText` | `object` | — |
| `content` | `string` | <!--source:api-specifications-->Content of annotation.<!--/source-->Example `Safe, Accurate, Visit the IRS Website a Employee's social` |
| `document_url` | `string` | <!--source:api-specifications-->Download URL of the document.<!--/source-->Example `https://foobarwebsite.com/filename.pdf` |
| `dataset_id_to_train` | `string` | <!--source:api-specifications-->Dataset ID to be trained.<!--/source-->Example `foobarid123` |

##### Response `200``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Ok.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `code` | `one of` | <!--source:api-specifications-->Status code.<!--/source--> |
| `message` | `string` | <!--source:api-specifications-->The message.<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Request.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Bad Request error.<!--/source--> |
| `code`required | `one of` | <!--source:api-specifications-->Bad Request<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `401``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unauthorized.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unauthorized error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Forbidden
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `url` | `string` | <!--source:api-specifications-->The URL.<!--/source--> |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Not found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->message<!--/source--> |

##### Response `408``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Request Timeout.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Timeout error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `409``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Conflict
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `422``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unprocessable entity
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Internal Server Error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `501``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Not Implemented
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `502``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Gateway
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `503``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Service Unavailable
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

`POST` `/test-model`

<!--source:api-specifications-->

#### Test Train Document Type
<!--/source-->

`test-model`

<!--source:api-specifications-->
Test train document type
<!--/source-->

<!--source:api-specifications-->
This service allows to test a document type created and trained with DocumentAI.

<!--/source-->

##### Request

<!--source:api-specifications-->
application/json Copy An example of test a model.

```
{
 "document_type_name": "W-2",
 "url": "https://www.example.com/test.pdf",
 "transaction_id": "01ARZ3NDEKTSV4RRFFQ69G5FAV"
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
200400 application/json400 text/html401403408409500501502503
<!--/source-->

<!--source:api-specifications-->
application/json Copy Ok.

```
{
 "code": 200,
 "pages": [
 {
 "num": 1,
 "width": 612,
 "height": 792,
 "id": "01FQ1V5WYZCKMAZ0DQQNTVPC3C"
 }
 ],
 "annotations": [
 {
 "annotation_spec_id": 5708576960238584000,
 "display_name": "has_social_security_number",
 "text_extraction": {
 "score": 0.9998301267623901,
 "text_segment": {
 "start_offset": 86,
 "end_offset": 96,
 "content": "123-45-678"
 }
 },
 "page": "01FQ1V5WYZCKMAZ0DQQNTVPC3C",
 "bounding_box": {
 "top_ratio": 0.7323232293128967,
 "left_ratio": 0.4901960790157318,
 "height_ratio": 0.012626290321350098,
 "width_ratio": 0.09477123618125916
 }
 }
 ],
 "document_text": "For Official Use Only\nOMB No. XXXXXXX\n22222\na Employee's social security number\nVoid\n123-45-678",
 "transaction_id": "df5039ba-c650-4e73-8b0a-af6e0b031c15",
 "train_product_id": "01FQBA6JJNHHN57RBKP0VZPYV4"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Request.

```
{
 "code": "Bad Request",
 "message": "Bad request syntax or unsupported method"
}
```

<!--/source-->

<!--source:api-specifications-->
text/html Copy Bad Request.

```
Bad request syntax or unsupported method
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Unauthorized.

```
{
 "code": "401",
 "message": "This token is not valid for this service."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Forbidden

```
{
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post",
 "message": "This key is not valid for this service."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Request Timeout.

```
{
 "code": "408",
 "message": "SoftworksAI partner is not available."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Conflict

```
{
 "code": "409",
 "message": "Batch already exists"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Internal Server Error

```
{
 "code": "500",
 "message": "Internal Server Error"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Not Implemented

```
{
 "code": "501",
 "message": "Error"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Gateway

```
{
 "code": "502",
 "message": "Error"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Service Unavailable

```
{
 "code": "503",
 "message": "Error"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `model_id` | `string` query | `TEN8439699522203942912` | <!--source:api-specifications-->Specific model ID<!--/source--> |

##### Request body`application/json`

<!--source:api-specifications-->
3 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `document_type_name`required | `string` | <!--source:api-specifications-->The name of document type.<!--/source--> |
| `url`required | `string` | <!--source:api-specifications-->URL file.<!--/source--> |
| `transaction_id` | `string` | <!--source:api-specifications-->Transaction ID. Generated by default<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
6 fields
<!--/source-->
<!--source:api-specifications-->
Ok.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `code` | `number` | <!--source:api-specifications-->Test model status code.<!--/source-->Example `200` |
| `pages` | `object[]` | <!--source:api-specifications-->List of pages.<!--/source--> |
| `id` | `string` | <!--source:api-specifications-->Unique page identifier.<!--/source-->Example `01FQ1V5WYZMGW5SQTKQH1DSMTX` |
| `num` | `number` | <!--source:api-specifications-->Page number.<!--/source-->Example `1` |
| `width` | `number` | <!--source:api-specifications-->Page width in points.<!--/source-->Example `612` |
| `height` | `number` | <!--source:api-specifications-->Page height in points.<!--/source-->Example `792` |
| `annotations` | `object[]` | <!--source:api-specifications-->Annotations elements<!--/source--> |
| `annotation_spec_id` | `integer` | <!--source:api-specifications-->Annotation identification.<!--/source--> |
| `display_name` | `string` | <!--source:api-specifications-->Annotation name.<!--/source--> |
| `text_extraction` | `object` | <!--source:api-specifications-->Extraction object.<!--/source--> |
| `score` | `number` | <!--source:api-specifications-->Annotation score.<!--/source--> |
| `text_segment` | `object` | <!--source:api-specifications-->Text Segment object.<!--/source--> |
| `start_offset` | `integer` | <!--source:api-specifications-->Character offsets rather than byte offsets.<!--/source--> |
| `end_offset` | `integer` | <!--source:api-specifications-->Character offsets rather than byte offsets.<!--/source--> |
| `content` | `string` | <!--source:api-specifications-->Annotation content.<!--/source--> |
| `page` | `string` | <!--source:api-specifications-->Page identifier.<!--/source-->Example `01FQ1V5WYZMGW5SQTKQH1DSMTX` |
| `bounding_box` | `object` | <!--source:api-specifications-->Bounding boxes of extracted text.<!--/source--> |
| `top_ratio` | `number` | <!--source:api-specifications-->Top ratio of bounding box<!--/source-->Example `0.7462121248245239` |
| `left_ratio` | `number` | <!--source:api-specifications-->Left ratio of bounding box<!--/source-->Example `0.779411792755127` |
| `height_ratio` | `number` | <!--source:api-specifications-->Height ratio of bounding box<!--/source-->Example `0.010101020336151123` |
| `width_ratio` | `number` | <!--source:api-specifications-->Width ratio of bounding box<!--/source-->Example `0.026143789291381836` |
| `train_product_id` | `string` | <!--source:api-specifications-->Unique train product execution ID.<!--/source-->Example `01FQBA6JJNHHN57RBKP0VZPYV4` |
| `transaction_id` | `string` | <!--source:api-specifications-->Transaction ID for the generated health metrics.<!--/source-->Example `df5039ba-c650-4e73-8b0a-af6e0b031c15` |
| `document_text` | `string` | <!--source:api-specifications-->Content of extract file.<!--/source-->Example `For Official Use Only OMB No. XXXXXXX 22222 a Employee's social security number Void 123-45-678` |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Request.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Bad Request error.<!--/source--> |
| `code`required | `one of` | <!--source:api-specifications-->Bad Request<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `401``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unauthorized.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unauthorized error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Forbidden
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `url` | `string` | <!--source:api-specifications-->The URL.<!--/source--> |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |

##### Response `408``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Request Timeout.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Timeout error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `409``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Conflict
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Internal Server Error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `501``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Not Implemented
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `502``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Gateway
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `503``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Service Unavailable
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

`GET` `/status-document/{document_type_name}`

<!--source:api-specifications-->

#### Retrieve Status of Training Document
<!--/source-->

`get-status-document`

<!--source:api-specifications-->
Get status of training document
<!--/source-->

<!--source:api-specifications-->
This service retrieves the status of the document in the DocumentAI training

<!--/source-->

##### Response

<!--source:api-specifications-->
201400 application/json400 text/html401403404408409500501502503
<!--/source-->

<!--source:api-specifications-->
application/json Copy Ok.

```
{
 "status": "COMPLETE"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Request.

```
{
 "code": "Bad Request",
 "message": "Bad request syntax or unsupported method"
}
```

<!--/source-->

<!--source:api-specifications-->
text/html Copy Bad Request.

```
Bad request syntax or unsupported method
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Unauthorized.

```
{
 "code": "401",
 "message": "This token is not valid for this service."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Forbidden

```
{
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post",
 "message": "This key is not valid for this service."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy File not found

```
{
 "code": "Not Found",
 "message": "Nothing matches the given URI"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Request Timeout.

```
{
 "code": "408",
 "message": "SoftworksAI partner is not available."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Conflict

```
{
 "code": "409",
 "message": "Batch already exists"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Internal Server Error

```
{
 "code": "500",
 "message": "Internal Server Error"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Not Implemented

```
{
 "code": "501",
 "message": "Error"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Gateway

```
{
 "code": "502",
 "message": "Error"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Service Unavailable

```
{
 "code": "503",
 "message": "Error"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `document_type_name` required | `string` path | `W-2` | <!--source:api-specifications-->The name of document type<!--/source--> |

##### Response `201``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Ok.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `status` | `string` | <!--source:api-specifications-->The status can be IN PROGRESS or COMPLETE<!--/source-->Example `COMPLETE` |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Request.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Bad Request error.<!--/source--> |
| `code`required | `one of` | <!--source:api-specifications-->Bad Request<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `401``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unauthorized.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unauthorized error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Forbidden
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `url` | `string` | <!--source:api-specifications-->The URL.<!--/source--> |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
File not found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->File not found error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `408``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Request Timeout.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Timeout error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `409``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Conflict
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `422``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unprocessable entity
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Internal Server Error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `501``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Not Implemented
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `502``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Gateway
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `503``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Service Unavailable
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

`GET` `/status-credentials`

<!--source:api-specifications-->

#### Get Status of Credentials
<!--/source-->

`get-status-credentials`

<!--source:api-specifications-->
Get status of credentials
<!--/source-->

<!--source:api-specifications-->
This service retrieves the status of the credentials

<!--/source-->

##### Response

<!--source:api-specifications-->
201400 application/json400 text/html401403404408409500501502503
<!--/source-->

<!--source:api-specifications-->
application/json Copy Ok.

```
{
 "status": "COMPLETE"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Request.

```
{
 "code": "Bad Request",
 "message": "Bad request syntax or unsupported method"
}
```

<!--/source-->

<!--source:api-specifications-->
text/html Copy Bad Request.

```
Bad request syntax or unsupported method
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Unauthorized.

```
{
 "code": "401",
 "message": "This token is not valid for this service."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Forbidden

```
{
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post",
 "message": "This key is not valid for this service."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy File not found

```
{
 "code": "Not Found",
 "message": "Nothing matches the given URI"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Request Timeout.

```
{
 "code": "408",
 "message": "SoftworksAI partner is not available."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Conflict

```
{
 "code": "409",
 "message": "Batch already exists"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Internal Server Error

```
{
 "code": "500",
 "message": "Internal Server Error"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Not Implemented

```
{
 "code": "501",
 "message": "Error"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Gateway

```
{
 "code": "502",
 "message": "Error"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Service Unavailable

```
{
 "code": "503",
 "message": "Error"
}
```

<!--/source-->

##### Response `201``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Ok.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `status` | `string` | <!--source:api-specifications-->The status can be IN PROGRESS or COMPLETE<!--/source-->Example `COMPLETE` |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Request.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Bad Request error.<!--/source--> |
| `code`required | `one of` | <!--source:api-specifications-->Bad Request<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `401``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unauthorized.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unauthorized error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Forbidden
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `url` | `string` | <!--source:api-specifications-->The URL.<!--/source--> |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
File not found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->File not found error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `408``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Request Timeout.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Timeout error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `409``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Conflict
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `422``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unprocessable entity
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Internal Server Error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `501``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Not Implemented
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `502``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Gateway
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `503``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Service Unavailable
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

`POST` `/create-model`

<!--source:api-specifications-->

#### Create Model
<!--/source-->

`create-model`

<!--source:api-specifications-->
Create model
<!--/source-->

<!--source:api-specifications-->
This service allows creating new model. But process lasts around 3 hours.

<!--/source-->

##### Request

<!--source:api-specifications-->
application/json Copy An example of create a model.

```
{
 "document_type_name": "W-2"
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
200400 application/json400 text/html401403408409500501502503
<!--/source-->

<!--source:api-specifications-->
application/json Copy Ok.

```
{
 "code": "200",
 "message": "The process to create the new model has started. The process lasts about 3 hours"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Request.

```
{
 "code": "Bad Request",
 "message": "Bad request syntax or unsupported method"
}
```

<!--/source-->

<!--source:api-specifications-->
text/html Copy Bad Request.

```
Bad request syntax or unsupported method
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Unauthorized.

```
{
 "code": "401",
 "message": "This token is not valid for this service."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Forbidden

```
{
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post",
 "message": "This key is not valid for this service."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Request Timeout.

```
{
 "code": "408",
 "message": "SoftworksAI partner is not available."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Conflict

```
{
 "code": "409",
 "message": "Batch already exists"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Internal Server Error

```
{
 "code": "500",
 "message": "Internal Server Error"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Not Implemented

```
{
 "code": "501",
 "message": "Error"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Gateway

```
{
 "code": "502",
 "message": "Error"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Service Unavailable

```
{
 "code": "503",
 "message": "Error"
}
```

<!--/source-->

##### Request body`application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `document_type_name`required | `string` | <!--source:api-specifications-->The name of document type.<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
3 fields
<!--/source-->
<!--source:api-specifications-->
Ok.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `code` | `one of` | <!--source:api-specifications-->Status code.<!--/source--> |
| `operation` | `string` | <!--source:api-specifications-->Operation id of transaction.<!--/source--> |
| `message` | `string` | <!--source:api-specifications-->The message.<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Request.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Bad Request error.<!--/source--> |
| `code`required | `one of` | <!--source:api-specifications-->Bad Request<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `401``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unauthorized.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unauthorized error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Forbidden
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `url` | `string` | <!--source:api-specifications-->The URL.<!--/source--> |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |

##### Response `408``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Request Timeout.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Timeout error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `409``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Conflict
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Internal Server Error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `501``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Not Implemented
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `502``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Gateway
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `503``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Service Unavailable
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

`PATCH` `/documents/{document_type}`

<!--source:api-specifications-->

#### Update document
<!--/source-->

`updateDocument`

<!--source:api-specifications-->
Update document, currently only model ID can be updated

<!--/source-->

##### Request

<!--source:api-specifications-->
application/json Copy An example of document update.

```
{
 "model_id": "23ff8e7e-765a-414f-bb04-969298b81c19"
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
400 application/json400 text/html403
<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Request.

```
{
 "code": "Bad Request",
 "message": "Bad request syntax or unsupported method"
}
```

<!--/source-->

<!--source:api-specifications-->
text/html Copy Bad Request.

```
Bad request syntax or unsupported method
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Forbidden

```
{
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post",
 "message": "This key is not valid for this service."
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `document_type` required | `string` path | `W-2` | <!--source:api-specifications-->Document type.<!--/source--> |

##### Request body`application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `model_id`required | `string` | <!--source:api-specifications-->Model id<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Model updated
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `document` | `object` | <!--source:api-specifications-->Document<!--/source--> |
| `document_type` | `string` | <!--source:api-specifications-->Document type<!--/source--> |
| `dataset_id` | `string` | <!--source:api-specifications-->Dataset ID<!--/source--> |
| `model_id` | `string` | <!--source:api-specifications-->Model ID<!--/source--> |
| `count_docs` | `number` | <!--source:api-specifications-->Count docs<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Request.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Bad Request error.<!--/source--> |
| `code`required | `one of` | <!--source:api-specifications-->Bad Request<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Forbidden
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `url` | `string` | <!--source:api-specifications-->The URL.<!--/source--> |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Not found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message<!--/source--> |

`GET` `/documents/{document_type}/models`

<!--source:api-specifications-->

#### Retrieve document models
<!--/source-->

`retireveDocumentModels`

##### Response

<!--source:api-specifications-->
400 application/json400 text/html403404
<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Request.

```
{
 "code": "Bad Request",
 "message": "Bad request syntax or unsupported method"
}
```

<!--/source-->

<!--source:api-specifications-->
text/html Copy Bad Request.

```
Bad request syntax or unsupported method
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Forbidden

```
{
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post",
 "message": "This key is not valid for this service."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy File not found

```
{
 "code": "Not Found",
 "message": "Nothing matches the given URI"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `document_type` required | `string` path | `W-2` | <!--source:api-specifications-->Document type.<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Document models
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `models` | `object[]` | <!--source:api-specifications-->Models.<!--/source--> |
| `model_id` | `string` | <!--source:api-specifications-->Model ID.<!--/source--> |
| `dataset_id` | `string` | <!--source:api-specifications-->Dataset ID.<!--/source--> |
| `status` | `string` | <!--source:api-specifications-->Deployment status<!--/source-->`deployed``deployment_state_unspecified``undeployed` |
| `create_time` | `string (datetime)` | <!--source:api-specifications-->Time when the model training finished and can be used for prediction.<!--/source--> |
| `update_time` | `string (datetime)` | <!--source:api-specifications-->Time when this model was last updated.<!--/source--> |
| `active` | `boolean` | <!--source:api-specifications-->Is active flag<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Request.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Bad Request error.<!--/source--> |
| `code`required | `one of` | <!--source:api-specifications-->Bad Request<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Forbidden
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `url` | `string` | <!--source:api-specifications-->The URL.<!--/source--> |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
File not found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->File not found error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

`POST` `/create-dataset`

<!--source:api-specifications-->

#### Create New Dataset
<!--/source-->

`create-dataset`

<!--source:api-specifications-->
Create new Dataset.
<!--/source-->

<!--source:api-specifications-->
Create new Dataset for a specific document type.

<!--/source-->

##### Request

<!--source:api-specifications-->
application/json Copy An example of a document type.

```
{
 "document_type": "closing_disclosure",
 "dataset_name": "dt_closing_disclosure_23"
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
201400 application/json400 text/html401403409500502
<!--/source-->

<!--source:api-specifications-->
application/json Copy Created.

```
{
 "message": "The Dataset was created successfully"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Request.

```
{
 "code": "Bad Request",
 "message": "Bad request syntax or unsupported method"
}
```

<!--/source-->

<!--source:api-specifications-->
text/html Copy Bad Request.

```
Bad request syntax or unsupported method
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Unauthorized.

```
{
 "code": "401",
 "message": "This token is not valid for this service."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Forbidden

```
{
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post",
 "message": "This key is not valid for this service."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Conflict

```
{
 "code": "409",
 "message": "Batch already exists"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Internal Server Error

```
{
 "code": "500",
 "message": "Internal Server Error"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Gateway

```
{
 "code": "502",
 "message": "Error"
}
```

<!--/source-->

##### Request body`application/json`

<!--source:api-specifications-->
4 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `document_type`required | `string` | <!--source:api-specifications-->The name of document type.<!--/source--> |
| `dataset_name`required | `string` | <!--source:api-specifications-->The name of the Dataset.<!--/source--> |
| `required_labels` | `string[]` | <!--source:api-specifications-->The labels that are required in the Dataset.<!--/source--> |
| `acceptable_labels` | `string[]` | <!--source:api-specifications-->The labels that are acceptable in the Dataset.<!--/source--> |

##### Response `201``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Created.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->The message.<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Request.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Bad Request error.<!--/source--> |
| `code`required | `one of` | <!--source:api-specifications-->Bad Request<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `401``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unauthorized.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Unauthorized error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Forbidden
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `url` | `string` | <!--source:api-specifications-->The URL.<!--/source--> |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |

##### Response `409``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Conflict
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `422``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Unprocessable entity
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Internal Server Error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `502``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Gateway
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Conflict error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

`DELETE` `/documents/{document_type}/models/{model_id}`

<!--source:api-specifications-->

#### Delete model
<!--/source-->

`deleteModel`

<!--source:api-specifications-->
Delete trained model.

<!--/source-->

##### Response

<!--source:api-specifications-->
400 application/json400 text/html403404
<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Request.

```
{
 "code": "Bad Request",
 "message": "Bad request syntax or unsupported method"
}
```

<!--/source-->

<!--source:api-specifications-->
text/html Copy Bad Request.

```
Bad request syntax or unsupported method
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Forbidden

```
{
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post",
 "message": "This key is not valid for this service."
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy File not found

```
{
 "code": "Not Found",
 "message": "Nothing matches the given URI"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
3
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `document_type` required | `string` path | `W-2` | <!--source:api-specifications-->Document type.<!--/source--> |
| `model_id` required | `string` path | `TEN0007099176139227136` | <!--source:api-specifications-->Model ID.<!--/source--> |
| `force` | `boolean` query | `false` | <!--source:api-specifications-->Include model deletion from GCP.<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Request.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Bad Request error.<!--/source--> |
| `code`required | `one of` | <!--source:api-specifications-->Bad Request<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Forbidden
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `url` | `string` | <!--source:api-specifications-->The URL.<!--/source--> |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
File not found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->File not found error.<!--/source--> |
| `code`required | `string` | <!--source:api-specifications-->Error name.<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Other responses

`204`

<!--source:api-specifications-->

### Workflow
<!--/source-->

`POST` `/transactions`

<!--source:api-specifications-->

#### Create Transaction
<!--/source-->

`createTransaction`

<!--source:api-specifications-->
Create Transaction creates a transaction in Staircase. Transactions in Staircase are containers for all the data related to an instance of a transaction type. They enable you to correlate the output of various products to a single transaction type, where the transaction type depends on your line of business. Transactions are identified by a unique key called `transaction_id`. As you use different Staircase products to gather the data needed for a specific instance of your transaction type, and receive different sets of output from each product, use the same transaction_id to correlate all the outputs to the same transaction. A `transaction_id`, when used properly, gives you a holistic view of the data related to the transaction you’ve assembled. To access all collections associated with a given transaction_id, try out /transactions/{transaction_id}/collections

<!--/source-->

##### Response

<!--source:api-specifications-->
201403500
<!--/source-->

<!--source:api-specifications-->
application/json Copy Transaction created successfully

```
{
 "created_at": "03/04/2021, 1:04:05 PM EST",
 "transaction_id": "01F0KHK7DN3H5JZ4QJKMYAM6GB"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy 403 invalid error

```
{
 "message": "Please check the key you used to call this service",
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Internal server error

```
{
 "message": "The product has encountered an internal server error. If you have used a transaction_id to call our services, please submit it to Staircase support"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `x-api-key` required | `string` header | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` | <!--source:api-specifications-->The environment API key.<!--/source--> |

##### Response `201``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Transaction created successfully
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `created_at` | `string` | <!--source:api-specifications-->Staircase time string.<!--/source-->Example `03/03/2021, 8:24:04 AM EST` |
| `transaction_id` | `string (ulid)` | <!--source:api-specifications-->Staircase Transaction Identifier<!--/source-->Example `01F0KHK7DN3H5JZ4QJKMYAM6GB` |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
403 invalid error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |
| `url` | `string` | <!--source:api-specifications-->Error additional URL.<!--/source--> |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Internal server error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |

`POST` `/blobs/upload`

<!--source:api-specifications-->

#### Upload Document
<!--/source-->

`uploadBlob`

<!--source:api-specifications-->
Upload Blob allows a customer to upload a document in .pdf form. Upload Blob uploads a .pdf document (blob) to Persistence product. You can upload PDF using HTML Request Maker Try It Out. Place your API key in the request header, set the request body to binary and browse to your document. Click Send to upload your document. To upload a document programmatically, use the programmatic upload example below. After the approval document is successfully uploaded, a blob_id value is provided. Example: 'blob_id': '01EZYHKY4EXFW4Z8RKWHDP1KHB' After you got successful response, you need to use the blob_id in collection with the following path.

Show the rest
```
$.document_sets.document_set[0].documents.document[0].foreign_objects.foreign_object[0].staircase_blob_id
```

To upload a document within code, you can to use a below example.

```
import requests
with open("document.pdf", "rb") as document:
 payload = document.read
url = ""
headers = {
 "x-api-key": ...,
 "Content-Type": "application/pdf"
}
response = requests.post(url, headers=headers, data=payload)
if response.ok:
 blob_id = response.json["blob_id"]
```

<!--/source-->

##### Request

<!--source:api-specifications-->
application/octet-stream Copy
```
Select option 'binary' in order to upload file
```

<!--/source-->

##### Response

<!--source:api-specifications-->
201403500
<!--/source-->

<!--source:api-specifications-->
application/json Copy Blob uploaded

```
{
 "blob_id": "01EZY9J8SEFM2JKDJ1Q3YX65HS"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy 403 invalid error

```
{
 "message": "Please check the key you used to call this service",
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Internal server error

```
{
 "message": "The product has encountered an internal server error. If you have used a transaction_id to call our services, please submit it to Staircase support"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `x-api-key` required | `string` header | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` | <!--source:api-specifications-->The environment API key.<!--/source--> |

##### Response `201``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Blob uploaded
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `blob_id` | `string` | <!--source:api-specifications-->Created blob id<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
403 invalid error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |
| `url` | `string` | <!--source:api-specifications-->Error additional URL.<!--/source--> |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Internal server error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |

##### Other responses

`400``405``422`

`GET` `/products/train_data_extraction/request-schema`

<!--source:api-specifications-->

#### Retrieve Request Schema
<!--/source-->

`retrieveRequestSchema`

<!--source:api-specifications-->
Retrieve Request Schema retrieves a JSON schema for the request to the product waterfall. It also has the option of returning an example for the request object expected through the return_example attribute.

<!--/source-->

##### Response

<!--source:api-specifications-->
200400 InvalidReturnExamplesValue400 text/html403404 GetProduct404 text/html500
<!--/source-->

<!--source:api-specifications-->
application/json Copy Successfully returned the list of elements needed for product waterfall.

```
{
 "addresses": [
 {
 "address_line_1_text": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "56319 Underwood Views",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1MQEN90HSCMPQWCAD",
 "has_bounding_box_height_ratio": 0.017272727272727273,
 "has_bounding_box_left_ratio": 0.07588235294117647,
 "has_bounding_box_top_ratio": 0.13863636363636364,
 "has_bounding_box_width_ratio": 0.23529411764705882,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "address_line_2_text": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "Lake Debramouth NE 33667-9751",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ110EKH48ZQEK3YQFF",
 "has_bounding_box_height_ratio": 0.015909090909090907,
 "has_bounding_box_left_ratio": 0.07352941176470588,
 "has_bounding_box_top_ratio": 0.15636363636363637,
 "has_bounding_box_width_ratio": 0.31411764705882356,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ],
 "documents": [
 {
 "@id": "01FBHN4YR48XC75HJF5Z9VRBTV",
 "@type": "irs_w2",
 "has_staircase_blob_identifier": {
 "has_value": "01FBHN11S8SF835QXB8M1EBZGG"
 },
 "with_page_extraction_metadata": [
 {
 "@id": "01FBHPXCJ03V0AAHVGW6G1YE08",
 "page_height": 2200,
 "page_number": 1,
 "page_width": 1700
 }
 ]
 }
 ],
 "employment": [
 {
 "retirement_plan_participant_indicator": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "x",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1BN0A4XXXG5ZSD8K0",
 "has_bounding_box_height_ratio": 0.013181818181818182,
 "has_bounding_box_left_ratio": 0.6194117647058823,
 "has_bounding_box_top_ratio": 0.26590909090909093,
 "has_bounding_box_width_ratio": 0.02,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ],
 "income": [
 {
 "allocated_tips_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "152406.79",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1ZTCHXGVK108FHVHE",
 "has_bounding_box_height_ratio": 0.016363636363636365,
 "has_bounding_box_left_ratio": 0.8182352941176471,
 "has_bounding_box_top_ratio": 0.17227272727272727,
 "has_bounding_box_width_ratio": 0.10058823529411764,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "dependent_care_benefits_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "219",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1MM5FMP6HGKC606ZD",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.8129411764705883,
 "has_bounding_box_top_ratio": 0.2018181818181818,
 "has_bounding_box_width_ratio": 0.04352941176470588,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "employer_state_1_identifier": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "678-77-709",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1W0SMD3JVDE47N116",
 "has_bounding_box_height_ratio": 0.015909090909090907,
 "has_bounding_box_left_ratio": 0.1288235294117647,
 "has_bounding_box_top_ratio": 0.3663636363636364,
 "has_bounding_box_width_ratio": 0.11411764705882353,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "employer_state_2_identifier": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "940-46-434",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ12M1K4ASVZBF68XHJ",
 "has_bounding_box_height_ratio": 0.017272727272727273,
 "has_bounding_box_left_ratio": 0.12823529411764706,
 "has_bounding_box_top_ratio": 0.39181818181818184,
 "has_bounding_box_width_ratio": 0.11588235294117646,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "federal_tax_withheld_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "40043.57",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1FE1EQ8X9Q3N12W4F",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.77,
 "has_bounding_box_top_ratio": 0.09181818181818181,
 "has_bounding_box_width_ratio": 0.09058823529411765,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12a_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "9966",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1P0KJ87SMG4T98B75",
 "has_bounding_box_height_ratio": 0.015454545454545455,
 "has_bounding_box_left_ratio": 0.8182352941176471,
 "has_bounding_box_top_ratio": 0.23318181818181818,
 "has_bounding_box_width_ratio": 0.05058823529411765,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12a_code": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "P",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1FF708969HFCH40NT",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.7847058823529411,
 "has_bounding_box_top_ratio": 0.23272727272727273,
 "has_bounding_box_width_ratio": 0.021176470588235293,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12b_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "284",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1VT54M1WB8JCK60N2",
 "has_bounding_box_height_ratio": 0.015454545454545455,
 "has_bounding_box_left_ratio": 0.8188235294117647,
 "has_bounding_box_top_ratio": 0.2636363636363636,
 "has_bounding_box_width_ratio": 0.04176470588235294,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12c_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "307",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1122YD0V4AVKZENYF",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.8176470588235294,
 "has_bounding_box_top_ratio": 0.295,
 "has_bounding_box_width_ratio": 0.03705882352941176,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12c_code": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "P",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ17CSM3TM4RXJ81SBQ",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.7817647058823529,
 "has_bounding_box_top_ratio": 0.29545454545454547,
 "has_bounding_box_width_ratio": 0.02823529411764706,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12d_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "242",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ14CVKQT2JE5BGCGCG",
 "has_bounding_box_height_ratio": 0.015454545454545455,
 "has_bounding_box_left_ratio": 0.8188235294117647,
 "has_bounding_box_top_ratio": 0.3277272727272727,
 "has_bounding_box_width_ratio": 0.03764705882352941,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12d_code": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "H",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ15PYMH0E9SDPSFAFS",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.7817647058823529,
 "has_bounding_box_top_ratio": 0.3286363636363636,
 "has_bounding_box_width_ratio": 0.02588235294117647,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "medicare_income_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "152406.79",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1FRRA33BQ5Y1WPBZB",
 "has_bounding_box_height_ratio": 0.015,
 "has_bounding_box_left_ratio": 0.5735294117647058,
 "has_bounding_box_top_ratio": 0.14772727272727273,
 "has_bounding_box_width_ratio": 0.09823529411764706,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "medicare_tax_withheld_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "4419.8",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ165FBQES8CNY03WXV",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.8176470588235294,
 "has_bounding_box_top_ratio": 0.14772727272727273,
 "has_bounding_box_width_ratio": 0.07176470588235294,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "nonqualified_retirement_plan_distribution_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "233",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1SH6XFDXZEW448H6A",
 "has_bounding_box_height_ratio": 0.015909090909090907,
 "has_bounding_box_left_ratio": 0.571764705882353,
 "has_bounding_box_top_ratio": 0.23272727272727273,
 "has_bounding_box_width_ratio": 0.04176470588235294,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "social_security_income_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "123655.86",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1MX04VCHK51H8RMF2",
 "has_bounding_box_height_ratio": 0.017272727272727273,
 "has_bounding_box_left_ratio": 0.571764705882353,
 "has_bounding_box_top_ratio": 0.11818181818181818,
 "has_bounding_box_width_ratio": 0.10705882352941176,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "social_security_tax_withheld_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "9459.67",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1X5EE4TPRBM2CH0M3",
 "has_bounding_box_height_ratio": 0.017272727272727273,
 "has_bounding_box_left_ratio": 0.768235294117647,
 "has_bounding_box_top_ratio": 0.11818181818181818,
 "has_bounding_box_width_ratio": 0.07882352941176471,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "social_security_tips_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "123655.86",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1P9044AEFH8EF6QT7",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.571764705882353,
 "has_bounding_box_top_ratio": 0.175,
 "has_bounding_box_width_ratio": 0.10470588235294118,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "wages_salaries_tips_and_other_compensation_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "126204.09",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1Y43WKTXBJJWHE106",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.571764705882353,
 "has_bounding_box_top_ratio": 0.08954545454545454,
 "has_bounding_box_width_ratio": 0.10588235294117647,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ],
 "mortgage_products": [
 {
 "@id": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "@type": "groundtruth_labeling",
 "has_service_request_date": {
 "has_value": "2021-07-26"
 },
 "has_service_response_date": {
 "has_value": "2021-07-26"
 },
 "product_used_for": "01FBHN4YR48XC75HJF5Z9VRBTV"
 }
 ],
 "organizations": [
 {
 "organization_identifier": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "39-3114215",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ0H5YE99DKRNXTVR5W",
 "has_bounding_box_height_ratio": 0.015454545454545455,
 "has_bounding_box_left_ratio": 0.08058823529411764,
 "has_bounding_box_top_ratio": 0.09136363636363637,
 "has_bounding_box_width_ratio": 0.12,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "organization_name": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "Carlson Group Group",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1NYMK9JRAAMF3GXRH",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.07470588235294118,
 "has_bounding_box_top_ratio": 0.11954545454545455,
 "has_bounding_box_width_ratio": 0.2211764705882353,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ],
 "people": [
 {
 "full_name": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "Taylor Cox",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1011XSCSZ76ZE1CX0",
 "has_bounding_box_height_ratio": 0.02181818181818182,
 "has_bounding_box_left_ratio": 0.07588235294117647,
 "has_bounding_box_top_ratio": 0.2381818181818182,
 "has_bounding_box_width_ratio": 0.13470588235294118,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "social_security_number": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "999-00-0000",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ0VCNHZCXPKJ3WY9C8",
 "has_bounding_box_height_ratio": 0.015909090909090907,
 "has_bounding_box_left_ratio": 0.26588235294117646,
 "has_bounding_box_top_ratio": 0.06363636363636363,
 "has_bounding_box_width_ratio": 0.1288235294117647,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ]
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Error

```
{
 "message": "Please provide one of valid return examples values: true, false"
}
```

<!--/source-->

<!--source:api-specifications-->
text/html Copy Error

```
<html>\r\n<head><title>400 Bad Request</title></head>\r\n<body>\r\n<center><h1>400 Bad Request</h1></center>\r\n</body>\r\n</html>\r\n
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy 403 invalid error

```
{
 "message": "Please check the key you used to call this service",
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Resource not found

```
{
 "description": "Error Message.",
 "type": "string"
}
```

<!--/source-->

<!--source:api-specifications-->
text/html Copy Resource not found

```
<html>\r\n<head><title>400 Bad Request</title></head>\r\n<body>\r\n<center><h1>400 Bad Request</h1></center>\r\n</body>\r\n</html>\r\n
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Internal server error

```
{
 "message": "The product has encountered an internal server error. If you have used a transaction_id to call our services, please submit it to Staircase support"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
2
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `x-api-key` required | `string` header | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` | <!--source:api-specifications-->The environment API key.<!--/source--> |
| `return_examples` | `boolean` query | `false` | <!--source:api-specifications-->If included and set to `true`, returns one or more pre-filled examples that conform to the schema. Default to `false`<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Successfully returned the list of elements needed for product waterfall.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `schema` | `object` | <!--source:api-specifications-->Element key / value<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Message<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
403 invalid error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |
| `url` | `string` | <!--source:api-specifications-->Error additional URL.<!--/source--> |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Resource not found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error Message.<!--/source--> |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Internal server error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |

`POST` `/transactions/{transaction_id}/collections`

<!--source:api-specifications-->

#### Create Collection
<!--/source-->

`createCollection`

<!--source:api-specifications-->
Create Collection creates a collection of data points required for product invocation. A collection contains a digital representation of the input or output data for the product and is identified by `collection_id`. The Example below contains a sample collection that you can use to make the product invocation in /get-collection

<!--/source-->

##### Request

<!--source:api-specifications-->
application/json Copy
```
{
 "addresses": [
 {
 "address_line_1_text": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "56319 Underwood Views",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1MQEN90HSCMPQWCAD",
 "has_bounding_box_height_ratio": 0.017272727272727273,
 "has_bounding_box_left_ratio": 0.07588235294117647,
 "has_bounding_box_top_ratio": 0.13863636363636364,
 "has_bounding_box_width_ratio": 0.23529411764705882,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "address_line_2_text": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "Lake Debramouth NE 33667-9751",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ110EKH48ZQEK3YQFF",
 "has_bounding_box_height_ratio": 0.015909090909090907,
 "has_bounding_box_left_ratio": 0.07352941176470588,
 "has_bounding_box_top_ratio": 0.15636363636363637,
 "has_bounding_box_width_ratio": 0.31411764705882356,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ],
 "documents": [
 {
 "@id": "01FBHN4YR48XC75HJF5Z9VRBTV",
 "@type": "irs_w2",
 "has_staircase_blob_identifier": {
 "has_value": "01FBHN11S8SF835QXB8M1EBZGG"
 },
 "with_page_extraction_metadata": [
 {
 "@id": "01FBHPXCJ03V0AAHVGW6G1YE08",
 "page_height": 2200,
 "page_number": 1,
 "page_width": 1700
 }
 ]
 }
 ],
 "employment": [
 {
 "retirement_plan_participant_indicator": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "x",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1BN0A4XXXG5ZSD8K0",
 "has_bounding_box_height_ratio": 0.013181818181818182,
 "has_bounding_box_left_ratio": 0.6194117647058823,
 "has_bounding_box_top_ratio": 0.26590909090909093,
 "has_bounding_box_width_ratio": 0.02,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ],
 "income": [
 {
 "allocated_tips_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "152406.79",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1ZTCHXGVK108FHVHE",
 "has_bounding_box_height_ratio": 0.016363636363636365,
 "has_bounding_box_left_ratio": 0.8182352941176471,
 "has_bounding_box_top_ratio": 0.17227272727272727,
 "has_bounding_box_width_ratio": 0.10058823529411764,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "dependent_care_benefits_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "219",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1MM5FMP6HGKC606ZD",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.8129411764705883,
 "has_bounding_box_top_ratio": 0.2018181818181818,
 "has_bounding_box_width_ratio": 0.04352941176470588,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "employer_state_1_identifier": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "678-77-709",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1W0SMD3JVDE47N116",
 "has_bounding_box_height_ratio": 0.015909090909090907,
 "has_bounding_box_left_ratio": 0.1288235294117647,
 "has_bounding_box_top_ratio": 0.3663636363636364,
 "has_bounding_box_width_ratio": 0.11411764705882353,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "employer_state_2_identifier": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "940-46-434",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ12M1K4ASVZBF68XHJ",
 "has_bounding_box_height_ratio": 0.017272727272727273,
 "has_bounding_box_left_ratio": 0.12823529411764706,
 "has_bounding_box_top_ratio": 0.39181818181818184,
 "has_bounding_box_width_ratio": 0.11588235294117646,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "federal_tax_withheld_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "40043.57",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1FE1EQ8X9Q3N12W4F",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.77,
 "has_bounding_box_top_ratio": 0.09181818181818181,
 "has_bounding_box_width_ratio": 0.09058823529411765,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12a_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "9966",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1P0KJ87SMG4T98B75",
 "has_bounding_box_height_ratio": 0.015454545454545455,
 "has_bounding_box_left_ratio": 0.8182352941176471,
 "has_bounding_box_top_ratio": 0.23318181818181818,
 "has_bounding_box_width_ratio": 0.05058823529411765,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12a_code": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "P",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1FF708969HFCH40NT",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.7847058823529411,
 "has_bounding_box_top_ratio": 0.23272727272727273,
 "has_bounding_box_width_ratio": 0.021176470588235293,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12b_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "284",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1VT54M1WB8JCK60N2",
 "has_bounding_box_height_ratio": 0.015454545454545455,
 "has_bounding_box_left_ratio": 0.8188235294117647,
 "has_bounding_box_top_ratio": 0.2636363636363636,
 "has_bounding_box_width_ratio": 0.04176470588235294,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12c_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "307",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1122YD0V4AVKZENYF",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.8176470588235294,
 "has_bounding_box_top_ratio": 0.295,
 "has_bounding_box_width_ratio": 0.03705882352941176,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12c_code": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "P",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ17CSM3TM4RXJ81SBQ",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.7817647058823529,
 "has_bounding_box_top_ratio": 0.29545454545454547,
 "has_bounding_box_width_ratio": 0.02823529411764706,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12d_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "242",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ14CVKQT2JE5BGCGCG",
 "has_bounding_box_height_ratio": 0.015454545454545455,
 "has_bounding_box_left_ratio": 0.8188235294117647,
 "has_bounding_box_top_ratio": 0.3277272727272727,
 "has_bounding_box_width_ratio": 0.03764705882352941,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12d_code": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "H",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ15PYMH0E9SDPSFAFS",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.7817647058823529,
 "has_bounding_box_top_ratio": 0.3286363636363636,
 "has_bounding_box_width_ratio": 0.02588235294117647,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "medicare_income_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "152406.79",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1FRRA33BQ5Y1WPBZB",
 "has_bounding_box_height_ratio": 0.015,
 "has_bounding_box_left_ratio": 0.5735294117647058,
 "has_bounding_box_top_ratio": 0.14772727272727273,
 "has_bounding_box_width_ratio": 0.09823529411764706,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "medicare_tax_withheld_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "4419.8",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ165FBQES8CNY03WXV",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.8176470588235294,
 "has_bounding_box_top_ratio": 0.14772727272727273,
 "has_bounding_box_width_ratio": 0.07176470588235294,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "nonqualified_retirement_plan_distribution_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "233",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1SH6XFDXZEW448H6A",
 "has_bounding_box_height_ratio": 0.015909090909090907,
 "has_bounding_box_left_ratio": 0.571764705882353,
 "has_bounding_box_top_ratio": 0.23272727272727273,
 "has_bounding_box_width_ratio": 0.04176470588235294,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "social_security_income_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "123655.86",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1MX04VCHK51H8RMF2",
 "has_bounding_box_height_ratio": 0.017272727272727273,
 "has_bounding_box_left_ratio": 0.571764705882353,
 "has_bounding_box_top_ratio": 0.11818181818181818,
 "has_bounding_box_width_ratio": 0.10705882352941176,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "social_security_tax_withheld_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "9459.67",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1X5EE4TPRBM2CH0M3",
 "has_bounding_box_height_ratio": 0.017272727272727273,
 "has_bounding_box_left_ratio": 0.768235294117647,
 "has_bounding_box_top_ratio": 0.11818181818181818,
 "has_bounding_box_width_ratio": 0.07882352941176471,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "social_security_tips_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "123655.86",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1P9044AEFH8EF6QT7",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.571764705882353,
 "has_bounding_box_top_ratio": 0.175,
 "has_bounding_box_width_ratio": 0.10470588235294118,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "wages_salaries_tips_and_other_compensation_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "126204.09",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1Y43WKTXBJJWHE106",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.571764705882353,
 "has_bounding_box_top_ratio": 0.08954545454545454,
 "has_bounding_box_width_ratio": 0.10588235294117647,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ],
 "mortgage_products": [
 {
 "@id": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "@type": "groundtruth_labeling",
 "has_service_request_date": {
 "has_value": "2021-07-26"
 },
 "has_service_response_date": {
 "has_value": "2021-07-26"
 },
 "product_used_for": "01FBHN4YR48XC75HJF5Z9VRBTV"
 }
 ],
 "organizations": [
 {
 "organization_identifier": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "39-3114215",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ0H5YE99DKRNXTVR5W",
 "has_bounding_box_height_ratio": 0.015454545454545455,
 "has_bounding_box_left_ratio": 0.08058823529411764,
 "has_bounding_box_top_ratio": 0.09136363636363637,
 "has_bounding_box_width_ratio": 0.12,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "organization_name": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "Carlson Group Group",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1NYMK9JRAAMF3GXRH",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.07470588235294118,
 "has_bounding_box_top_ratio": 0.11954545454545455,
 "has_bounding_box_width_ratio": 0.2211764705882353,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ],
 "people": [
 {
 "full_name": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "Taylor Cox",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1011XSCSZ76ZE1CX0",
 "has_bounding_box_height_ratio": 0.02181818181818182,
 "has_bounding_box_left_ratio": 0.07588235294117647,
 "has_bounding_box_top_ratio": 0.2381818181818182,
 "has_bounding_box_width_ratio": 0.13470588235294118,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "social_security_number": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "999-00-0000",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ0VCNHZCXPKJ3WY9C8",
 "has_bounding_box_height_ratio": 0.015909090909090907,
 "has_bounding_box_left_ratio": 0.26588235294117646,
 "has_bounding_box_top_ratio": 0.06363636363636363,
 "has_bounding_box_width_ratio": 0.1288235294117647,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ]
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
201400 CreateCollectionError400 text/html403404 CreateCollectionError404 text/html500
<!--/source-->

<!--source:api-specifications-->
application/json Copy Collection created successfully

```
{
 "addresses": [
 {
 "address_line_1_text": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "56319 Underwood Views",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1MQEN90HSCMPQWCAD",
 "has_bounding_box_height_ratio": 0.017272727272727273,
 "has_bounding_box_left_ratio": 0.07588235294117647,
 "has_bounding_box_top_ratio": 0.13863636363636364,
 "has_bounding_box_width_ratio": 0.23529411764705882,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "address_line_2_text": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "Lake Debramouth NE 33667-9751",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ110EKH48ZQEK3YQFF",
 "has_bounding_box_height_ratio": 0.015909090909090907,
 "has_bounding_box_left_ratio": 0.07352941176470588,
 "has_bounding_box_top_ratio": 0.15636363636363637,
 "has_bounding_box_width_ratio": 0.31411764705882356,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ],
 "documents": [
 {
 "@id": "01FBHN4YR48XC75HJF5Z9VRBTV",
 "@type": "irs_w2",
 "has_staircase_blob_identifier": {
 "has_value": "01FBHN11S8SF835QXB8M1EBZGG"
 },
 "with_page_extraction_metadata": [
 {
 "@id": "01FBHPXCJ03V0AAHVGW6G1YE08",
 "page_height": 2200,
 "page_number": 1,
 "page_width": 1700
 }
 ]
 }
 ],
 "employment": [
 {
 "retirement_plan_participant_indicator": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "x",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1BN0A4XXXG5ZSD8K0",
 "has_bounding_box_height_ratio": 0.013181818181818182,
 "has_bounding_box_left_ratio": 0.6194117647058823,
 "has_bounding_box_top_ratio": 0.26590909090909093,
 "has_bounding_box_width_ratio": 0.02,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ],
 "income": [
 {
 "allocated_tips_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "152406.79",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1ZTCHXGVK108FHVHE",
 "has_bounding_box_height_ratio": 0.016363636363636365,
 "has_bounding_box_left_ratio": 0.8182352941176471,
 "has_bounding_box_top_ratio": 0.17227272727272727,
 "has_bounding_box_width_ratio": 0.10058823529411764,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "dependent_care_benefits_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "219",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1MM5FMP6HGKC606ZD",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.8129411764705883,
 "has_bounding_box_top_ratio": 0.2018181818181818,
 "has_bounding_box_width_ratio": 0.04352941176470588,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "employer_state_1_identifier": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "678-77-709",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1W0SMD3JVDE47N116",
 "has_bounding_box_height_ratio": 0.015909090909090907,
 "has_bounding_box_left_ratio": 0.1288235294117647,
 "has_bounding_box_top_ratio": 0.3663636363636364,
 "has_bounding_box_width_ratio": 0.11411764705882353,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "employer_state_2_identifier": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "940-46-434",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ12M1K4ASVZBF68XHJ",
 "has_bounding_box_height_ratio": 0.017272727272727273,
 "has_bounding_box_left_ratio": 0.12823529411764706,
 "has_bounding_box_top_ratio": 0.39181818181818184,
 "has_bounding_box_width_ratio": 0.11588235294117646,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "federal_tax_withheld_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "40043.57",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1FE1EQ8X9Q3N12W4F",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.77,
 "has_bounding_box_top_ratio": 0.09181818181818181,
 "has_bounding_box_width_ratio": 0.09058823529411765,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12a_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "9966",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1P0KJ87SMG4T98B75",
 "has_bounding_box_height_ratio": 0.015454545454545455,
 "has_bounding_box_left_ratio": 0.8182352941176471,
 "has_bounding_box_top_ratio": 0.23318181818181818,
 "has_bounding_box_width_ratio": 0.05058823529411765,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12a_code": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "P",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1FF708969HFCH40NT",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.7847058823529411,
 "has_bounding_box_top_ratio": 0.23272727272727273,
 "has_bounding_box_width_ratio": 0.021176470588235293,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12b_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "284",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1VT54M1WB8JCK60N2",
 "has_bounding_box_height_ratio": 0.015454545454545455,
 "has_bounding_box_left_ratio": 0.8188235294117647,
 "has_bounding_box_top_ratio": 0.2636363636363636,
 "has_bounding_box_width_ratio": 0.04176470588235294,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12c_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "307",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1122YD0V4AVKZENYF",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.8176470588235294,
 "has_bounding_box_top_ratio": 0.295,
 "has_bounding_box_width_ratio": 0.03705882352941176,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12c_code": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "P",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ17CSM3TM4RXJ81SBQ",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.7817647058823529,
 "has_bounding_box_top_ratio": 0.29545454545454547,
 "has_bounding_box_width_ratio": 0.02823529411764706,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12d_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "242",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ14CVKQT2JE5BGCGCG",
 "has_bounding_box_height_ratio": 0.015454545454545455,
 "has_bounding_box_left_ratio": 0.8188235294117647,
 "has_bounding_box_top_ratio": 0.3277272727272727,
 "has_bounding_box_width_ratio": 0.03764705882352941,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12d_code": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "H",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ15PYMH0E9SDPSFAFS",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.7817647058823529,
 "has_bounding_box_top_ratio": 0.3286363636363636,
 "has_bounding_box_width_ratio": 0.02588235294117647,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "medicare_income_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "152406.79",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1FRRA33BQ5Y1WPBZB",
 "has_bounding_box_height_ratio": 0.015,
 "has_bounding_box_left_ratio": 0.5735294117647058,
 "has_bounding_box_top_ratio": 0.14772727272727273,
 "has_bounding_box_width_ratio": 0.09823529411764706,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "medicare_tax_withheld_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "4419.8",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ165FBQES8CNY03WXV",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.8176470588235294,
 "has_bounding_box_top_ratio": 0.14772727272727273,
 "has_bounding_box_width_ratio": 0.07176470588235294,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "nonqualified_retirement_plan_distribution_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "233",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1SH6XFDXZEW448H6A",
 "has_bounding_box_height_ratio": 0.015909090909090907,
 "has_bounding_box_left_ratio": 0.571764705882353,
 "has_bounding_box_top_ratio": 0.23272727272727273,
 "has_bounding_box_width_ratio": 0.04176470588235294,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "social_security_income_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "123655.86",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1MX04VCHK51H8RMF2",
 "has_bounding_box_height_ratio": 0.017272727272727273,
 "has_bounding_box_left_ratio": 0.571764705882353,
 "has_bounding_box_top_ratio": 0.11818181818181818,
 "has_bounding_box_width_ratio": 0.10705882352941176,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "social_security_tax_withheld_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "9459.67",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1X5EE4TPRBM2CH0M3",
 "has_bounding_box_height_ratio": 0.017272727272727273,
 "has_bounding_box_left_ratio": 0.768235294117647,
 "has_bounding_box_top_ratio": 0.11818181818181818,
 "has_bounding_box_width_ratio": 0.07882352941176471,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "social_security_tips_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "123655.86",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1P9044AEFH8EF6QT7",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.571764705882353,
 "has_bounding_box_top_ratio": 0.175,
 "has_bounding_box_width_ratio": 0.10470588235294118,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "wages_salaries_tips_and_other_compensation_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "126204.09",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1Y43WKTXBJJWHE106",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.571764705882353,
 "has_bounding_box_top_ratio": 0.08954545454545454,
 "has_bounding_box_width_ratio": 0.10588235294117647,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ],
 "mortgage_products": [
 {
 "@id": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "@type": "groundtruth_labeling",
 "has_service_request_date": {
 "has_value": "2021-07-26"
 },
 "has_service_response_date": {
 "has_value": "2021-07-26"
 },
 "product_used_for": "01FBHN4YR48XC75HJF5Z9VRBTV"
 }
 ],
 "organizations": [
 {
 "organization_identifier": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "39-3114215",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ0H5YE99DKRNXTVR5W",
 "has_bounding_box_height_ratio": 0.015454545454545455,
 "has_bounding_box_left_ratio": 0.08058823529411764,
 "has_bounding_box_top_ratio": 0.09136363636363637,
 "has_bounding_box_width_ratio": 0.12,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "organization_name": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "Carlson Group Group",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1NYMK9JRAAMF3GXRH",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.07470588235294118,
 "has_bounding_box_top_ratio": 0.11954545454545455,
 "has_bounding_box_width_ratio": 0.2211764705882353,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ],
 "people": [
 {
 "full_name": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "Taylor Cox",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1011XSCSZ76ZE1CX0",
 "has_bounding_box_height_ratio": 0.02181818181818182,
 "has_bounding_box_left_ratio": 0.07588235294117647,
 "has_bounding_box_top_ratio": 0.2381818181818182,
 "has_bounding_box_width_ratio": 0.13470588235294118,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "social_security_number": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "999-00-0000",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ0VCNHZCXPKJ3WY9C8",
 "has_bounding_box_height_ratio": 0.015909090909090907,
 "has_bounding_box_left_ratio": 0.26588235294117646,
 "has_bounding_box_top_ratio": 0.06363636363636363,
 "has_bounding_box_width_ratio": 0.1288235294117647,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ]
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Error

```
{
 "message": "Unable to create collection. Please check the collection data"
}
```

<!--/source-->

<!--source:api-specifications-->
text/html Copy Error

```
<html>\r\n<head><title>400 Bad Request</title></head>\r\n<body>\r\n<center><h1>400 Bad Request</h1></center>\r\n</body>\r\n</html>\r\n
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy 403 invalid error

```
{
 "message": "Please check the key you used to call this service",
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Resource not found

```
{
 "message": "Unable to create collection. Please check the transaction ID."
}
```

<!--/source-->

<!--source:api-specifications-->
text/html Copy Resource not found

```
<html>\r\n<head><title>400 Bad Request</title></head>\r\n<body>\r\n<center><h1>400 Bad Request</h1></center>\r\n</body>\r\n</html>\r\n
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Internal server error

```
{
 "message": "The product has encountered an internal server error. If you have used a transaction_id to call our services, please submit it to Staircase support"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
2
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `x-api-key` required | `string` header | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` | <!--source:api-specifications-->The environment API key.<!--/source--> |
| `transaction_id` required | `string (ulid)` path | `01F0KHK7DN3H5JZ4QJKMYAM6GB` | <!--source:api-specifications-->Staircase Transaction Identifier<!--/source--> |

##### Request body`application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `data` | `object` | <!--source:api-specifications-->The data object<!--/source--> |

##### Response `201``application/json`

<!--source:api-specifications-->
4 fields
<!--/source-->
<!--source:api-specifications-->
Collection created successfully
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `collection_id` | `string (ulid)` | <!--source:api-specifications-->Collection id<!--/source-->Example `01EZQ32PJQGKRA6HR8D72Q9FFF` |
| `data` | `array` | <!--source:api-specifications-->The data<!--/source--> |
| `metadata` | `object` | <!--source:api-specifications-->Metadata about collection, f.e version of used Staircase schema<!--/source--> |
| `transaction_id` | `string (ulid)` | <!--source:api-specifications-->Transaction id<!--/source-->Example `01EZQ32PJQGKRA6HR8D72Q9FFF` |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `one of` | <!--source:api-specifications-->Either message object with more properties.<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
403 invalid error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |
| `url` | `string` | <!--source:api-specifications-->Error additional URL.<!--/source--> |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Resource not found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Message<!--/source--> |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Internal server error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |

`POST` `/products/train_data_extraction/invocations`

<!--source:api-specifications-->

#### Extract data from document
<!--/source-->

`InvokeSpecificProductFlow`

<!--source:api-specifications-->
Invoke TrainDataExtraction
<!--/source-->

<!--source:api-specifications-->
Invoke Specific Product Flow helps you to invoke specific product flow, this endpoint shall:

- Validate the input `transaction_id`, `request_collection_id`, `response_collection_id` if provided;
- Create transaction if the `transaction_id` was not provided;
- Create input collection with the `request_data` provided if the `request_collection_id` was not provided;
- Create empty output collection if the `response_collection_id` was not provided;
- Validate the provided product name and the product flow name;
- Retrieve the product flow information associated to the provided Product Flow Name;
Show the rest
- Translate the input collection from Staircase language to Vendor language if `input_translation_language` was configured for the product flow;
- Run the connector flow associated to the Product Flow Name;
- Set the status, `invocation_id` and `output_translation_language` that will be used to translate the results from Vendor Language to Staircase language if `output_translation_language` was configured for the product flow.
- Send a callback, when the flow execution will be finished if `callback_url` was specified with an input data for the invocation. The callback request body is a JSON with the following schema:

```
{
"type": "object",
"$schema": "",
"required": [
"invocation_id",
"invocation_status"
],
"properties": {
"invocation_id": {
"type": "string",
"format": "uuid"
},
"invocation_status": {
"type": "string",
"enum": [
"COMPLETED",
"FAILED"
]
},
"response_data": {
"type": "object",
"additionalProperties": true
},
"failure_reason": {
"type": "string"
}
}
}
```

<!--/source-->

##### Request

<!--source:api-specifications-->
application/json Copy
```
{
 "callback_url": "https://webhook.site/3706b519-9426-4533-9868-14a7dec4fd97",
 "product_flow_name": "Alloy",
 "request_collection_id": "01F6QF1QJF20DMSXH4SYXKB1SN",
 "response_collection_id": "01F6NAQ4894HPMCBGB4P0G95XK",
 "transaction_id": "01F6NAMXWN2XVBD1YJ92A6S6R4"
}
```

<!--/source-->

##### Response

<!--source:api-specifications-->
201400403404500
<!--/source-->

<!--source:api-specifications-->
application/json Copy Successfully started flow invocation.

```
{
 "invocation_id": "9aefb465-90fb-4d50-8ae6-2df2b58373f4",
 "output_language_name": "staircase",
 "request_collection_id": "01F6NAQ4894HPMCBGB4P0G95XK",
 "response_collection_id": "01F6QF1QJF20DMSXH4SYXKB1SN",
 "invocation_status": "STARTED",
 "transaction_id": "01F6NAMXWN2XVBD1YJ92A6S6R4"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Request data failed validation

```
{
 "message": "{'data': ['Missing data for required field.']}"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy 403 invalid error

```
{
 "message": "Please check the key you used to call this service",
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post"
}
```

<!--/source-->

<!--source:api-specifications-->
text/html Copy Resource not found

```
<html>\r\n<head><title>400 Bad Request</title></head>\r\n<body>\r\n<center><h1>400 Bad Request</h1></center>\r\n</body>\r\n</html>\r\n
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Internal server error

```
{
 "message": "The product has encountered an internal server error. If you have used a transaction_id to call our services, please submit it to Staircase support"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
1
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `x-api-key` required | `string` header | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` | <!--source:api-specifications-->The environment API key.<!--/source--> |

##### Request body`application/json`

<!--source:api-specifications-->
7 fields
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `callback_url` | `string (uri)` | <!--source:api-specifications-->Callback URL.<!--/source--> |
| `product_flow_name` | `string` | <!--source:api-specifications-->Product flow name. If it is not specified, the default product flow will be invoked. If the product has no default product flow, the first created flow will be invoked. Cannot be specified together with vendor_name.<!--/source--> |
| `request_collection_id` | `string` | <!--source:api-specifications-->Request Collection ID.<!--/source--> |
| `request_data` | `object` | <!--source:api-specifications-->Request JSON body.<!--/source--> |
| `response_collection_id` | `string` | <!--source:api-specifications-->Response Collection ID.<!--/source--> |
| `transaction_id` | `string` | <!--source:api-specifications-->Transaction ID used for invocation.<!--/source--> |
| `vendor_name` | `string` | <!--source:api-specifications-->Vendor name. Cannot be specified together with product_flow_name.<!--/source--> |

##### Response `201``application/json`

<!--source:api-specifications-->
7 fields
<!--/source-->
<!--source:api-specifications-->
Successfully started flow invocation.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `callback_url` | `string` | <!--source:api-specifications-->Callback URL.<!--/source--> |
| `invocation_id`required | `string` | <!--source:api-specifications-->Invocation ID.<!--/source--> |
| `invocation_status`required | `string` | <!--source:api-specifications-->The status of the invocation.<!--/source-->`STARTED` |
| `metadata` | `object` | <!--source:api-specifications-->The metadata of the invoked product flow.<!--/source--> |
| `product_flow_name` | `string` | <!--source:api-specifications-->Product flow name.<!--/source--> |
| `request_data` | `object` | <!--source:api-specifications-->The data for the request collection.<!--/source--> |
| `transaction_id`required | `string` | <!--source:api-specifications-->Transaction ID.<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Request data failed validation
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Message<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
403 invalid error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |
| `url` | `string` | <!--source:api-specifications-->Error additional URL.<!--/source--> |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Resource not found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Message<!--/source--> |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Internal server error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |

`GET` `/products/train_data_extraction/invocations/{invocation_id}`

<!--source:api-specifications-->

#### Retrieve Status
<!--/source-->

`RetrieveProductFlowInvocationStatus`

<!--source:api-specifications-->
Status
<!--/source-->

<!--source:api-specifications-->
Retrieves the status of running Product flow invocation.

<!--/source-->

##### Response

<!--source:api-specifications-->
200400403404500
<!--/source-->

<!--source:api-specifications-->
application/json Copy Successfully returned status of the Product flow Invocation.

```
{
 "request_collection_id": "01F6QF1QJF20DMSXH4SYXKB1SN",
 "response_collection_id": "01F6NAQ4894HPMCBGB4P0G95XK",
 "invocation_status": "COMPLETED",
 "transaction_id": "01F6NAMXWN2XVBD1YJ92A6S6R4",
 "updated_at": "2021-05-27T15:17:59.859954-04:00"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Request data failed validation

```
{
 "message": "{'data': ['Missing data for required field.']}"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy 403 invalid error

```
{
 "message": "Please check the key you used to call this service",
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post"
}
```

<!--/source-->

<!--source:api-specifications-->
text/html Copy Resource not found

```
<html>\r\n<head><title>400 Bad Request</title></head>\r\n<body>\r\n<center><h1>400 Bad Request</h1></center>\r\n</body>\r\n</html>\r\n
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Internal server error

```
{
 "message": "The product has encountered an internal server error. If you have used a transaction_id to call our services, please submit it to Staircase support"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
2
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `x-api-key` required | `string` header | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` | <!--source:api-specifications-->The environment API key.<!--/source--> |
| `invocation_id` required | `string (ulid)` path | `01F0KHKADN0HRFXMCQQXPA6AFZ` | <!--source:api-specifications-->Product flow invocation identifier<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
9 fields
<!--/source-->
<!--source:api-specifications-->
Successfully returned status of the Product flow Invocation.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `callback_url` | `string` | <!--source:api-specifications-->URL that was specified in flow invocation and will be used to send the callback when flow invocation will be finished.<!--/source--> |
| `invocation_status`required | `string` | <!--source:api-specifications-->Invocation Status.<!--/source-->`ACTION_REQUIRED``COMPLETED``FAILED``RUNNING``STARTED` |
| `metadata` | `object` | <!--source:api-specifications-->Response Collection ID.<!--/source--> |
| `request_collection` | `object` | <!--source:api-specifications-->Collection.<!--/source--> |
| `collection_id` | `string (ulid)` | <!--source:api-specifications-->Collection ID.<!--/source-->Example `01EZQ32PJQGKRA6HR8D72Q9FFF` |
| `data` | `object` | <!--source:api-specifications-->Data in Staircase language schema.<!--/source--> |
| `metadata` | `object` | <!--source:api-specifications-->Metadata about collection, f.e version of used Staircase schema.<!--/source--> |
| `transaction_id` | `string (ulid)` | <!--source:api-specifications-->Transaction ID.<!--/source-->Example `01EZQ32PJQGKRA6HR8D72Q9FFF` |
| `request_collection_id` | `string` | <!--source:api-specifications-->Request Collection ID.<!--/source--> |
| `response_collection` | `object` | <!--source:api-specifications-->Collection.<!--/source--> |
| `collection_id` | `string (ulid)` | <!--source:api-specifications-->Collection ID.<!--/source-->Example `01EZQ32PJQGKRA6HR8D72Q9FFF` |
| `data` | `object` | <!--source:api-specifications-->Data in Staircase language schema.<!--/source--> |
| `metadata` | `object` | <!--source:api-specifications-->Metadata about collection, f.e version of used Staircase schema.<!--/source--> |
| `transaction_id` | `string (ulid)` | <!--source:api-specifications-->Transaction ID.<!--/source-->Example `01EZQ32PJQGKRA6HR8D72Q9FFF` |
| `response_collection_id` | `string` | <!--source:api-specifications-->Response Collection ID.<!--/source--> |
| `transaction_id`required | `string` | <!--source:api-specifications-->Transaction ID used for invocation.<!--/source--> |
| `widget_url` | `string (uri)` | <!--source:api-specifications-->URL of the widget.<!--/source--> |

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Request data failed validation
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Message<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
403 invalid error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |
| `url` | `string` | <!--source:api-specifications-->Error additional URL.<!--/source--> |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Resource not found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Message<!--/source--> |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Internal server error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |

`GET` `/transactions/{transaction_id}/collections/{collection_id}`

<!--source:api-specifications-->

#### Retrieve Collection
<!--/source-->

`retrieveCollection`

<!--source:api-specifications-->
Retrieve Collection returns the content of a given `collection_id` associated with a `transaction_id`.

<!--/source-->

##### Response

<!--source:api-specifications-->
200403404 GetCollectionError404 GetCollectionsError500
<!--/source-->

<!--source:api-specifications-->
application/json Copy Successfully Retrieved Collection

```
{
 "addresses": [
 {
 "address_line_1_text": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "56319 Underwood Views",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1MQEN90HSCMPQWCAD",
 "has_bounding_box_height_ratio": 0.017272727272727273,
 "has_bounding_box_left_ratio": 0.07588235294117647,
 "has_bounding_box_top_ratio": 0.13863636363636364,
 "has_bounding_box_width_ratio": 0.23529411764705882,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "address_line_2_text": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "Lake Debramouth NE 33667-9751",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ110EKH48ZQEK3YQFF",
 "has_bounding_box_height_ratio": 0.015909090909090907,
 "has_bounding_box_left_ratio": 0.07352941176470588,
 "has_bounding_box_top_ratio": 0.15636363636363637,
 "has_bounding_box_width_ratio": 0.31411764705882356,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ],
 "documents": [
 {
 "@id": "01FBHN4YR48XC75HJF5Z9VRBTV",
 "@type": "irs_w2",
 "has_staircase_blob_identifier": {
 "has_value": "01FBHN11S8SF835QXB8M1EBZGG"
 },
 "with_page_extraction_metadata": [
 {
 "@id": "01FBHPXCJ03V0AAHVGW6G1YE08",
 "page_height": 2200,
 "page_number": 1,
 "page_width": 1700
 }
 ]
 }
 ],
 "employment": [
 {
 "retirement_plan_participant_indicator": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "x",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1BN0A4XXXG5ZSD8K0",
 "has_bounding_box_height_ratio": 0.013181818181818182,
 "has_bounding_box_left_ratio": 0.6194117647058823,
 "has_bounding_box_top_ratio": 0.26590909090909093,
 "has_bounding_box_width_ratio": 0.02,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ],
 "income": [
 {
 "allocated_tips_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "152406.79",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1ZTCHXGVK108FHVHE",
 "has_bounding_box_height_ratio": 0.016363636363636365,
 "has_bounding_box_left_ratio": 0.8182352941176471,
 "has_bounding_box_top_ratio": 0.17227272727272727,
 "has_bounding_box_width_ratio": 0.10058823529411764,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "dependent_care_benefits_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "219",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1MM5FMP6HGKC606ZD",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.8129411764705883,
 "has_bounding_box_top_ratio": 0.2018181818181818,
 "has_bounding_box_width_ratio": 0.04352941176470588,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "employer_state_1_identifier": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "678-77-709",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1W0SMD3JVDE47N116",
 "has_bounding_box_height_ratio": 0.015909090909090907,
 "has_bounding_box_left_ratio": 0.1288235294117647,
 "has_bounding_box_top_ratio": 0.3663636363636364,
 "has_bounding_box_width_ratio": 0.11411764705882353,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "employer_state_2_identifier": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "940-46-434",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ12M1K4ASVZBF68XHJ",
 "has_bounding_box_height_ratio": 0.017272727272727273,
 "has_bounding_box_left_ratio": 0.12823529411764706,
 "has_bounding_box_top_ratio": 0.39181818181818184,
 "has_bounding_box_width_ratio": 0.11588235294117646,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "federal_tax_withheld_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "40043.57",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1FE1EQ8X9Q3N12W4F",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.77,
 "has_bounding_box_top_ratio": 0.09181818181818181,
 "has_bounding_box_width_ratio": 0.09058823529411765,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12a_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "9966",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1P0KJ87SMG4T98B75",
 "has_bounding_box_height_ratio": 0.015454545454545455,
 "has_bounding_box_left_ratio": 0.8182352941176471,
 "has_bounding_box_top_ratio": 0.23318181818181818,
 "has_bounding_box_width_ratio": 0.05058823529411765,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12a_code": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "P",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1FF708969HFCH40NT",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.7847058823529411,
 "has_bounding_box_top_ratio": 0.23272727272727273,
 "has_bounding_box_width_ratio": 0.021176470588235293,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12b_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "284",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1VT54M1WB8JCK60N2",
 "has_bounding_box_height_ratio": 0.015454545454545455,
 "has_bounding_box_left_ratio": 0.8188235294117647,
 "has_bounding_box_top_ratio": 0.2636363636363636,
 "has_bounding_box_width_ratio": 0.04176470588235294,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12c_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "307",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1122YD0V4AVKZENYF",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.8176470588235294,
 "has_bounding_box_top_ratio": 0.295,
 "has_bounding_box_width_ratio": 0.03705882352941176,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12c_code": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "P",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ17CSM3TM4RXJ81SBQ",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.7817647058823529,
 "has_bounding_box_top_ratio": 0.29545454545454547,
 "has_bounding_box_width_ratio": 0.02823529411764706,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12d_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "242",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ14CVKQT2JE5BGCGCG",
 "has_bounding_box_height_ratio": 0.015454545454545455,
 "has_bounding_box_left_ratio": 0.8188235294117647,
 "has_bounding_box_top_ratio": 0.3277272727272727,
 "has_bounding_box_width_ratio": 0.03764705882352941,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "irs_w2_box_12d_code": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "H",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ15PYMH0E9SDPSFAFS",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.7817647058823529,
 "has_bounding_box_top_ratio": 0.3286363636363636,
 "has_bounding_box_width_ratio": 0.02588235294117647,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "medicare_income_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "152406.79",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1FRRA33BQ5Y1WPBZB",
 "has_bounding_box_height_ratio": 0.015,
 "has_bounding_box_left_ratio": 0.5735294117647058,
 "has_bounding_box_top_ratio": 0.14772727272727273,
 "has_bounding_box_width_ratio": 0.09823529411764706,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "medicare_tax_withheld_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "4419.8",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ165FBQES8CNY03WXV",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.8176470588235294,
 "has_bounding_box_top_ratio": 0.14772727272727273,
 "has_bounding_box_width_ratio": 0.07176470588235294,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "nonqualified_retirement_plan_distribution_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "233",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1SH6XFDXZEW448H6A",
 "has_bounding_box_height_ratio": 0.015909090909090907,
 "has_bounding_box_left_ratio": 0.571764705882353,
 "has_bounding_box_top_ratio": 0.23272727272727273,
 "has_bounding_box_width_ratio": 0.04176470588235294,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "social_security_income_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "123655.86",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1MX04VCHK51H8RMF2",
 "has_bounding_box_height_ratio": 0.017272727272727273,
 "has_bounding_box_left_ratio": 0.571764705882353,
 "has_bounding_box_top_ratio": 0.11818181818181818,
 "has_bounding_box_width_ratio": 0.10705882352941176,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "social_security_tax_withheld_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "9459.67",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1X5EE4TPRBM2CH0M3",
 "has_bounding_box_height_ratio": 0.017272727272727273,
 "has_bounding_box_left_ratio": 0.768235294117647,
 "has_bounding_box_top_ratio": 0.11818181818181818,
 "has_bounding_box_width_ratio": 0.07882352941176471,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "social_security_tips_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "123655.86",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1P9044AEFH8EF6QT7",
 "has_bounding_box_height_ratio": 0.014090909090909091,
 "has_bounding_box_left_ratio": 0.571764705882353,
 "has_bounding_box_top_ratio": 0.175,
 "has_bounding_box_width_ratio": 0.10470588235294118,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "wages_salaries_tips_and_other_compensation_amount": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "126204.09",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1Y43WKTXBJJWHE106",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.571764705882353,
 "has_bounding_box_top_ratio": 0.08954545454545454,
 "has_bounding_box_width_ratio": 0.10588235294117647,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ],
 "mortgage_products": [
 {
 "@id": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "@type": "groundtruth_labeling",
 "has_service_request_date": {
 "has_value": "2021-07-26"
 },
 "has_service_response_date": {
 "has_value": "2021-07-26"
 },
 "product_used_for": "01FBHN4YR48XC75HJF5Z9VRBTV"
 }
 ],
 "organizations": [
 {
 "organization_identifier": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "39-3114215",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ0H5YE99DKRNXTVR5W",
 "has_bounding_box_height_ratio": 0.015454545454545455,
 "has_bounding_box_left_ratio": 0.08058823529411764,
 "has_bounding_box_top_ratio": 0.09136363636363637,
 "has_bounding_box_width_ratio": 0.12,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "organization_name": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "Carlson Group Group",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1NYMK9JRAAMF3GXRH",
 "has_bounding_box_height_ratio": 0.01681818181818182,
 "has_bounding_box_left_ratio": 0.07470588235294118,
 "has_bounding_box_top_ratio": 0.11954545454545455,
 "has_bounding_box_width_ratio": 0.2211764705882353,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ],
 "people": [
 {
 "full_name": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "Taylor Cox",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ1011XSCSZ76ZE1CX0",
 "has_bounding_box_height_ratio": 0.02181818181818182,
 "has_bounding_box_left_ratio": 0.07588235294117647,
 "has_bounding_box_top_ratio": 0.2381818181818182,
 "has_bounding_box_width_ratio": 0.13470588235294118,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 },
 "social_security_number": {
 "data_sourced_from": "01FBHN4YR4H8E04K9RJZ3F8CRH",
 "has_value": "999-00-0000",
 "with_data_extraction_metadata": {
 "@id": "01FBHPXCJ0VCNHZCXPKJ3WY9C8",
 "has_bounding_box_height_ratio": 0.015909090909090907,
 "has_bounding_box_left_ratio": 0.26588235294117646,
 "has_bounding_box_top_ratio": 0.06363636363636363,
 "has_bounding_box_width_ratio": 0.1288235294117647,
 "with_page_extraction_metadata": "01FBHPXCJ03V0AAHVGW6G1YE08"
 }
 }
 }
 ]
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy 403 invalid error

```
{
 "message": "Please check the key you used to call this service",
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Resource not found

```
{
 "message": "Unable to get collection. Please check the given ids"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Resource not found

```
{
 "message": "Unable to get collections of given transaction. Please check the transaction id"
}
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Internal server error

```
{
 "message": "The product has encountered an internal server error. If you have used a transaction_id to call our services, please submit it to Staircase support"
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
3
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `x-api-key` required | `string` header | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` | <!--source:api-specifications-->The environment API key.<!--/source--> |
| `transaction_id` required | `string (ulid)` path | `01F0KHK7DN3H5JZ4QJKMYAM6GB` | <!--source:api-specifications-->Staircase Transaction Identifier<!--/source--> |
| `collection_id` required | `string (ulid)` path | `01F0KHKADN0HRFXMCQQXPA6AFZ` | <!--source:api-specifications-->Staircase collection_id<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Successfully Retrieved Collection
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `data` | `object` | <!--source:api-specifications-->The data object<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
403 invalid error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |
| `url` | `string` | <!--source:api-specifications-->Error additional URL.<!--/source--> |

##### Response `404``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Resource not found
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Message<!--/source--> |

##### Response `500``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Internal server error
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |

##### Other responses

`400`

`GET` `/products/train_data_extraction/custom_endpoint/models`

<!--source:api-specifications-->

#### Retrieve List Of Supported Document Types
<!--/source-->

`RetrieveDoctypes`

<!--source:api-specifications-->
Successfully returned list of supported document types and partners.
<!--/source-->

<!--source:api-specifications-->
Retrieves the list of currently supported documents and partners per document. Best partner for each document type is provided. Customers can use it when invoking product flow as tag in order to extract with this particular partner.

<!--/source-->

##### Response

<!--source:api-specifications-->
application/json Copy Successfully returned list of supported document types and partners.

```
{
 "collection_id": "01G0YH8WJYNHN72ANQ8DYG976M",
 "data": {
 "documents": [
 {
 "document_type": "appraisal_report",
 "partners": [
 "google_clould_nl"
 ],
 "default_partner": "google_clould_nl"
 },
 {
 "document_type": "closing_disclosure",
 "partners": [
 "google_clould_nl",
 "comprehend",
 "mindee"
 ],
 "default_partner": "comprehend"
 },
 {
 "document_type": "mortgage_insurance_cancellation_disclosure",
 "partners": [
 "google_clould_nl",
 "comprehend",
 "mindee"
 ],
 "default_partner": "google_clould_nl"
 },
 {
 "document_type": "mortgage_insurance_certificate",
 "partners": [
 "google_clould_nl",
 "comprehend",
 "mindee"
 ],
 "default_partner": "comprehend"
 },
 {
 "document_type": "note",
 "partners": [
 "google_clould_nl",
 "comprehend",
 "mindee"
 ],
 "default_partner": "comprehend"
 },
 {
 "document_type": "property_insurance_policy",
 "partners": [
 "google_clould_nl",
 "comprehend",
 "mindee"
 ],
 "default_partner": "comprehend"
 },
 {
 "document_type": "security_instrument",
 "partners": [
 "google_clould_nl",
 "comprehend"
 ],
 "default_partner": "comprehend"
 },
 {
 "document_type": "standard_flood_hazard_determination",
 "partners": [
 "google_clould_nl",
 "comprehend",
 "mindee"
 ],
 "default_partner": "comprehend"
 },
 {
 "document_type": "title_commitment",
 "partners": [
 "google_clould_nl",
 "comprehend",
 "mindee"
 ],
 "default_partner": "comprehend"
 },
 {
 "document_type": "underwriting_transmittal",
 "partners": [
 "google_clould_nl",
 "comprehend",
 "mindee"
 ],
 "default_partner": "comprehend"
 },
 {
 "document_type": "uniform_residential_loan_application",
 "partners": [
 "google_clould_nl",
 "comprehend",
 "mindee"
 ],
 "default_partner": "comprehend"
 }
 ]
 },
 "transaction_id": "01G0YH8WAREZS5WFZP3CPCT2W9",
 "metadata": {
 "created_at": "2022-04-18T10:29:51.838440-04:00",
 "validation": false
 }
}
```

<!--/source-->

##### Parameters

<!--source:api-specifications-->
2
<!--/source-->

| Parameter | Type | Example | Description |
| --- | --- | --- | --- |
| `x-api-key` required | `string` header | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` | <!--source:api-specifications-->The environment API key.<!--/source--> |
| `x-api-key` required | `string` header | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` | <!--source:api-specifications-->The environment API key.<!--/source--> |

##### Response `200``application/json`

<!--source:api-specifications-->
4 fields
<!--/source-->
<!--source:api-specifications-->
Successfully returned list of supported document types and partners.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `collection_id` | `string` | <!--source:api-specifications-->Collection ID<!--/source-->Example `01G0YH8WJYNHN72ANQ8DYG976M` |
| `data` | `object` | <!--source:api-specifications-->Object with info about partners available for each document type.<!--/source--> |
| `documents` | `object[]` | <!--source:api-specifications-->Array of documents<!--/source--> |
| `document_type` | `string` | <!--source:api-specifications-->Document type name. Apply this to product tags when invoking product flow to extract particular document.<!--/source-->Example `appraisal_report` |
| `partners` | `string[]` | <!--source:api-specifications-->Array of partners available for particular document.<!--/source--> |
| `default_partner` | `string` | <!--source:api-specifications-->Best partner for this document type according to our recommendations.<!--/source-->Example `google_clould_nl` |
| `transaction_id` | `string` | <!--source:api-specifications-->Transaction ID<!--/source-->Example `01G0YH8WAREZS5WFZP3CPCT2W9` |
| `metadata` | `object` | <!--source:api-specifications-->Collection metadata<!--/source--> |
| `created_at` | `string` | <!--source:api-specifications-->Created date<!--/source-->Example `2022-04-18T10:29:51.838440-04:00` |
| `validation` | `boolean` | <!--source:api-specifications-->Is validation enabled<!--/source-->Example `false` |

<!--source:api-specifications-->

### Operations
<!--/source-->

`POST` `/credentials`

<!--source:api-specifications-->

#### Setup pipeline credentials
<!--/source-->

##### Response

<!--source:api-specifications-->
400 application/json400 text/html403
<!--/source-->

<!--source:api-specifications-->
application/json Copy Bad Request.

```
{
 "code": "Bad Request",
 "message": "Bad request syntax or unsupported method"
}
```

<!--/source-->

<!--source:api-specifications-->
text/html Copy Bad Request.

```
Bad request syntax or unsupported method
```

<!--/source-->

<!--source:api-specifications-->
application/json Copy Forbidden

```
{
 "url": "https://staircase.stoplight.io/docs/api-reference/customer-account-manager-service.yml/paths/~1products~1refresh/post",
 "message": "This key is not valid for this service."
}
```

<!--/source-->

##### Response `400``application/json`

<!--source:api-specifications-->
1 fields
<!--/source-->
<!--source:api-specifications-->
Bad Request.
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `error` | `object` | <!--source:api-specifications-->Bad Request error.<!--/source--> |
| `code`required | `one of` | <!--source:api-specifications-->Bad Request<!--/source--> |
| `message`required | `string` | <!--source:api-specifications-->Error description.<!--/source--> |

##### Response `403``application/json`

<!--source:api-specifications-->
2 fields
<!--/source-->
<!--source:api-specifications-->
Forbidden
<!--/source-->

| Field | Type | Description |
| --- | --- | --- |
| `url` | `string` | <!--source:api-specifications-->The URL.<!--/source--> |
| `message` | `string` | <!--source:api-specifications-->Error message.<!--/source--> |

##### Other responses

`202`

`POST` `/hello-world`

<!--source:api-specifications-->

#### Hello World
<!--/source-->

<!--source:api-specifications-->
Dummy hello world endpoint

<!--/source-->

##### Other responses

`200`

## Canonical model

- `document`

## Errors

`400``401``403``404``405``408``409``422``500``501``502``503`

## More in Data

- Previous product: Language
- Next product: Persistence
