Making requests
Send the access token as a Bearer token on every call. Request and response bodies are JSON.
Your first call
List the bots of the user who approved your app:
curl "https://api.lifebots.cloud/api/v1/bots" \
-H "Authorization: Bearer $ACCESS_TOKEN"Identifiers
{bot_id}is the bot's avatar UUID — theagentIdreturned by List Bots.- Avatars, groups, roles, objects and inventory items are Second Life UUIDs. Find them with the lookup endpoints.
- A few fields accept a name instead (
slnameon Send IM,targeton Look At and Offer Friendship). The parameter table says when.
Bot commands run in Second Life
Most /bots/{bot_id}/… calls are passed to the bot, which carries them out in-world and reports back. So:
- The bot must be online. If it isn't, you get
COMMAND_FAILEDwith “Bot is not online.” Start it with Login Bot. - The bot needs the right in-world rights — group powers to invite, estate manager to kick.
- A response can take a few seconds (up to a minute for slow operations).
Handle both kinds of failure
A request can fail at the API (wrong token, missing scope — success: false) or at the bot (it got the command but couldn't do it — data.result: "FAIL"). Check both:
// A small wrapper that handles both kinds of failure
async function lifebots(method, path, body) {
const res = await fetch('https://api.lifebots.cloud/api/v1' + path, {
method,
headers: {
Authorization: `Bearer ${accessToken}`,
'Content-Type': 'application/json'
},
body: body ? JSON.stringify(body) : undefined
})
const json = await res.json()
if (!json.success) {
// The API refused: bad token, missing scope, bad parameter...
throw new Error(`${json.error.code}: ${json.error.message}`)
}
if (json.data?.result === 'FAIL') {
// The bot got the command but couldn't do it
throw new Error(json.data.resulttext)
}
return json.data
}
const { bots } = await lifebots('GET', '/bots')Details and every error code: Responses & errors.
Pagination
List Bots and List Registered Groups take page (from 1) and limit (default 25, max 100), and return a pagination object with total, totalPages, hasNext and hasPrev.
Rate limits
Bot commands are limited to 60 a minute per token. See Responses & errors for every limit.