Skip to content
Disconnect an integration

Disconnect an integration

Disconnect a represented user's own account from an integration.

DELETE/api/v1/users/:userId/connections/:integration

Request#

TypeScript
const response = await fetch("https://api.smallworld.sh/api/v1/users/customer_123/connections/github", {
  method: "DELETE",
  headers: { Authorization: `Bearer ${apiKey}` },
});
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#

userIdstringrequired

Your application's user ID, URL-encoded. At most 512 characters, with no surrounding whitespace or null bytes. Encode the IDs . and .. as %2E and %2E%2E: curl sends these as written, but JavaScript's fetch removes them even when encoded.

integrationstringrequired

An integration key from GET /integrations, such as github or notion.

Responses#

Returns deleted: true. Disconnecting a known user without an account of their own also succeeds and changes nothing, including a user who only uses a group's connection.

200 response
{
  "deleted": true
}
More about this endpoint

Disconnecting cancels this user's in-flight connect sessions for the integration and prevents subsequent tool calls using the old connection.

Only the user's own account is removed. In a session whose group has a connection to the integration, the user's next calls use that connection. Remove a group's connection with DELETE /groups/:groupId/connections/:integration.

The represented user, their persistent terminal sessions, and tool-call history remain.