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

# Connect MongoDB Atlas with OAuth 2.0 (Client Credentials) – StackOne Hub

> Link a MongoDB Atlas account in the StackOne Hub using OAuth 2.0 (Client Credentials). End-user guide to authorize the integration and start using MongoDB Atlas actions.

> [!WARNING]
>
> You must have Organization Owner access to the MongoDB Atlas organization to create a service account.

## Create a service account

Create an organization-level service account in MongoDB Atlas to obtain OAuth 2.0 client credentials for the Atlas Administration API.

**1. Sign in to MongoDB Atlas**

Sign in to your [MongoDB Atlas account](https://cloud.mongodb.com).

<ul>
  <li>Select your organization using the **Organization** selector at the top left.</li>
  <li>In the left sidebar, expand **Identity & Access** and click **Applications**.</li>
</ul>

**2. Open the Service Accounts tab**

On the **Applications** page, select the **Service Accounts** tab.

<ul>
  <li>Click **Create service account**. If you already have service accounts, click **Add new** in the top-right corner, then select **Service Account**.</li>
</ul>

![The Applications page in MongoDB Atlas with the Service Accounts tab selected and the Create service account button highlighted.](https://mintcdn.com/stackone-60/n4JWg_YTwGWEflTc/connectors/mongodb/images/oauth2-config-applications.png?fit=max\&auto=format\&n=n4JWg_YTwGWEflTc\&q=85\&s=4169cd693757b071980379cae78c5614)

**3. Enter service account information**

On the **Create Service Account** screen, under **Enter Service Account Information**, complete the form.

<ul>
  <li>**Name**: enter any descriptive name, e.g. StackOne Integration (must not be more than 64 characters).</li>
  <li>**Description**: enter a description of the service account — this field is required (must not be more than 250 characters).</li>
  <li>Choose a **Client Secret Expiration** period (the default is **90 days (recommended)**). You can't change this once the secret is created.</li>
  <li>From **Organization Permissions**, select **Organization Owner**. This is the minimum role required for the integration to work: it is the only organization role that can manage teams and organization API keys while also granting write access to projects, clusters, database users, and IP access lists across all projects.</li>
  <li>If you only need read access, **Organization Read Only** is sufficient, but write operations (creating or updating resources) will not work.</li>
  <li>Click **Create**.</li>
</ul>

![The Create Service Account form in MongoDB Atlas showing the Name, Description, Client Secret Expiration, and Organization Permissions fields.](https://mintcdn.com/stackone-60/n4JWg_YTwGWEflTc/connectors/mongodb/images/oauth2-config-create-service-account.png?fit=max\&auto=format\&n=n4JWg_YTwGWEflTc\&q=85\&s=4cd38c4b48fd4eed4ddbab5ec7748aa2)

## Copy your credentials

After the service account is created, MongoDB Atlas displays its credentials.

**1. Copy the Client ID and Client Secret**

On the **Service Account Information** screen, copy both values and enter them in StackOne Hub.

<ul>
  <li>Click **Copy** next to **Client ID** and copy it across to **Service Account Client ID**.</li>
  <li>Click **Copy** next to **Client Secret** and copy it across to **Service Account Client Secret**.</li>
  <li>The Client Secret is only displayed once and cannot be retrieved later — after you leave this page the full client secret is unavailable, so copy and store it securely before leaving.</li>
</ul>

![The Service Account Information screen in MongoDB Atlas showing the Client ID and Client Secret with Copy buttons (values redacted).](https://mintcdn.com/stackone-60/n4JWg_YTwGWEflTc/connectors/mongodb/images/oauth2-config-credentials.png?fit=max\&auto=format\&n=n4JWg_YTwGWEflTc\&q=85\&s=4464d83f42ebbd090533be7f8bbf72ba)

## Link the Account

**1. Connect**

<ul>
  <li>Click **Connect**.</li>
  <li>If applicable, the provider will redirect you to a sign-in or authorization page. Complete the provider's authorization flow.</li>
  <li>Once authorization is successful, you will see a confirmation popup.</li>
</ul>

**2. Use Actions**

Connect an AI platform to the linked account's actions. See [AI Platforms](https://docs.stackone.com/connect/ai-platforms/overview.md).

Other ways to call actions are listed in [Protocols & SDKs](https://docs.stackone.com/connect/protocols-and-sdks.md).

## Next Steps

> [card] [Webhooks setup](https://docs.stackone.com/connectors/mongodb/guides/webhook-setup.md)
>
> Configure receiving Events for MongoDB Atlas into StackOne.


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