PUT /documents/{document_type} Create or update document type
updateDocument
Create or update document type. Provided list of fields will be displayed to the labeller. Results will be translated to v2 and saved to response collection. Result with provided list of fields will be available via Retrieve Job endpoint.
Request
{
"fields": [
{
"name": "document_date",
"type": "date",
"description": "Document date."
},
{
"name": "document_signed_indicator",
"type": "boolean",
"description": "Identifies if document is signed"
},
{
"name": "borrower_first_name",
"type": "string",
"description": "Borrower first name"
}
],
"language_name": "doc_v2_language"
} Response
Document has been created/updated
{
"document_type": "my_document_type",
"fields": [
{
"name": "document_date",
"type": "date",
"description": "Document date."
},
{
"name": "document_signed_indicator",
"type": "boolean",
"description": "Identifies if document is signed"
},
{
"name": "borrower_first_name",
"type": "string",
"description": "Borrower first name"
}
],
"mapping_name": "doc_v2_mapping"
} Parameters
1
| Parameter | Type | Example | Description |
|---|---|---|---|
document_type required | string path | irs_w2 | Document type |
Request bodyapplication/json
4 fields
application/json| Field | Type | Description |
|---|---|---|
fieldsrequired | object[] | List of fields |
namerequired | string | Field name |
typerequired | string | Field datatypebooleandateintegernumberstring |
description | string | Field description. |
enum | string[] | List of possible values |
mapping_name | string | Name of mapping, created using staircase Translator product |
language_name | string | Name of language, created using staircase Language product. |
soft_validation | boolean | The flag that define if failed validation should fail creating/update of the document or just add validation errors as warnings to the document info. |
Response 200application/json
6 fields
200application/jsonDocument has been created/updated
| Field | Type | Description |
|---|---|---|
document_type | string | Document type |
fields | object[] | List of fields |
namerequired | string | Field name |
typerequired | string | Field datatypebooleandateintegernumberstring |
description | string | Field description. |
enum | string[] | List of possible values |
mapping_name | string | Name of mapping, created using staircase Translator product. |
language_name | string | Name of language, created using staircase Language product. |
soft_validation | boolean | The flag that define if failed validation should fail creating/update of the document or just add validation errors as warnings to the document info. |
validation_errors | object | Validation information |
messagerequired | string | Validation general message |
error | object | Validation error details |
Response 400application/json
1 fields
400application/jsonRequest data failed validation
| Field | Type | Description |
|---|---|---|
message | one of | Message |
Response 403application/json
1 fields
403application/jsonMissing API key
| Field | Type | Description |
|---|---|---|
message | string | Message |
Other responses
422