Extract portfolio at a Sensible URL
Use this endpoint with multiple documents that are packaged into one file (a “portfolio”). For a list of supported file types, see Supported file types. Segments a portfolio file into the specified document types (for example, 1099, w2, and bank_statement) and then runs extractions asynchronously for each document Sensible finds in the portfolio. Take the following steps -
- Use this endpoint to generate a Sensible URL.
- PUT the document you want to extract data from at the URL, where
SENSIBLE_UPLOAD_URL
is the URL you received from this endpoint’s response. For more information about how to PUT the document, see the generate_upload_url/ endpoint. - To retrieve the extraction, use a webhook, or use the extraction
id
returned in the response to poll the GET documents/ endpoint. For more about extracting from portfolios, see Multi-document extractions.
Authorizations
Sensible uses API keys to authenticate requests. Keep your API keys secure and do not share them publicly accessible areas such as GitHub, client-side code, etc. Authentication to the API is performed via Bearer Authentication. Provide your API key as the bearer auth value.
Query Parameters
If you specify development
, extracts preferentially using config versions published to the development environment in the Sensible app. The extraction runs all configs in the doc type before picking the best fit. For each config, falls back to production version if no development version of the config exists.
production
, development
If you specify the filename of the document using this parameter, then Sensible returns the filename in the extraction response.
Body
Specifies the document types contained in the PDF portfolio.
Specifies to return extraction results to the defined webhook as soon as they're complete, so you don't have to poll for results status. Sensible also calls this webhook on error.
Response
Unique ID for the extraction, used to retrieve the extraction
Date and time Sensible created the initial empty extraction and set its status to WAITING.
Status of the extraction:
- WAITING: Sensible created an initial empty extraction and is waiting for the document.
- PROCESSING: Sensible received the document and is extracting data.
- FAILED: The extraction failed.
- COMPLETE: The extraction is complete.
WAITING
, PROCESSING
, COMPLETE
, FAILED
URL at which to PUT the PDF bytes array for extraction. for example, curl -T ./sample.pdf "YOUR_UPLOAD_URL"