Skip to content
Update a provider OAuth app

Update a provider OAuth app

Save your provider OAuth client, optionally together with activation, World assignment, and tool defaults.

PATCH/api/v1/integrations/:integration/oauth-app

Request#

TypeScript
const response = await fetch("https://api.smallworld.sh/api/v1/integrations/notion/oauth-app", {
  method: "PATCH",
  headers: { Authorization: `Bearer ${apiKey}`, "Content-Type": "application/json" },
  body: JSON.stringify({
  "clientId": "your-client-id",
  "clientSecret": "your-client-secret",
  "enabled": true,
  "worldIds": [
    "01995e56-e2d4-7f19-b691-7bf9af6abdc8"
  ]
}),
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
const result = await response.json();

Use your server-side apiKey. Replace the example IDs.

Path parameters#

integrationstringrequired

An integration key from GET /integrations or /integration-configurations.

Request body#

clientIdstring

1–256 trimmed characters. Omit to keep the existing client ID.

clientSecretstring

At most 512 characters, preserved exactly. Omit or send an empty string to keep the existing secret for the same client.

enabledboolean

Workspace activation. Omitting it preserves activation.

authSchemestring

oauth2 or api_key, from the supported authSchemes. Omitting it preserves the selected scheme.

worldIdsUUID[]

Complete replacement of assigned Worlds. Omit to preserve assignments; [] removes them all. Duplicate IDs are rejected.

toolPoliciesobject[]

Atomic tool-default updates, up to 256 entries. Each entry has toolName and policy (allow, ask, or deny). Omitted tools keep their defaults; [] changes none.

Responses#

Returns the same redacted app configuration as GET /integrations/:integration/oauth-app.

200 response
{
  "integration": "notion",
  "clientId": "your-client-id",
  "hasClientSecret": true,
  "redirectUri": "https://api.smallworld.sh/api/integrations/oauth/notion/callback",
  "scopes": [],
  "requiresCredentials": true,
  "clientSecretRequired": true,
  "configured": true,
  "status": "configured"
}
More about this endpoint

Credentials and accompanying configuration are saved atomically after validation. Secrets are encrypted at rest.

Changing clientId can require a new clientSecret. A provider can require both fields on first setup.

Providers that do not support workspace OAuth apps reject the update. Provider validation can reject invalid credentials before saving.