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

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

> [!WARNING]
>
> Ontra API access is not enabled by default — contact [api.support@ontra.ai](mailto:api.support@ontra.ai) to have it turned on for your account. Creating an API client requires Ontra admin privileges.

## Choose an environment

Ontra runs separate production and sandbox environments with separate API clients and credentials.

**1. Select the environment to connect**

Pick the environment that matches the API client you are about to create.

<ul>
  <li>Choose **Production** for live fund and contract data — production always requires an mTLS certificate</li>
  <li>Choose **Sandbox** for development and testing — sandbox accepts either an mTLS certificate or a client secret</li>
</ul>

## Generate an mTLS certificate

Ontra authenticates API clients with a self-signed certificate that you generate yourself and keep.

**1. Create the key pair**

Run `openssl req -x509 -newkey rsa:2048 -keyout private_key.pem -out public_cert.pem -days 365`, replacing `365` with how many days the certificate should stay valid. This writes two files into the current directory.

**2. Keep the private key safe**

`private_key.pem` is the secret half of the pair and is never sent to Ontra. Store it securely and do not share it.

## Create an Ontra API client

Register your public certificate with Ontra to receive a client ID.

**1. Open the API clients page**

Log in to Ontra and navigate to **Admin > Integrations > Ontra API > Manage**.

**2. Create the client**

Create a new API client and upload the `public_cert.pem` file you generated.

<ul>
  <li>Copy the **Client ID** that Ontra issues — you will need it below</li>
  <li>In the sandbox only, you may instead create a client that authenticates with a **Client Secret**</li>
</ul>

## Enter your credentials

Provide the client ID plus either the certificate pair or, in the sandbox, the client secret.

**1. Client ID**

Paste the Client ID from the Ontra API clients page.

**2. Certificate and private key**

Open `public_cert.pem` and `private_key.pem` in a text editor and paste the full contents of each, including the `-----BEGIN ...-----` and `-----END ...-----` marker lines.

**3. Client Secret (sandbox only)**

If you created a sandbox client that uses a client secret, paste it here and leave the certificate and private key blank.

## 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.