Get an API Key

Each user of the SaaS Unstructured API receives a unique API URL that requires authentication via their API key. Here’s how you can obtain your API key and unique API URL:
  1. Navigate to the SaaS Unstructured API page on our website.
  2. Fill out the registration form with your details: first name, last name, email, and company. Make sure your contact information is valid.
  3. Optional preferences:
    • Check the box to sign up for future marketing emails and product updates.
    • (Recommended) Check the box to sign up for weekly API usage updates.
  4. Read and accept our terms and conditions by checking the appropriate box to proceed.
  5. Click “Submit” to create your account. You will receive an API key, a unique API URL and further instructions to the provided email.
Save your API key and the unique API URL securely, as you will need them to access the SaaS Unstructured API and integrate it with your applications.

Set up billing

Once you receive your SaaS Unstructured API key and a unique API URL, set up your billing information:
  1. At the end of the email you will find the payment link that will lead you to Stripe.
  2. Fill out your billing information.
    • There will be a small initiation fee for all new subscriptions. This one-time fee will be charged to your credit card to enable automatic billing.
  3. Click the “Pay this invoice” button in the email and follow the instructions to enter your payment details securely on the Stripe website.
  4. Confirm the payment to complete this process. Look out for any confirmation prompts or messages that signify a successful transaction.
    • Note that we don’t send out a receipt. If you want to keep a receipt, click the “Download invoice” button after completing the payment on Stripe.

Quick Start Example

The following example illustrates how to preprocess an *.eml file using the SaaS Unstructured API. The functionality is similar to the free Unstructured API, the main difference is that in addition to your API key, you must provide the unique API URL. There are several ways to use the SaaS Unstructured API, which all lead to the same result, so pick your preferred method.

POST request

Supply your API key, and the file to preprocess. Make sure to copy the complete SaaS Unstructured API URL provided in your email, i.e. this URL should include the specific path /general/v0/general:
# Make sure to replace the placeholders with the actual URL and API key from your email
# Include the path `/general/v0/general` in the URL.
curl -X 'POST' 'https://YOUR_API_URL' \
     -H 'accept: application/json' \
     -H 'Content-Type: multipart/form-data' \
     -H 'unstructured-api-key: YOUR_API_KEY' \
     -F 'files=@sample-docs/family-day.eml'
The result will look something like this: Sample Output

Unstructured Python/JavaScript SDK

To work with the SaaS Unstructured API in Python or JavaScript, use the Unstructured Python SDK, or JavaScript SDK. First, install your preferred SDK:
pip install unstructured-client
Next, use it to call the API. Be sure to use the base API URL, the one that does NOT end with the path /general/v0/general, from the email you received. Double-check that you use https in the URL to prevent potential errors. Use your SaaS Unstructured API key to authenticate yourself.
from unstructured_client import UnstructuredClient
from unstructured_client.models import shared
from unstructured_client.models.errors import SDKError

client = UnstructuredClient(
    api_key_auth="YOUR_API_KEY",
    server_url="YOUR_API_URL",
)

filename = "sample-docs/family-day.eml"

with open(filename, "rb") as f:
    files=shared.Files(
        content=f.read(),
        file_name=filename,
    )

req = shared.PartitionParameters(files=files)

try:
    resp = client.general.partition(req)
except SDKError as e:
    print(e)

Calling the Unstructured API from the Unstructured open source library

Finally, you can call the SaaS Unstructured API directly from the Unstructured open source library:
from unstructured.partition.api import partition_via_api

filename = "sample-docs/family-day.eml"

elements = partition_via_api(
  filename=filename,
  api_key="YOUR_API_KEY",
  api_url="https://YOUR_API_HOSTNAME.api.unstructuredapp.io/general/v0/general"
)

SaaS Unstructured API Account Maintenance

You can subscribe to usage updates, update payment method, cancel your plan, or get a new API key from the Unstructured SaaS API webpage. Navigate to the FAQ section, click the corresponding link, and proceed with the steps described below. FAQ Options To opt in to usage emails:
  1. Click “Subscribe To Usage Updates”.
  2. Enter your email address and click “Submit”.
You will start receiving the weekly usage emails after your submit the form. To opt-out from the email subscription, contact our Support team at support@unstructured.io. To update your payment method:
  1. Click “Update Payment Method”.
  2. Enter your email address and click “Submit”.
Upon successful form submission, you will be redirected to the Stripe payment page. Follow the instructions to enter your payment details securely. Confirm the payment to complete this process. Please note that there will be a nominal fee charged to your credit card to verify the payment method. Stripe will refund this fee once the new payment method is confirmed. You will receive a confirmation email about the refund. We will use this new payment method for your next invoices. To cancel your current plan:
  1. Click “Cancel Plan”.
  2. Provide your registered Email and your Current API Key in the following field. Click Submit.
Upon submission, our team will process your request, and you will receive a confirmation email regarding the cancellation of your plan. If you need to re-register the SaaS Unstructured API using the same email address after you cancel your plan, contact our Support team at support@unstructured.io, . To rotate your API key:
  1. Click “Get a new API Key”.
  2. Type your registered Email and your current API Key in the corresponding fields. Click Submit.
Once you submit the form, our system automatically generates a new API key and deactivates the old one. You will receive the new API key at your registered email address. Be sure to update your applications with the new API key to maintain access to the API services.