Skip to main content

Retry parsing a document

Once a document has been uploaded and completed parsing it will have a completed, exception or failed status. If a document is completed or has an exception it can be retried for parsing.

You may want to retry parsing on a completed document if the GPT-parser did not extract all the data you need. You may want to retry parsing on a document with an exception if the AI was unable to parse the document due to a technical issue.

Guide to implementing API#

API Endpoint#

GET https://2sy6t3lcbd.execute-api.us-east-1.amazonaws.com/prod/files/retry

Example Implementation using Python#

import requests
# Your API keyapi_key = 'YOUR_API_KEY'
# The request ID of the document you want to retryrequest_id = 'YOUR_REQUEST_ID'url = f"https://2sy6t3lcbd.execute-api.us-east-1.amazonaws.com/prod/files/retry?request_id={request_id}"
payload = {}headers = {  'x-api-key': api_key}
response = requests.request("GET", url, headers=headers, data=payload)
print(response)

When importing documents using the API you will get a request_id in the response. You can also get the request_id for a document through the web interface.

Response body#

A 200 response code will contain a request_id and success status for each file in the request. A file that has failed to upload will have an error field describing the reason.

{    "file_name": "file_1_name",    "request_id": "your_request_id",    "success": true}

For status codes 400, 403 and 500 you will get the following response body.

{    "success": false,    "error": "{error message}"}