> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://apidocs.polytomic.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://apidocs.polytomic.com/_mcp/server.

Polytomic Connect handles authentication to your customers' systems so
you do not have to build input forms or OAuth flows yourself. It works
with databases, data warehouses, CRMs, cloud buckets, spreadsheets, and
arbitrary HTTP APIs.

With a single API call, you can open a Polytomic-generated auth modal
for any supported integration. For example, Polytomic Connect generates
these modals for HubSpot and Snowflake:

![HubSpot](https://fern-image-hosting.s3.amazonaws.com/polytomic/polytomic-oauth.png)

![Snowflake](https://fern-image-hosting.s3.amazonaws.com/polytomic/polytomic-snowflake.png)

\


Polytomic supports many other integrations. You can open an auth modal
for any of them without knowing which parameters each one requires.

## Modal appearance options

### Restricting integrations

Use the `whitelist` parameter to restrict which integrations customers
can connect to.

Pass a single-element array to allow only one integration — for example,
`["salesforce"]` sends the user straight into the Salesforce auth form.

Pass multiple values — for example, `["salesforce", "hubspot"]` — to
present the user with a picker first, then the auth form for their
selection.

### Dark mode

Set the `dark` parameter to `true` to render the modal in dark theme.

### Custom logo

The auth modal can display your company's logo instead of Polytomic's.
To enable this, email an SVG of your logo to [support@polytomic.com](mailto:support@polytomic.com).
Below are light- and dark-mode examples with a custom logo in the top
left and a restricted integration list:

![Light mode](https://www-polytomic-assets.s3.us-west-2.amazonaws.com/api-docs/custom-logo-light-mode.png)
![Dark mode](https://www-polytomic-assets.s3.us-west-2.amazonaws.com/api-docs/custom-logo-dark-mode.png)

## Connect modal initialization

### Steps

#### Obtain an API key

If you do not already have one, see [obtaining an API key](/guides/obtaining-api-keys).

#### Request a connect redirect URL

Call `/api/connections/connect` with the connection types and any additional parameters. Make this call once per user connection.

#### Open the connect modal

Send the user to the URL returned in the `redirectURL` field.

### Request parameters

|  NAME       |  TYPE     | DESCRIPTION                                                                         |  REQUIRED  |
| ----------- | --------- | ----------------------------------------------------------------------------------- | ---------- |
| name        | string    | The name of the connection. Connection names must be unique within an organization. | true       |
| redirectURL | string    | The URL to redirect to after the connection is authenticated.                       | true       |
| whitelist   | string\[] | A list of connection types to whitelist.                                            | false      |
| dark        | boolean   | Whether to use the dark theme.                                                      | false      |

## Code example

The following example authenticates to PostgreSQL through the Polytomic
Connect API. The caller does not need to know which inputs PostgreSQL
requires — Polytomic Connect handles that.

\


Proxy the request through a backend server so your API token stays off
the client. The example is split into frontend and backend.

**`frontend.tsx`**

```javascript title="frontend.tsx"
const REDIRECT_URL = "http://localhost:8080/connect_complete";

async function initiatePolytomicConnect() {
  const response = await fetch(`/_/api/connections/connect`, {
    method: "POST",
    mode: 'cors',
    cache: 'no-cache', 
    credentials: 'same-origin',
    body: JSON.stringify({
      name: "My connection",
      whitelist: ["salesforce", "hubspot", "marketo", "outreach"],
      redirect_url: REDIRECT_URL,
      dark: true,
    }),
  });
  if (response.ok) {
    const data = await response.json();
    window.open(data.data.redirect_url, "_blank")
    return;
  }
  const { error } = await response.json();
  throw new Error(error);
}
```

**`backend.py`**

```python title="backend.py"
import requests

from fastapi import FastAPI, Request, Response
from fastapi.middleware.cors import CORSMiddleware


token = "YOUR-API-TOKEN"

app = FastAPI()
origins = ["*"]

app.add_middleware(
    CORSMiddleware,
    allow_origins=origins,
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)


# Proxy request from frontend and inject token
@app.post("/_/api/connections/connect/")
async def connect(request: Request):
    body = await request.json()
    response = requests.post(
        url="https://app.polytomic.com/api/connections/connect/", 
        headers={
            "Authorization": f"Bearer {token}",
            "Content-Type": "application/json",
            "X-Polytomic-Version": "2023-04-25"
        },
        json=body,
    )

    return Response(
        content=response.content,
        status_code=response.status_code,
        headers=dict(response.headers),
    )    
```