> ## Documentation Index
> Fetch the complete documentation index at: https://docs.elementum.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect a REST API via CloudLink

> Set up a CloudLink to an external REST API for use in API-powered dropdowns and API Elements.

In addition to data warehouses, Elementum can create a CloudLink to an external REST API. The primary use case for an API CloudLink is populating [API-powered dropdowns](/workflows/api-powered-dropdowns)—it stores the base URL and credentials in one place so dropdown fields and API Elements can call the API without re-entering connection details.

If you're new to CloudLink, start with the [CloudLink Overview](/administration/cloudlink-overview) for the underlying concepts and security model.

<Info>
  Before creating an API CloudLink, review [Populate Dropdown Fields from External APIs](/workflows/api-powered-dropdowns) to confirm this is the right setup for your use case and to see how the CloudLink is consumed downstream.
</Info>

<Warning>
  **AI services are not supported on API CloudLinks.** [AI Services](/ai-agents/ai-services) (LLMs, embeddings, Snowflake Cortex, etc.) require a CloudLink configured against a supported data warehouse such as Snowflake. If you need AI services, set up a [Snowflake CloudLink](/administration/connect-snowflake-to-elementum) instead.
</Warning>

## Prerequisites

Before creating an API CloudLink, gather:

* **Admin access** to your Elementum organization (required to manage CloudLinks)
* **Base URL** of the external API (for example, `https://api.example.com/v1`)
* **Authentication details** for the API, depending on the method:
  * Basic — username and password
  * Bearer Token — a static API token
  * OAuth 2.0 — token URL, client ID, and client secret
* **Network reachability** — confirm the API is reachable from the public internet. Elementum sends API requests server-side from its platform infrastructure.

## Create an API CloudLink

<Steps>
  <Step title="Open the CloudLinks page">
    In Elementum, open <img src="https://mintcdn.com/elementum/TFCVHNVI8zhq54sg/images/icons/settings.svg?fit=max&auto=format&n=TFCVHNVI8zhq54sg&q=85&s=3ffc43e8a0875412cc27335241aeb4c8" alt="Settings icon" className="inline-ui-icon" width="24" height="24" data-path="images/icons/settings.svg" /> **Organization Settings** and select **CloudLinks**.
  </Step>

  <Step title="Start a new CloudLink">
    Click **+ CloudLink** in the upper right. In the **Create New CloudLink** dialog, select **API**.
  </Step>

  <Step title="Enter connection details">
    Fill out the API connection form:

    | Field              | Description                                                                                                                                                  |
    | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
    | **Name**           | A descriptive name for the connection (for example, `Acme CRM` or `Internal Pricing API`). This is how the CloudLink appears in pickers across Elementum.    |
    | **Base URL**       | The root URL of the API. Endpoint paths configured later (on Elements or dropdown fields) are appended to this base URL. Use `https://` for production APIs. |
    | **Authentication** | The method used to authenticate requests. See [API authentication methods](#api-authentication-methods) below.                                               |
  </Step>

  <Step title="Configure authentication">
    Select an authentication method from the dropdown and provide the required credentials. The fields displayed change based on the method you choose.
  </Step>

  <Step title="Save the connection">
    Click **Save**. The new API CloudLink appears on the **CloudLinks** page and can be selected when configuring API Elements or API-powered dropdown fields.
  </Step>
</Steps>

## API authentication methods

Choose the method supported by the external API:

| Method           | Required fields                                      | Notes                                                                                                                  |
| ---------------- | ---------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| **Basic**        | Username, Password                                   | Sent as a Base64-encoded `Authorization: Basic` header. Use only over HTTPS.                                           |
| **Bearer Token** | Token                                                | Sent as `Authorization: Bearer <token>` on every request.                                                              |
| **OAuth 2.0**    | Token URL, Client ID, Client Secret (optional Scope) | Elementum runs the client credentials flow, caches the access token, and refreshes it automatically before expiration. |
| **None**         | —                                                    | No authentication header is sent. Use only for public, unauthenticated endpoints.                                      |

<Warning>
  Avoid Basic authentication over non-HTTPS endpoints. Credentials are stored encrypted at rest in Elementum and are not displayed again in the UI after they're saved.
</Warning>

## Edit or rotate API credentials

To update the URL or credentials on an existing API CloudLink:

1. On the **CloudLinks** page, click **Edit** next to the API connection.
2. Change the fields you need to update and click **Save**.

For credential rotation, update the credentials in the external system first, then update them on the CloudLink to keep requests flowing without an outage.

## Using an API CloudLink

After the API CloudLink is saved, use it to power dropdown fields. Continue with [Populate Dropdown Fields from External APIs](/workflows/api-powered-dropdowns), which covers both options:

* **API Picklist field** — A dropdown that calls the CloudLink's endpoint directly and maps the response to options.
* **Dynamic Dropdown on an API Element** — A dropdown backed by an API Element built on top of the CloudLink, suited for cases where the external data needs to participate in relationships, calculations, or reports.

## Troubleshooting

| Issue                                   | Resolution                                                                                                                                                                                                                      |
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Save fails with an authentication error | Confirm the credentials work outside Elementum (for example, with `curl` or Postman). For OAuth 2.0, verify the token URL and that the client has access to the requested scope.                                                |
| Requests time out                       | Confirm the API is reachable from the public internet. If the API restricts inbound traffic, allow Elementum's outbound IP addresses (see [Elementum IP addresses](/administration/cloudlink-overview#elementum-ip-addresses)). |
| Dropdown or Element returns no data     | Verify the **Base URL** does not include a trailing endpoint path that conflicts with the path configured on the Element or dropdown. Endpoints are appended to the base URL.                                                   |
| Need to change the auth method          | Edit the CloudLink and select a different **Authentication** option. The credential fields update to match the new method.                                                                                                      |

## Next steps

<CardGroup cols={2}>
  <Card title="API-powered dropdowns" icon="list" href="/workflows/api-powered-dropdowns">
    Use this CloudLink to populate dropdown fields from external APIs.
  </Card>

  <Card title="CloudLink Overview" icon="cloud" href="/administration/cloudlink-overview">
    Review the CloudLink concept and security model.
  </Card>
</CardGroup>
