To make POST requests to the Unstructured Platform Partition Endpoint, you will need:

These environment variables:

  • UNSTRUCTURED_API_KEY - Your Unstructured API key value.
  • UNSTRUCTURED_API_URL - Your Unstructured API URL.

Get your API key.

The API URL is https://api.unstructuredapp.io/general/v0/general

Let’s start with a simple example in which you use curl to send a local PDF file (*.pdf) to partition via the Unstructured Platform Partition Endpoint.

In this command, be sure to replace <path/to/file> with the path to your local PDF file.

curl --request 'POST' \
"$UNSTRUCTURED_API_URL" \
--header 'accept: application/json' \
--header "unstructured-api-key: $UNSTRUCTURED_API_KEY" \
--header 'content-Type: multipart/form-data' \
--form 'content_type=string' \
--form 'strategy=vlm' \
--form 'vlm_model_provider=openai' \
--form 'vlm_model=gpt-4o' \
--form 'output_format=application/json' \
--form 'files=@<path/to/file>;type=application/pdf'

In the example above we’re representing the API endpoint with the environment variable UNSTRUCTURED_API_URL. Note, however, that you also need to authenticate yourself with your individual API Key, represented by the environment variable UNSTRUCTURED_API_KEY. Learn how to obtain an API URL and API key in the Unstructured Platform Partition Endpoint guide.

Parameters & examples

The API parameters are the same across all methods of accessing the Unstructured Platform Partition Endpoint.

  • Refer to the API parameters page for the full list of available parameters.
  • Refer to the Examples page for some inspiration on using the parameters.

Postman collection

Unstructured offers a Postman collection that you can import into Postman to make POST requests through a graphical user interface.

  1. Install Postman.

  2. Sign in to Postman.

  3. In your workspace, click Import.

  4. In the Paste cURL, Raw text or URL box, enter the following URL, and then press Enter:

    https://raw.githubusercontent.com/Unstructured-IO/docs/main/examplecode/codesamples/api/Unstructured-POST.postman_collection.json
    
  5. On the sidebar, click Collections.

  6. Expand Unstructured POST.

  7. Click (Platform Partition Endpoint) Basic Request.

  8. On the Headers tab, next to unstructured-api-key, enter your Unstructured API key in the Value column.

  9. On the Body tab, next to files, click the Select files box in the Value column.

  10. Click New file from local machine.

  11. Browse to and select the file that you want Unstructured to process.

  12. Click Send. Processing could take several minutes.

To download the processed data to your local machine, in the response area, click the ellipses, and then click Save response to file.