Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 45 additions & 14 deletions api-reference/troubleshooting/api-key-url.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sidebarTitle: API keys and URLs

## Issue

When you run script or code to call an Unstructured API, you get one of the following warnings or errors:
When you run script or code to call an Unstructured API, you might get one of the following warnings or errors:

```
UserWarning: If intending to use the paid API, please define `server_url` in your request.
Expand All @@ -15,7 +15,7 @@ UserWarning: If intending to use the paid API, please define `server_url` in you
ERROR: Server responded with 404 - {"detail":"Not Found"}
```

You also get the following related warnings or errors in your logs:
You might also get the following related warnings or errors in your logs:

```
SDKError: API error occurred: Status 401
Expand All @@ -37,24 +37,50 @@ API error occurred: Status 404

For the API URL, note the following:

- For the [Unstructured Workflow Endpoint](/api-reference/workflow/overview), the API URL is typically `https://platform.unstructuredapp.io/api/v1`.
- For the [Unstructured Partition Endpoint](/api-reference/partition/overview), the API URL is typically `https://api.unstructuredapp.io/general/v0/general`.
- For the [Unstructured Workflow Endpoint](/api-reference/workflow/overview), the typical API URL is `https://platform.unstructuredapp.io/api/v1`. This is also
the default API URL that Unstructured Python SDK uses for the Workflow Endpoint.
- For the [Unstructured Partition Endpoint](/api-reference/partition/overview), the default API URL is `https://api.unstructuredapp.io/general/v0/general`. This is also
the default API URL that Unstructured Python SDK uses for the Partition Endpoint.

For the API key, the same API key works for both the [Unstructured Workflow Endpoint](/api-reference/workflow/overview) key or [Unstructured Partition Endpoint](/api-reference/partition/overview). This API key is in your Unstructured account dashboard. To access your dashboard:
<Note>
If you signed up through the [For Enterprise](https://unstructured.io/enterprise) page, of if you are using a self-hosted deployment of Unstructured, your API URL
might be different. For guidance, email Unstructured Sales at [sales@unstructured.io](mailto:sales@unstructured.io).
</Note>

![Unstructured account settings](/img/ui/AccountSettings.png)
For the API key, the same API key works for both the [Unstructured Workflow Endpoint](/api-reference/workflow/overview) and the [Unstructured Partition Endpoint](/api-reference/partition/overview). To access your key:

1. Sign in to your Unstructured account, at [https://platform.unstructured.io](https://platform.unstructured.io).
2. At the bottom of the sidebar, click your user icon, and then click **Account Settings**.
3. On the **API Keys** tab, click the copy icon next to your key.
1. Go to [https://platform.unstructured.io](https://platform.unstructured.io) and use your email address, Google account, or GitHub account to
sign up for an Unstructured account (if you do not already have one) and sign into the account at the same time. The
[Unstructured user interface (UI)](/ui/overview) appears.
2. Get your Unstructured API key:

a. In the Unstructured UI, click **API Keys** on the sidebar.<br/>
b. Click the **Copy** icon next to your target key to add the key to your system's clipboard. If you lose this key, simply return and click the **Copy** icon again.<br/>

3. If you want or need to generate a new Unstructured API key at this point:

a. Click **Generate API Key**.<br/>
b. Follow the on-screen instructions to finish generating the key.<br/>
c. 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.<br/>

<Note>
If you signed up through the [For Enterprise](https://unstructured.io/enterprise) page, of if you are using a self-hosted deployment of Unstructured, the process for getting your API key
might be different. For guidance, email Unstructured Sales at [sales@unstructured.io](mailto:sales@unstructured.io).
</Note>

For the API URL, note the value of the the Unstructured **API URL** (for the Unstructured Workflow Endpoint) or the Unstructured **Serverless API URL** (for the Unstructured Partition Endpoint).
For the API URL, note the value of the Unstructured API URL for the Endpoint that you want to call. To access these API URLs:

![Unstructured Serverless and API URLs](/img/ui/ServerlessPlatformAPIURL.png)
1. Go to [https://platform.unstructured.io](https://platform.unstructured.io) and use your email address, Google account, or GitHub account to
sign up for an Unstructured account (if you do not already have one) and sign into the account at the same time. The
[Unstructured user interface (UI)](/ui/overview) appears.
2. In the Unstructured UI, click **API Keys** on the sidebar.
3. Note the API URL for the **Unstructured Workflow Endpoint** or the **Unstructured Partition Endpoint**, depending on whether you want to call the
[Unstructured Workflow Endpoint](/api-reference/workflow/overview) or the [Unstructured Partition Endpoint](/api-reference/partition/overview), respectively.

1. Sign in to your Unstructured account, at [https://platform.unstructured.io](https://platform.unstructured.io).
2. At the bottom of the sidebar, click your user icon, and then click **Account Settings**.
3. On the **API Keys** tab, note the correct API URL. These APIs are not interchangeable between the Workflow and Partition APIs.
<Note>
If you signed up through the [For Enterprise](https://unstructured.io/enterprise) page, of if you are using a self-hosted deployment of Unstructured, your API URL
might be different. For guidance, email Unstructured Sales at [sales@unstructured.io](mailto:sales@unstructured.io).
</Note>

If you still believe you have the correct API URL and API key, try the following steps:

Expand All @@ -70,6 +96,11 @@ If you still believe you have the correct API URL and API key, try the following
- Check the value of the `server_url` parameter. Make sure it is set to the right API URL, or an environment variable representing the right API URL.
- Check the value of the `api_key_auth` parameter. Make sure it is set to the right API key, or an environment variable representing the right API key.

<Note>
If you are using the Unstructured Python SDK to call the Workflow Endpoint or the Partition Endpoint, you should not need to set the value of the
`server_url` parameter if you are using these Endpoints' default API URL. However, you might want to try setting this value anyway to see if it otherwise resolves your issue.
</Note>

**For the Unstructured JavaScript/TypeScript SDK**

- Check the value of the `UnstructuredClient` object's `serverURL` parameter. Make sure it is set to the right API URL, or an environment variable representing the right API URL.
Expand Down