POST /engine/data/jobs Invoke Ruleset
invokeRuleset
Invoke Ruleset: processes the input collection(s) according to the Ruleset operation as below:
- SELECTIVE_DATA_MERGE: merge collections in a new collection.
- Input: Staircase Collection(s).
- Process: Create new collection by running the ruleset on the input collections.
- Output: A new collection generated from running the ruleset.
- DATA_INFERRING: modify existing collection.
- Input: Staircase Collection.
- Process: Modify the collection by running the Ruleset.
- Output: Modified collection.
Callback URL:
The callback is an POST HTTP call with a JSON request body with the following schema:
Show the rest
{
"type": "object",
"$schema": "",
"required": [
"job_id",
"job_status"
],
"properties": {
"job_id": {
"type": "string",
"format": "ulid"
},
"job_status": {
"type": "string",
"enum": [
"COMPLETED",
"FAILED"
]
},
"output": {
"type": "object",
"required": [
"data",
"metadata"
],
"properties": {
"data": {
"type": "object"
},
"metadata": {
"type": "object",
"description": "Metadata about output data",
"properties": {
"status": {
"type": "string",
"description": "Status of the data validity",
"enum": [
"HAS_VALIDATION_ERRORS"
]
},
"status_message": {
"type": "string",
"description": "Status description"
}
}
}
}
},
"failure_reason": {
"type": "string"
}
}
}
Example for completed job:
{
"job_id": "01FMPQ735YKJ0TFBXX3YKVWK7P",
"job_status": "COMPLETED",
"output": {
"metadata": {
"status": "HAS_VALIDATION_ERRORS",
"status_message": "Data has at least 1 object in $.data_validation_metadata with a has_validation_code >= 400"
},
"data": {
"documents": [
{
"@id": "01FKYN27FT44KKTAEC58S6Y6FY",
"@type": "closing_disclosure",
"has_document_date": {
"has_value": "2021-01-29"
},
"has_document_misclassified_indicator": {
"has_value": "false"
}
}
],
"loan_terms": [
{
"@id": "01FKYN27FH8P2WS39Z5KSV7CEA",
"@type": "loan_terms",
"has_hazard_insurance_escrow_required_indicator": {
"has_value": "true"
},
"has_initial_principal_and_interest_payment_amount": {
"has_value": 98.3
},
"has_prepaid_taxes_months_count": {
"has_value": "7"
},
"has_tax_escrow_required_indicator": {
"has_value": "true"
}
}
],
"payments": [
{
"@id": "01FKYN27FJN6M8MMFMH4PDSG5E",
"@type": "loan_payment",
"has_late_charge_rate_percent": {
"has_data_extraction_confidence_score": 95,
"has_value": "5"
}
}
]
}
}
}
Example for failed job:
{
"job_id": "01FMQCF7QW6BHZC7NC7XRRHRPN",
"job_status": "FAILED",
"failure_reason": "Unexpected error."
}
Example callback for running Ruleset Invocation:
The endpoint returns the job_id that can be tracked here
Request
{
"ruleset_name": "selective_merge_ruleset",
"input": {
"data_objects": [
{
"data": {
"loans": [
{
"@id": "01FKYN27FFCBT3GHGNGWQ9S6CK",
"@type": "loan",
"with_insurance": [
"01FKYN27FHSK0MFKHD9WXC819J"
],
"with_loan_terms": [
"01FKYN27FH8P2WS39Z5KSV7CEB"
],
"with_payment": [
"01FKYN27FJN6M8MMFMH4PDSG5E"
]
}
],
"insurance": [
{
"@id": "01FKYN27FHSK0MFKHD9WXC819J",
"@type": "mortgage_insurance",
"has_insurance_escrowed_indicator": {
"has_value": "true"
}
}
],
"loan_terms": [
{
"@id": "01FKYN27FH8P2WS39Z5KSV7CEB",
"@type": "loan_terms",
"has_hazard_insurance_escrow_required_indicator": {
"has_value": "true"
},
"has_initial_principal_and_interest_payment_amount": {
"has_value": 91.5
},
"has_loan_amortization_type": {
"has_value": null
},
"has_prepaid_taxes_months_count": {
"has_value": "7"
},
"has_tax_escrow_required_indicator": {
"has_value": "true"
}
}
],
"payments": [
{
"@id": "01FKYN27FJN6M8MMFMH4PDSG5E",
"@type": "loan_payment",
"has_late_charge_rate_percent": {
"has_value": "5",
"has_data_extraction_confidence_score": 95
}
}
],
"documents": [
{
"@id": "01FKYN27FT44KKTAEC58S6Y6FY",
"@type": "closing_disclosure",
"has_document_date": {
"has_value": "2021-01-29"
},
"has_document_misclassified_indicator": {
"has_value": "false"
}
}
],
"mortgage_products": [
{
"@id": "01FKYN27FX3A94JY49JYCW7RG0",
"@type": "ide"
}
]
}
}
],
"collections": [
{
"transaction_id": "01FJC4DRGV5KNWWJZ9Y3D4X3KG",
"collection_id": "01FJC4E5E6M9ZJ5TRMJPRQ99C9"
},
{
"transaction_id": "01FJC4DRGV5KNWWJZ9Y3D4X3KG",
"collection_id": "01FJC4E9BXJZA254VTENY1RW9H"
},
{
"transaction_id": "01FJC4DRGV5KNWWJZ9Y3D4X3KG",
"collection_id": "01FJC4EGKZMA6T659B9XP64G4W"
}
]
},
"callback_url": "https://notify.me/please"
} Response
Created.
{
"ruleset_name": "selective_merge_ruleset",
"job_id": "01FJC4JGKFX3VYB0EZ75JNY4J6",
"job_status": "STARTED",
"input": {
"data_objects": [
{
"data": {
"loans": [
{
"@id": "01FKYN27FFCBT3GHGNGWQ9S6CK",
"@type": "loan",
"with_insurance": [
"01FKYN27FHSK0MFKHD9WXC819J"
],
"with_loan_terms": [
"01FKYN27FH8P2WS39Z5KSV7CEB"
],
"with_payment": [
"01FKYN27FJN6M8MMFMH4PDSG5E"
]
}
],
"insurance": [
{
"@id": "01FKYN27FHSK0MFKHD9WXC819J",
"@type": "mortgage_insurance",
"has_insurance_escrowed_indicator": {
"has_value": "true"
}
}
],
"loan_terms": [
{
"@id": "01FKYN27FH8P2WS39Z5KSV7CEB",
"@type": "loan_terms",
"has_hazard_insurance_escrow_required_indicator": {
"has_value": "true"
},
"has_initial_principal_and_interest_payment_amount": {
"has_value": 91.5
},
"has_loan_amortization_type": {
"has_value": null
},
"has_prepaid_taxes_months_count": {
"has_value": "7"
},
"has_tax_escrow_required_indicator": {
"has_value": "true"
}
}
],
"payments": [
{
"@id": "01FKYN27FJN6M8MMFMH4PDSG5E",
"@type": "loan_payment",
"has_late_charge_rate_percent": {
"has_value": "5",
"has_data_extraction_confidence_score": 95
}
}
],
"documents": [
{
"@id": "01FKYN27FT44KKTAEC58S6Y6FY",
"@type": "closing_disclosure",
"has_document_date": {
"has_value": "2021-01-29"
},
"has_document_misclassified_indicator": {
"has_value": "false"
}
}
],
"mortgage_products": [
{
"@id": "01FKYN27FX3A94JY49JYCW7RG0",
"@type": "ide"
}
]
}
}
],
"collections": [
{
"transaction_id": "01FJC4DRGV5KNWWJZ9Y3D4X3KG",
"collection_id": "01FJC4E5E6M9ZJ5TRMJPRQ99C9"
},
{
"transaction_id": "01FJC4DRGV5KNWWJZ9Y3D4X3KG",
"collection_id": "01FJC4E9BXJZA254VTENY1RW9H"
},
{
"transaction_id": "01FJC4DRGV5KNWWJZ9Y3D4X3KG",
"collection_id": "01FJC4EGKZMA6T659B9XP64G4W"
}
]
}
} Bad request
<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 Request bodyapplication/json
4 fields
application/json| Field | Type | Description |
|---|---|---|
transaction_id | string | Transaction IDExample 01GKMKNNBG21DZ5GZXAQVS7AQC |
ruleset_namerequired | string | Ruleset nameExample Some Ruleset |
inputrequired | object | Data for the processing |
data_objects | object[] | The array of data objects that need to be processed |
datarequired | object | The data in staircase v2 format |
collections | object[] | The array of collection IDs that need to be processed |
transaction_idrequired | string (ulid) | Transaction ID |
collection_idrequired | string (ulid) | Collection ID |
callback_url | string (uri) | The URL which is used to send the result of the job. |
Response 201application/json
5 fields
201application/jsonCreated.
| Field | Type | Description |
|---|---|---|
ruleset_namerequired | string | Ruleset nameExample Some Ruleset |
inputrequired | object | Data for the processing |
data_objects | object[] | The array of data objects that need to be processed |
datarequired | object | The data in staircase v2 format |
collections | object[] | The array of collection IDs that need to be processed |
transaction_idrequired | string (ulid) | Transaction ID |
collection_idrequired | string (ulid) | Collection ID |
callback_url | string (uri) | The URL which is used to send the result of the job. |
job_idrequired | string (ulid) | Identifier of the job |
job_statusrequired | string | The status of the jobSTARTED |
Response 403application/json
1 fields
403application/jsonForbidden.
| Field | Type | Description |
|---|---|---|
messagerequired | string | Message |
Response 404application/json
1 fields
404application/jsonResource is not found.
| Field | Type | Description |
|---|---|---|
messagerequired | string | Message |
Other responses
400422