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

# Sync your users' apps

> Let your users connect Notion, Slack, Gmail, Drive, Calendar and GitHub. Constella keeps them in sync.

When a user connects an app, Constella copies their data in, keeps it up to date, and makes it findable by every search and recall for that user. You never touch an OAuth token.

> [card] [Notion](/dev/docs/integrations/notion.md)

> [card] [Slack](/dev/docs/integrations/slack.md)

> [card] [GitHub](/dev/docs/integrations/github.md)

> [card] [Gmail](/dev/docs/integrations/gmail.md)

> [card] [Google Drive](/dev/docs/integrations/google-drive.md)

> [card] [Google Calendar](/dev/docs/integrations/google-calendar.md)

> [!NOTE]
>
> A new project starts with no apps turned on. [Email us](mailto:team@constella.app) with the apps you need. `GET /platform/v1/integrations` shows what your project may connect.

## Option 1: our hosted page

The quickest way. Constella shows a small page with your app's name and one **Continue** button.

**1. Add a return link**

In [Projects](https://www.constella.app/console?tab=projects), add the `https` address users come back to. `http://localhost` works for testing.

**2. Make a connect link**

```bash theme={"system"}
curl https://api.constella.app/platform/v1/users/u_123/connect-links \
  -H "Authorization: Bearer $CONSTELLA_APP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"integration": "notion", "return_url": "https://yourapp.com/connected", "state": "abc"}'

# {"url": "https://api.constella.app/platform/connect/...", "expires_at": "..."}
```

**3. Send the user to it**

The link works for 30 minutes. When they finish, they land on:

```text theme={"system"}
https://yourapp.com/connected?status=connected&integration=notion&state=abc
```

`status` is `connected`, `failed` or `cancelled`. `state` is what you sent, so you can match it.

## Option 2: your own button

Ask for a connect session. You get the app's own sign-in address (good for about 30 minutes), and open it however you like.

```bash theme={"system"}
curl https://api.constella.app/platform/v1/users/u_123/connect-sessions \
  -H "Authorization: Bearer $CONSTELLA_APP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"integration": "slack"}'
```

Then wait for the `connection.connected` [webhook](/dev/docs/build/webhooks.md), or check the user's connections.

## Know when the data is in

The first sync can take a few minutes for a small account and longer for a big one.

**1. connection.connected**

The user finished connecting.

**2. sync.initial\_completed**

The first copy is done, with how many items came in.

**3. sync.updated**

New items arrived. Sent as they come, checked about every 10 minutes.

Or ask any time:

```bash theme={"system"}
curl https://api.constella.app/platform/v1/users/u_123/connections \
  -H "Authorization: Bearer $CONSTELLA_APP_KEY"

# each: status (connected | needs_reconnect), first sync done, how many items
```

## Disconnect

Disconnects the app and forgets what it synced.

```bash theme={"system"}
curl -X DELETE https://api.constella.app/platform/v1/users/u_123/connections/notion \
  -H "Authorization: Bearer $CONSTELLA_APP_KEY"
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.