Watch the following 4-minute video to learn how to make POST requests to the Unstructured Partition Endpoint to process individual files: Open the related notebook that is shown in the preceding video. To make POST requests to the Unstructured Partition Endpoint, you will need: These environment variables:
  • UNSTRUCTURED_API_KEY - Your Unstructured API key value.
  • UNSTRUCTURED_API_URL - Your Unstructured API URL.
To get your API key, do the following:
  1. If you do not already have an Unstructured account, sign up for free. After you sign up, you are automatically signed in to your new Unstructured Starter account, at https://platform.unstructured.io.
    To sign up for a Team or Enterprise account instead, contact Unstructured Sales, or learn more.
  2. If you have an Unstructured Starter or Team account and are not already signed in, sign in to your account at https://platform.unstructured.io.
    For an Enterprise account, see your Unstructured account administrator for instructions, or email Unstructured Support at support@unstructured.io.
  3. Get your Unstructured API key:
    a. After you sign in to your Unstructured Starter account, click API Keys on the sidebar.
    For a Team or Enterprise account, before you click API Keys, make sure you have selected the organizational workspace you want to create an API key for. Each API key works with one and only one organizational workspace. Learn more.
    b. Click Generate API Key.
    c. Follow the on-screen instructions to finish generating the key.
    d. Click the Copy icon next to your new key to add the key to your system’s clipboard. If you lose this key, simply return and click the Copy icon again.
The API URL was provided to you when your Unstructured account was created. If you do not have this URL, email Unstructured Support at support@unstructured.io.
The default URL for the Unstructured Partition Endpoint is https://api.unstructuredapp.io/general/v0/general. However, you should always use the API URL that was provided to you when your Unstructured account was created.
Let’s start with a simple example in which you use curl to send a local PDF file (*.pdf) to partition via the Unstructured 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 Partition Endpoint guide.

Parameters & examples

The API parameters are the same across all methods of accessing the Unstructured 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. Import a Postman collection
  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 (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.