# Custom OAuth2 clients (apps)

## Use Cases

When using [Embed](https://www.locoia.com/embed-white-label-integration-portal/) you might want to take the whitelabeling one step further and display your end users your own OAuth2 setup screen as well as doing actions on behalf of your app (e.g. sending messages as a Slackbot which has the same name as your company).

Also, some Connectors like [Snowflake](/connectors/connectors/snowflake.md) only allow custom OAuth2 clients/apps.

## Adding and updating custom OAuth2 clients

Currently, adding custom OAuth2 clients is only possible via API, however extended functionality and setup directly inside the Locoia app are coming soon.

## Edit custom auth details

<mark style="color:orange;">`PUT`</mark> `https://api.locoia.com/v1/connectors/{{ connector_id }}/custom_auth`

#### Path Parameters

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| connector\_id<mark style="color:red;">\*</mark> | String | Connector ID |

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer Token |

#### Request Body

| Name                                             | Type   | Description                                                                                    |
| ------------------------------------------------ | ------ | ---------------------------------------------------------------------------------------------- |
| oauth2<mark style="color:red;">\*</mark>         | Array  | The following parameters need to be part of a dictionary inside the `oauth2` array.            |
| client\_id<mark style="color:red;">\*</mark>     | String | Custom client ID                                                                               |
| client\_secret<mark style="color:red;">\*</mark> | String | Custom client secret                                                                           |
| name<mark style="color:red;">\*</mark>           | String | Descriptive name for future reference                                                          |
| scopes                                           | Array  | List of scopes that should be used. Omit parameter if regular Connector scopes should be used. |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "oauth2": [
    {
      "client_id": "CUSTOM_CLIENT_ID",
      "name": "YOUR_SET_NAME"
    }
  ]
}
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
Adding custom OAuth2 clients is only supported via the Bearer Token which is used in the Locoia app itself.\
In order to retrieve it, you have to copy the current Bearer Token from your browser's developer tools.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.locoia.com/connectors/authentication/custom-oauth2-clients-apps.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
