lt.botAccounts
lt.botAccounts manages service identities: bot accounts that hold roles and authenticate with API keys. See Identity.
const result = await lt.botAccounts.list({ limit: 50, offset: 0 });List bot accounts with pagination.
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
limit |
number |
No | Max bots to return (default 50) |
offset |
number |
No | Bots to skip (default 0) |
status |
string |
No | Filter by status |
search |
string |
No | Search term |
Returns: LTApiResult<{ bots: Bot[], total: number }>
Auth: Not required.
const result = await lt.botAccounts.get({ id: 'bot-id' });Get one bot account by ID.
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id |
string |
Yes | Bot ID |
Returns: LTApiResult<Bot>
Auth: Not required.
create
Section titled “create”const result = await lt.botAccounts.create({ name: 'deploy-bot', description: 'Automated deployment bot', roles: [{ role: 'deployer', type: 'member' }],});Create a bot account with optional roles.
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
name |
string |
Yes | Unique bot name |
description |
string |
No | Description of the bot |
display_name |
string |
No | Display name |
roles |
{ role: string, type: string }[] |
No | Roles to assign at creation. type is superadmin, admin or member |
Returns: LTApiResult<Bot>. 400 without name.
Auth: Optional. The userId is recorded as the bot’s creator when provided.
update
Section titled “update”const result = await lt.botAccounts.update({ id: 'bot-id', display_name: 'New Name' });Update mutable fields on a bot account.
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id |
string |
Yes | Bot ID |
display_name |
string |
No | New display name |
description |
string |
No | New description |
status |
string |
No | New status |
Returns: LTApiResult<Bot>
Auth: Not required.
delete
Section titled “delete”const result = await lt.botAccounts.delete({ id: 'bot-id' });Delete a bot account.
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id |
string |
Yes | Bot ID |
Returns: LTApiResult<{ deleted: true }>
Auth: Not required.
getRoles
Section titled “getRoles”const result = await lt.botAccounts.getRoles({ id: 'bot-id' });List the roles assigned to a bot account.
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id |
string |
Yes | Bot ID |
Returns: LTApiResult<{ roles: Role[] }>
Auth: Not required.
addRole
Section titled “addRole”const result = await lt.botAccounts.addRole({ id: 'bot-id', role: 'deployer', type: 'member' });Assign a role to a bot account.
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id |
string |
Yes | Bot ID |
role |
string |
Yes | Role to assign |
type |
string |
Yes | superadmin, admin or member |
Returns: LTApiResult<Role>
Auth: Not required.
removeRole
Section titled “removeRole”const result = await lt.botAccounts.removeRole({ id: 'bot-id', role: 'deployer' });Remove a role from a bot account.
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id |
string |
Yes | Bot ID |
role |
string |
Yes | Role to remove |
Returns: LTApiResult<{ removed: true }>
Auth: Not required.
listKeys
Section titled “listKeys”const result = await lt.botAccounts.listKeys({ id: 'bot-id' });List a bot account’s API keys.
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id |
string |
Yes | Bot ID |
Returns: LTApiResult<{ keys: ApiKey[] }>
Auth: Not required.
createKey
Section titled “createKey”const result = await lt.botAccounts.createKey({ id: 'bot-id', name: 'ci-deploy-key', scopes: ['deploy', 'read'], expires_at: '2027-12-31T23:59:59Z',});Create an API key for a bot account. The secret is returned once, in this response.
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id |
string |
Yes | Bot ID |
name |
string |
Yes | Name for the key |
scopes |
string[] |
No | Permission scopes that restrict the key |
expires_at |
string |
No | ISO 8601 expiry |
Returns: LTApiResult<ApiKey>, including the secret.
Auth: Not required.
revokeKey
Section titled “revokeKey”const result = await lt.botAccounts.revokeKey({ keyId: 'key-id', botId: 'bot-id' });Revoke a bot API key.
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
keyId |
string |
Yes | API key ID |
botId |
string |
No | When given, the key is revoked only if it belongs to this bot; otherwise 404 |
Returns: LTApiResult<{ revoked: true }>
Auth: Not required.
