Skip to content
PUT /connector/{slug}/oauth-app

Replaces the stored application wholesale, with one exception the setup form depends on: omitting `client_secret` keeps the secret already stored, so correcting a typo in the client id cannot destroy a working secret. Send both to rotate. Scope overrides (`scope`, `optional_scope`, `user_scope`) are optional; omit them to keep the connector’s catalog scopes, or send arrays to replace them. Endpoint fields (token host, other authorize params) are not accepted here by design. Returns the same shape as the read, so the secret does not come back. Requires `connector:manage`.

Path Parameters

slugstring
required·

Connector slug.

Request Body

client_idstring
client_secretstring

Omit to keep the stored secret. Never returned by any endpoint.

optional_scopestring[]
scopestring[]

Omit to keep the catalog scopes; an array overrides them wholesale.

user_scopestring

Space-separated authorize-URL scopes (params.user_scope).

Response Body

client_idstring,null
has_client_secretboolean

Whether a secret is stored. The secret itself is never returned.

oauth_app_modestring

Which application connects on this connector use.

Possible values:
platform_defaultbyoa
optional_scopearray,null
scopearray,null

Scope overrides this org stored, or null when it kept the catalog scopes.

updated_atstring,null
user_scopestring,null

Space-separated authorize-URL scopes (params.user_scope), or null.

curl -X PUT 'https://api.elaichi.ai/connector/<slug>/oauth-app' \
  -H 'Authorization: Bearer $ELAICHI_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"client_id":"your_client_id","client_secret":"your_client_secret","scope":[],"optional_scope":[],"user_scope":"your_user_scope"}'
const body = {
  "client_id": "your_client_id",
  "client_secret": "your_client_secret",
  "scope": [],
  "optional_scope": [],
  "user_scope": "your_user_scope"
};

const response = await fetch('https://api.elaichi.ai/connector/<slug>/oauth-app', {
  method: 'PUT',
  headers: {
    'Authorization': 'Bearer ' + process.env.ELAICHI_API_TOKEN,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(body),
});

const data = await response.json();
console.log(data);
import os
import requests

url = "https://api.elaichi.ai/connector/<slug>/oauth-app"
headers = {
    "Authorization": f"Bearer {os.environ['ELAICHI_API_TOKEN']}",
    "Content-Type": "application/json",
}
payload = {
    "client_id": "your_client_id",
    "client_secret": "your_client_secret",
    "scope": [],
    "optional_scope": [],
    "user_scope": "your_user_scope"
}

response = requests.put(url, headers=headers, json=payload)
print(response.json())