Namespaces
bot
Methods and types of the `bot` namespace (`client.bot` / `bot.bot`).
Interfaces
Bot
Properties
| Property | Type | Description |
|---|---|---|
accountType | "bot" | - |
apiKey? | BotApiKeySummary | - |
apiKeys? | BotApiKeySummary[] | - |
avatar? | any | Populated avatar Asset (joined server-side from avatarId). The web client resolves the image URL from this field via getAvatarUrl(). |
avatarId | string | null | - |
color | string | - |
createdAt | string | - |
displayName | string | - |
id | string | - |
membershipId? | string | - |
projectMemberships? | BotProjectMembership[] | Project memberships within the workspace the bot belongs to. Populated by listBots and getBot. Empty array if the bot has no project assignments. |
roles? | string[] | - |
status | string | - |
updatedAt | string | - |
BotApiKeySummary
Properties
BotProjectMembership
Properties
| Property | Type |
|---|---|
membershipId | string |
projectId | string |
projectName | string |
roles | BotProjectRole[] |
CreateBotData
Properties
CreateBotResponse
Properties
| Property | Type | Description |
|---|---|---|
bot | Bot | - |
rawKey | string | Raw API key, returned ONCE at creation time. Store it immediately — it cannot be retrieved again. |
RotateBotKeyResponse
Properties
| Property | Type | Description |
|---|---|---|
apiKey | BotApiKeySummary | - |
rawKey | string | New raw API key. Returned once. |
UpdateBotAvatarFileData
Properties
UpdateBotAvatarResponse
Indexable
[k: string]: unknownProperties
UpdateBotData
Properties
Type Aliases
BotProjectRole
type BotProjectRole = "creator" | "reviewer" | "projectAdmin";Functions
default()
function default(client): {
createBot: Promise<CreateBotResponse>;
deleteBot: Promise<void>;
getBot: Promise<Bot>;
listBots: Promise<Bot[]>;
listProjectMemberships: Promise<BotProjectMembership[]>;
removeProjectMembership: Promise<void>;
rotateBotKey: Promise<RotateBotKeyResponse>;
setProjectMembership: Promise<BotProjectMembership>;
updateBot: Promise<Bot>;
updateBotAvatar: Promise<UpdateBotAvatarResponse>;
};Bot user administration methods. Used by workspace owners/admins (callers holding a JWT) to manage bot users in a workspace. Bots themselves cannot call these endpoints — bot administration is restricted server-side.
Parameters
| Parameter | Type |
|---|---|
client | default |
Returns
| Name | Type | Description |
|---|---|---|
createBot() | (workspaceId, data) => Promise<CreateBotResponse> | Create a bot user in a workspace. Returns the new bot and the raw API key (shown only once). |
deleteBot() | (workspaceId, botId) => Promise<void> | Delete a bot user. Revokes all API keys, removes the workspace membership, and marks the user inactive. |
getBot() | (workspaceId, botId) => Promise<Bot> | Get a single bot's details, including all of its API key metadata (no secrets). |
listBots() | (workspaceId) => Promise<Bot[]> | List bot users in a workspace. |
listProjectMemberships() | (workspaceId, botId) => Promise<BotProjectMembership[]> | List the bot's project memberships within the workspace. |
removeProjectMembership() | ( workspaceId, botId, projectId ) => Promise<void> | Remove the bot's membership on a project. Idempotent. |
rotateBotKey() | (workspaceId, botId) => Promise<RotateBotKeyResponse> | Revoke the bot's current API key and issue a new one. The new raw key is returned once. |
setProjectMembership() | ( workspaceId, botId, projectId, data ) => Promise<BotProjectMembership> | Upsert the bot's membership on a project. Replaces roles if a membership already exists; creates one otherwise. Idempotent. |
updateBot() | ( workspaceId, botId, data ) => Promise<Bot> | Update a bot's display name and/or color. |
updateBotAvatar() | ( workspaceId, botId, fileData ) => Promise<UpdateBotAvatarResponse> | Request signed URL data to upload a new avatar for the bot. Upload the file with client.asset.multipartUpload(...) using the returned signedUrlData, then call client.asset.completeUpload(...) to finalize. |