> ## 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 CyberArk (Privilege Cloud) with OAuth 2.0 (Client Credentials) – StackOne Hub

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

> [!WARNING]
>
> You must be an Identity Administration portal administrator to create service accounts and assign roles. The service account consumes a Privilege Cloud license.

## Creating an OAuth Service Account

CyberArk Privilege Cloud uses OAuth 2.0 Client Credentials for API authentication. You need to create a dedicated service user in the CyberArk Identity Administration portal.

**1. Open the Users page**

Sign in to your CyberArk Identity Administration portal at `https://{tenant-id}.id.cyberark.cloud`, then go to **Core Services** > **Users**.

**2. Create a New Service User**

Click **Add User** and fill in the following fields.

<ul>
  <li>**Login Name**: Enter a descriptive name (e.g., `stackone-api-service`). This will be your **Client ID**.</li>
  <li>**Display Name**: Enter a display name (e.g., `StackOne API Service Account`)</li>
  <li>**Password**: Set a strong password. This will be your **Client Secret**.</li>
</ul>

**3. Configure Service Account Settings**

In the **Status** checklist, enable the following checkboxes before saving.

<ul>
  <li>**Is OAuth confidential client** — Required for OAuth 2.0 authentication</li>
  <li>**Is Service User** — Marks this as a non-interactive API account</li>
  <li>**Password never expires** — Automatically selected for service users</li>
</ul>

**4. Save the Service Account**

Click **Create User** to save.

<ul>
  <li>Service users do not appear in the active users list</li>
  <li>To view service users, click **All Users** or **All Service Users** in the filter</li>
  <li>Store the Login Name (Client ID) and Password (Client Secret) securely</li>
</ul>

## Assigning Privilege Cloud Roles

The service account must be assigned to the correct role to access Privilege Cloud APIs.

**1. Navigate to Roles**

In the Identity Administration portal, go to **Core Services** > **Roles**.

**2. Add Service User to Privilege Cloud Role**

Find and open the **Privilege Cloud Administrators** role (or the appropriate role for your use case), then add the service user as a member.

<ul>
  <li>**Privilege Cloud Administrators** — Full API access (uses Privileged Standard User license)</li>
  <li>**Privilege Cloud Administrators Basic** — Limited access (uses Privileged Basic User license)</li>
  <li>**Privilege Cloud Users** — Standard user-level access</li>
  <li>Click **Members** tab, then **Add** to add your service user</li>
</ul>

**3. Configure Vault-Level Permissions (Optional)**

For actions like managing users, groups, or safes, the service account may need additional Vault-level permissions.

<ul>
  <li>**Audit Users** — Required for listing and viewing users/groups</li>
  <li>**Add/Update Users** — Required for creating, updating, and deleting users/groups</li>
  <li>**Reset Users' Passwords** — Required for password reset actions</li>
  <li>**Add Safes** — Required for creating new safes</li>
  <li>**Manage Safe Members** — Required for adding/updating/removing safe members</li>
</ul>

## Finding Your Tenant ID

The Identity Tenant ID is needed to construct the OAuth token endpoint URL.

**1. Locate Your Tenant ID**

In the Identity Administration portal, click the **user icon** in the top-right corner.

<ul>
  <li>Click **About** or **Tenant Details** to see your Tenant ID</li>
  <li>Your Identity tenant URL follows the format: `https://<tenant-id>.id.cyberark.cloud`</li>
  <li>The Tenant ID is the prefix before `.id.cyberark.cloud`</li>
  <li>**Important**: The Identity Tenant ID may differ from your Privilege Cloud subdomain</li>
</ul>

## Finding Your Privilege Cloud Subdomain

The Privilege Cloud subdomain is needed to construct the API base URL.

**1. Locate Your Subdomain**

Open your CyberArk Privilege Cloud portal in a browser.

<ul>
  <li>Your Privilege Cloud URL follows the format: `https://<subdomain>.privilegecloud.cyberark.com`</li>
  <li>The subdomain is the prefix before `.privilegecloud.cyberark.com`</li>
  <li>Example: If your URL is `https://acme.privilegecloud.cyberark.com`, your subdomain is `acme`</li>
  <li>You can also find this in the CyberArk welcome email or by contacting your CyberArk administrator</li>
</ul>

## 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/ai-platforms/overview.md).

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


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