Skip to content
Save group API-key credentials

Save group API-key credentials

Validate and save API-key credentials your backend collected for a group.

POST/api/v1/groups/:groupId/connections/:integration

Request#

TypeScript
const response = await fetch("https://api.smallworld.sh/api/v1/groups/team_42/connections/github", {
  method: "POST",
  headers: { Authorization: `Bearer ${apiKey}`, "Content-Type": "application/json" },
  body: JSON.stringify({
  "credentials": {
    "token": "YOUR_GROUP_GITHUB_TOKEN"
  }
}),
});
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#

groupIdstringrequired

Your application's group ID, URL-encoded. At most 512 characters, with no surrounding whitespace or null bytes.

integrationstringrequired

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

Request body#

credentialsobjectrequired

String values keyed by the integration's credentialFields names. Each value is at most 4096 characters; provider-specific rules also apply.

Responses#

The group's own account, which members without a connection of their own use. Secret credential values are never returned.

200 response
{
  "integration": "github",
  "userId": null,
  "groupId": "team_42",
  "source": "group",
  "overridesGroup": false,
  "authScheme": "api_key",
  "status": "connected",
  "accountId": "654321",
  "accountName": "support-bot",
  "workspaceId": null,
  "connectedAt": "2026-10-10T12:00:01.000Z",
  "updatedAt": "2026-10-10T12:00:01.000Z",
  "error": null
}
More about this endpoint

Fetch /integrations to discover the actual credential fields. This endpoint supports api_key, not oauth2 or none.

Smallworld checks the credentials with the provider before storing them encrypted, once for the whole group. The group must already exist; reconnecting replaces the group's credentials.

Members without a connection of their own use the account from their next tool call. Members with their own connection keep using theirs.