MoonBots By [Starries]
MoonBots API
LSL Examples
Commands
LSL Examples

MoonBots HTTP API

Control your Second Life bots from LSL scripts, PHP, Python, or any language that speaks HTTP.

LSL Examples
Send every call to https://moonbots.co/api/bot.php
GETPOST
Getting Started
Helper scriptPaste this in first

Pick your language, paste it into your script and put in your API key and bot name. Every example on this page uses it.

string apiKey  = "YOUR_API_KEY";
string botName = "Firstname Lastname";

moonbotsAPI(string action, list params)
{
    string body = "action=" + action
        + "&apikey=" + llEscapeURL(apiKey)
        + "&botname=" + llEscapeURL(botName);
    integer i;
    for (i = 0; i < llGetListLength(params); i += 2)
        body += "&" + llList2String(params, i) + "="
              + llEscapeURL(llList2String(params, i + 1));
    llHTTPRequest("https://moonbots.co/api/bot.php",
        [HTTP_METHOD, "POST",
         HTTP_MIMETYPE, "application/x-www-form-urlencoded"],
        body);
}

default
{
    touch_start(integer n)
    {
        moonbotsAPI("im", ["slname", "Yaueger Resident",
                           "message", "Hello!"]);
    }

    http_response(key id, integer status, list meta, string body)
    {
        llOwnerSay("API: " + body);
    }
}
RepliesText or JSON

Each reply comes back as lines of name=value. Add dataType=json to any call if you'd rather have JSON.

Example reply
result=OK
status=online_1
region=MoonBots
CreditsA fresh pool every day

Each call uses 1 credit. Every bot you have adds credits to your daily pool, and all your keys share it. The pool fills back up at midnight SLT.

1,000for each Model bot
1,500for each RLV bot
3,000for each Premium bot
Not a coder? Try Bot Routines

You don't need to write any code to make your bot do things on its own. Bot Routines let you set up simple rules from your bot's page, a bit like telling a helper "when this happens, do that".

WhenPick what starts it, like someone saying hello or a time of day.
Only ifAdd a check if you want one, like only at night. You can skip this.
ThenPick what the bot does, like say something, send an IM or restart.

Here are two simple ones to give you the idea:

Say hello to visitorsON

When someone in local chat says hello, say "Hi %SL_NAME%, welcome to our store!"

Fresh start every morningON

At 3:00 am SLT every day, restart the bot.

To make your own, open your bot from your manage page and click Bot Routines. The Routine Library has ready made ones you can add with one click.

Status 5 commands
status Check if the bot is online and where it is
PRE-CONNECTING means the bot is about to log in. CONNECTING means it is logging in now. LOGGED_OUT means it was logged out on purpose. OFFLINE means it could not be reached. This command works even when the bot is offline.
Parameters

Nothing extra. Just send action, apikey and botname.

What comes back
statusONLINE, PRE-CONNECTING, CONNECTING, LOGGED_OUT or OFFLINE.
online1 if the bot is online, 0 if not.
slnameThe bot's Second Life name.
uuidThe bot's UUID.
locationThe region and position the bot is at.
slurlA map link to where the bot is.
Example response
Example response
result=OK
status=ONLINE
online=1
slname=Moonbots Resident
uuid=7d32f86c-4b44-494a-b90b-fc0d4e3f71bf
location=MoonBots/128/128/25
slurl=https://maps.secondlife.com/secondlife/MoonBots/128/128/25
Code
moonbotsAPI("status", []);

These use the helper script from Getting Started.

login Log the bot in to Second Life
Logging in takes a minute or two. Use status to see when the bot is online. Works when the bot is offline.
Parameters

Nothing extra. Just send action, apikey and botname.

What comes back
statusPENDING_STARTUP while the bot logs in.
messageA short note about what happened.
Example response
Example response
result=OK
status=PENDING_STARTUP
message=Login sequence started
Code
moonbotsAPI("login", []);

These use the helper script from Getting Started.

logout Log the bot out of Second Life
The bot stays offline until you log it in again.
Parameters

Nothing extra. Just send action, apikey and botname.

What comes back
statusOFFLINE once the bot has logged out.
messageA short note about what happened.
Example response
Example response
result=OK
status=OFFLINE
message=Logout sequence completed
Code
moonbotsAPI("logout", []);

These use the helper script from Getting Started.

restartNEW! Restart the bot
The bot logs out and back in again, which takes a minute or two. Use status to see when it is back. Works when the bot is offline.
Parameters

Nothing extra. Just send action, apikey and botname.

What comes back
statusPENDING_RESTART while the bot restarts.
messageA short note about what happened.
Example response
Example response
result=OK
status=PENDING_RESTART
message=Restart sequence started
Code
moonbotsAPI("restart", []);

These use the helper script from Getting Started.

set_http_callback Send bot events to your own web address
Each event arrives as a POST with action, bot_name, bot_uuid and event_time, plus details for that event such as avatar_name, avatar_uuid or message. Reply with HTTP 200. Each API key can have one callback per bot, so setting a new one replaces the old one. A callback that fails 50 times in a row is turned off. Works when the bot is offline.
Parameters
url Your web address that will receive the events, like "https://example.com/bot.php". Leave it empty to turn callbacks off. Required
events Which events to send, separated by commas, or "all". Choose from group_invite, start_typing, instant_message, chat_message, balance_changed, script_dialog, online_status, teleport_status, group_message, offer_inventory, offer_friendship, offer_teleport, offer_friendship_accepted, offer_friendship_declined and permission_request. Default: all. Optional
operation Use "remove" to turn callbacks off. Default: add. Optional

Plus action, apikey and botname, like every call.

What comes back
callbackset or removed.
eventsThe events that will be sent.
Example response
Example response
result=OK
callback=set
events=all
Code
moonbotsAPI("set_http_callback", [
    "url", "https://example.com/bot.php"
]);

These use the helper script from Getting Started.

Messaging 6 commands
im Send an instant message to an avatar
Premium bots only. Counts toward your daily Second Life message limit.
Parameters
slname The avatar's name, like "Yaueger Resident". Required, or use the other name or uuid field
uuid The avatar's UUID. Use this instead of slname if you have it. Optional
message What to say, like "Hello from my bot!". Required

Plus action, apikey and botname, like every call.

Example response
Example response
result=OK
Code
moonbotsAPI("im", [
    "slname",  "Yaueger Resident",
    "message", "Hello from my bot!"
]);

These use the helper script from Getting Started.

say_chat_channel Say something in local chat
The bot says it on the public chat channel. Counts toward your daily Second Life message limit.
Parameters
message What to say, like "Welcome to the store!". Required
chat_type Normal, Whisper or Shout. Default: Normal. Optional

Plus action, apikey and botname, like every call.

Example response
Example response
result=OK
Code
moonbotsAPI("say_chat_channel", [
    "message", "Welcome to the store!"
]);

These use the helper script from Getting Started.

send_group_im Send a message to a group chat
Premium bots only. The bot must be in the group. Counts toward your daily Second Life message limit once for each group member who is online.
Parameters
group_uuid The group's UUID, like "2666017d-7a44-78eb-fbe9-4b46df67296a". Required
message What to say, like "Event starting now!". Required

Plus action, apikey and botname, like every call.

Example response
Example response
result=OK
Code
moonbotsAPI("send_group_im", [
    "group_uuid", "2666017d-7a44-78eb-fbe9-4b46df67296a",
    "message",    "Event starting now!"
]);

These use the helper script from Getting Started.

reply_dialog Click a button on a blue script menu
You get the channel and object UUID from the script_dialog callback event.
Parameters
channel The menu's channel number, like "-12345". Required
button The button text to click, like "Accept". Required
object_uuid The UUID of the object that showed the menu. Required

Plus action, apikey and botname, like every call.

Example response
Example response
result=OK
Code
moonbotsAPI("reply_dialog", [
    "channel",     "-12345",
    "button",      "Accept",
    "object_uuid", "abcdef12-3456-7890-abcd-ef1234567890"
]);

These use the helper script from Getting Started.

typing_start Show the bot typing in chat
Parameters
delay How many seconds to keep typing before it stops by itself, like "15". Default: 15. Optional

Plus action, apikey and botname, like every call.

Example response
Example response
result=OK
Code
moonbotsAPI("typing_start", []);

These use the helper script from Getting Started.

typing_stop Stop showing the bot typing
Parameters

Nothing extra. Just send action, apikey and botname.

Example response
Example response
result=OK
Code
moonbotsAPI("typing_stop", []);

These use the helper script from Getting Started.

Friendship 3 commands
offer_friendship Send a friendship offer to an avatar
Parameters
slname The avatar's name, like "Yaueger Resident". Required, or use the other name or uuid field
uuid The avatar's UUID. Use this instead of slname if you have it. Optional
message The message sent with the offer, like "Would you like to be my friend?". This is also the default. Optional

Plus action, apikey and botname, like every call.

Example response
Example response
result=OK
Code
moonbotsAPI("offer_friendship", [
    "slname", "Yaueger Resident"
]);

These use the helper script from Getting Started.

cancel_friendship Remove an avatar from the bot's friends
The avatar must be on the bot's friends list.
Parameters
slname The avatar's name, like "Yaueger Resident". Required, or use the other name or uuid field
uuid The avatar's UUID. Use this instead of slname if you have it. Optional

Plus action, apikey and botname, like every call.

Example response
Example response
result=OK
Code
moonbotsAPI("cancel_friendship", [
    "slname", "Yaueger Resident"
]);

These use the helper script from Getting Started.

edit_friendship Change what a friend can see and do
Send at least one of see_online, see_on_map or can_edit. The avatar must already be the bot's friend.
Parameters
slkey The friend's UUID or name, like "Yaueger Resident". Required
see_online 1 to let them see when the bot is online, 0 to hide it. Optional
see_on_map 1 to let them find the bot on the map, 0 to hide it. Optional
can_edit 1 to let them edit the bot's objects, 0 to stop them. Optional

Plus action, apikey and botname, like every call.

What comes back
see_online1 or 0 after the change.
see_on_map1 or 0 after the change.
can_edit1 or 0 after the change.
Example response
Example response
result=OK
see_online=1
see_on_map=0
can_edit=0
Code
moonbotsAPI("edit_friendship", [
    "slkey", "Yaueger Resident"
]);

These use the helper script from Getting Started.

Inventory 9 commands
inventory_give Give an item or folder to an avatar
Use the inventory UUID, not the asset UUID. Folders are given as a whole. Counts toward your daily Second Life message limit.
Parameters
slname The person's name, like "Yaueger Resident". Required, or use the other name or uuid field
uuid The person's UUID. Use this instead of slname if you have it. Optional
item The UUID of the item or folder in the bot's inventory, like "a1b2c3d4-e5f6-7890-abcd-ef1234567890". Required

Plus action, apikey and botname, like every call.

Example response
Example response
result=OK
Code
moonbotsAPI("inventory_give", [
    "slname", "Yaueger Resident",
    "item",   "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
]);

These use the helper script from Getting Started.

wear Wear clothing, a body part or an attachment
Parameters
item The item's inventory UUID or its folder path, like "/Clothing/Red Dress". Required
replace "true" to swap out what is worn in the same spot, "false" to add it. Default: false. Optional

Plus action, apikey and botname, like every call.

Example response
Example response
result=OK
Code
moonbotsAPI("wear", [
    "item", "/Clothing/Red Dress"
]);

These use the helper script from Getting Started.

takeoff Take off something the bot is wearing
Parameters
item The item's inventory UUID or its folder path, like "/Clothing/Red Dress". Required

Plus action, apikey and botname, like every call.

Example response
Example response
result=OK
Code
moonbotsAPI("takeoff", [
    "item", "/Clothing/Red Dress"
]);

These use the helper script from Getting Started.

rebake Reload the bot's look
Useful when the bot looks grey or blurry to others.
Parameters

Nothing extra. Just send action, apikey and botname.

Example response
Example response
result=OK
Code
moonbotsAPI("rebake", []);

These use the helper script from Getting Started.

inventory_list List what is inside an inventory folder
Use forward slashes for folders inside folders, like "/Clothing/Dresses".
Parameters
path The folder to list, like "/Objects". Default: the top of the inventory. Optional

Plus action, apikey and botname, like every call.

What comes back
dataA list of name, item, type, permissions and time for each entry, all separated by commas.
Example response
Example response
result=OK
data=name,Red Dress,item,b572d860-1c2e-4f0a-9d3b-5e8a7c61f204,type,Clothing,permissions,cmvt,time,2026-09-01T14:22:05Z
Code
moonbotsAPI("inventory_list", []);

These use the helper script from Getting Started.

inventory_delete Move an inventory item to the Trash
The item can be taken back out of the Trash until the Trash is emptied.
Parameters
item The UUID of the item to delete. Required

Plus action, apikey and botname, like every call.

Example response
Example response
result=OK
Code
moonbotsAPI("inventory_delete", [
    "item", "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
]);

These use the helper script from Getting Started.

notecard_create Make a new notecard in the bot's inventory
Parameters
name The notecard's name, like "Welcome". Required
text What the notecard says. Use %0A for a new line. Required
description A short description for the notecard. Optional
folder The UUID of the folder to put it in. Default: the Notecards folder. Optional

Plus action, apikey and botname, like every call.

What comes back
uuidThe new notecard's inventory UUID.
asset_uuidThe asset UUID of the notecard text.
folderThe folder it was saved in.
Example response
Example response
result=OK
uuid=b572d860-1c2e-4f0a-9d3b-5e8a7c61f204
asset_uuid=1f0a6c3e-77d2-4b19-a0c4-3e2d9b8f5a17
folder=c5cf2a90-3b6e-4d81-9f27-6a1d0e4b8c35
Code
moonbotsAPI("notecard_create", [
    "name", "Welcome",
    "text", "YOUR_VALUE"
]);

These use the helper script from Getting Started.

notecard_read Read the text of a notecard
The notecard must be in the bot's inventory.
Parameters
item The notecard's inventory UUID. Required

Plus action, apikey and botname, like every call.

What comes back
dataThe full text of the notecard.
Example response
Example response
result=OK
data=Welcome to MoonBots!
Code
moonbotsAPI("notecard_read", [
    "item", "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
]);

These use the helper script from Getting Started.

texture_upload Upload a picture to the bot's inventory
The usual Second Life upload fee is taken from the bot's L$ balance.
Parameters
data The picture as base64 text. JPG, PNG, BMP and J2C work. Required, or use the other name or uuid field
url A web link to the picture, like "https://example.com/image.png". Use this instead of data. Optional
name The name it gets in inventory, like "My Texture". Default: Uploaded Texture. Optional
permissions The next owner permissions in Corrade format. Default: copy, modify and transfer. Optional

Plus action, apikey and botname, like every call.

What comes back
item_uuidThe new texture's inventory UUID.
asset_uuidThe texture's asset UUID.
Example response
Example response
result=OK
item_uuid=b572d860-1c2e-4f0a-9d3b-5e8a7c61f204
asset_uuid=1f0a6c3e-77d2-4b19-a0c4-3e2d9b8f5a17
Code
moonbotsAPI("texture_upload", [
    "data", "BASE64_DATA_HERE"
]);

These use the helper script from Getting Started.

Movement 8 commands
teleport Teleport the bot to a place
If you leave out the position the bot lands at 128, 128, 20.
Parameters
location Where to go as Region/x/y/z, like "MoonBots/128/128/20". Required

Plus action, apikey and botname, like every call.

Example response
Example response
result=OK
Code
moonbotsAPI("teleport", [
    "location", "MoonBots/128/128/20"
]);

These use the helper script from Getting Started.

offer_teleport Send an avatar an offer to teleport to the bot
Parameters
slname The avatar's name, like "Yaueger Resident". Required, or use the other name or uuid field
uuid The avatar's UUID. Use this instead of slname if you have it. Optional
message The message sent with the offer, like "Join me!". This is also the default. Optional

Plus action, apikey and botname, like every call.

Example response
Example response
result=OK
Code
moonbotsAPI("offer_teleport", [
    "slname", "Yaueger Resident"
]);

These use the helper script from Getting Started.

sit Sit the bot on an object
The object must be close enough for the bot to see it.
Parameters
uuid The UUID of the object to sit on. Required

Plus action, apikey and botname, like every call.

Example response
Example response
result=OK
Code
moonbotsAPI("sit", [
    "uuid", "9fa3334a-bc0d-4c3d-829f-c72ed3b24843"
]);

These use the helper script from Getting Started.

stand Stand the bot up
Parameters

Nothing extra. Just send action, apikey and botname.

Example response
Example response
result=OK
Code
moonbotsAPI("stand", []);

These use the helper script from Getting Started.

fly Start or stop flying
Each call switches flying on or off.
Parameters

Nothing extra. Just send action, apikey and botname.

Example response
Example response
result=OK
Code
moonbotsAPI("fly", []);

These use the helper script from Getting Started.

move Walk forward or back for a short time
Parameters
direction "forward" or "backward". Required
duration How long to walk in milliseconds, like "1500". Default: 800. Optional

Plus action, apikey and botname, like every call.

Example response
Example response
result=OK
Code
moonbotsAPI("move", [
    "direction", "forward"
]);

These use the helper script from Getting Started.

walkto Walk to an object nearby
The bot stands up first if it is sitting.
Parameters
uuid The UUID of the object to walk to. Required

Plus action, apikey and botname, like every call.

Example response
Example response
result=OK
Code
moonbotsAPI("walkto", [
    "uuid", "9fa3334a-bc0d-4c3d-829f-c72ed3b24843"
]);

These use the helper script from Getting Started.

tp_home Teleport the bot to its home
Parameters

Nothing extra. Just send action, apikey and botname.

Example response
Example response
result=OK
Code
moonbotsAPI("tp_home", []);

These use the helper script from Getting Started.

Group Control 9 commands
group_invite Invite an avatar to a group
The bot must be able to invite people to the group. They are invited to the Everyone role. Counts toward your daily Second Life message limit.
Parameters
slname The avatar's name, like "Yaueger Resident". Required, or use the other name or uuid field
uuid The avatar's UUID. Use this instead of slname if you have it. Optional
group_uuid The group's UUID, like "2666017d-7a44-78eb-fbe9-4b46df67296a". Required

Plus action, apikey and botname, like every call.

Example response
Example response
result=OK
Code
moonbotsAPI("group_invite", [
    "slname",     "Yaueger Resident",
    "group_uuid", "2666017d-7a44-78eb-fbe9-4b46df67296a"
]);

These use the helper script from Getting Started.

group_eject Remove an avatar from a group
The bot must be allowed to eject members from the group.
Parameters
slname The avatar's name, like "Yaueger Resident". Required, or use the other name or uuid field
uuid The avatar's UUID. Use this instead of slname if you have it. Optional
group_uuid The group's UUID, like "2666017d-7a44-78eb-fbe9-4b46df67296a". Required

Plus action, apikey and botname, like every call.

Example response
Example response
result=OK
Code
moonbotsAPI("group_eject", [
    "slname",     "Yaueger Resident",
    "group_uuid", "2666017d-7a44-78eb-fbe9-4b46df67296a"
]);

These use the helper script from Getting Started.

send_notice Send a group notice
Premium bots only. The bot must be allowed to send notices in the group. Attached items need copy and transfer permissions. Counts toward your daily Second Life message limit once for each group member.
Parameters
group_uuid The group's UUID, like "2666017d-7a44-78eb-fbe9-4b46df67296a". Required
subject The notice title, like "Notice Subject". Required
message The notice text. Optional
item The inventory UUID of an item to attach. Optional

Plus action, apikey and botname, like every call.

Example response
Example response
result=OK
Code
moonbotsAPI("send_notice", [
    "group_uuid", "2666017d-7a44-78eb-fbe9-4b46df67296a",
    "subject",    "Notice Subject"
]);

These use the helper script from Getting Started.

group_activate Change which group tag the bot shows
The bot must be in the group.
Parameters
group_uuid The group's UUID. Use "00000000-0000-0000-0000-000000000000" to show no tag. Required

Plus action, apikey and botname, like every call.

Example response
Example response
result=OK
Code
moonbotsAPI("group_activate", [
    "group_uuid", "00000000-0000-0000-0000-000000000000"
]);

These use the helper script from Getting Started.

group_join Join a group
Does not work if the group is closed, has a fee the bot cannot pay, or the bot is already in it.
Parameters
group_uuid The group's UUID, like "2666017d-7a44-78eb-fbe9-4b46df67296a". Required

Plus action, apikey and botname, like every call.

Example response
Example response
result=OK
Code
moonbotsAPI("group_join", [
    "group_uuid", "2666017d-7a44-78eb-fbe9-4b46df67296a"
]);

These use the helper script from Getting Started.

group_leave Leave a group
The bot cannot leave a group it started.
Parameters
group_uuid The group's UUID, like "2666017d-7a44-78eb-fbe9-4b46df67296a". Required

Plus action, apikey and botname, like every call.

Example response
Example response
result=OK
Code
moonbotsAPI("group_leave", [
    "group_uuid", "2666017d-7a44-78eb-fbe9-4b46df67296a"
]);

These use the helper script from Getting Started.

group_list_roles List the roles in a group
With dataType=json each role also has its title, description, powers and members.
Parameters
group_uuid The group's UUID, like "2666017d-7a44-78eb-fbe9-4b46df67296a". Required

Plus action, apikey and botname, like every call.

What comes back
rolesOne role per line as role UUID;role name.
Example response
Example response
result=OK
roles=b572d860-1c2e-4f0a-9d3b-5e8a7c61f204;Owners
1f0a6c3e-77d2-4b19-a0c4-3e2d9b8f5a17;Everyone
Code
moonbotsAPI("group_list_roles", [
    "group_uuid", "2666017d-7a44-78eb-fbe9-4b46df67296a"
]);

These use the helper script from Getting Started.

group_info Get details about a group
Parameters
group_uuid The group's UUID, like "2666017d-7a44-78eb-fbe9-4b46df67296a". Required

Plus action, apikey and botname, like every call.

What comes back
uuidThe group's UUID.
nameThe group's name.
charterThe group's charter text.
insigniaThe UUID of the group picture.
feeWhat it costs to join, in L$.
founderThe UUID of who started the group.
founder_nameThe name of who started the group.
mature1 if the group is mature.
membersHow many members it has.
open1 if anyone can join.
show_in_list1 if the group shows up in search.
bot_is_member1 if the bot is in the group.
Example response
Example response
result=OK
uuid=2666017d-7a44-78eb-fbe9-4b46df67296a
name=MoonBots Fans
fee=0
members=1234
open=1
bot_is_member=1
Code
moonbotsAPI("group_info", [
    "group_uuid", "2666017d-7a44-78eb-fbe9-4b46df67296a"
]);

These use the helper script from Getting Started.

group_visibility Show or hide a group on the bot's profile
The bot must be in the group.
Parameters
group_uuid The group's UUID, like "2666017d-7a44-78eb-fbe9-4b46df67296a". Required
profile 1 to show the group on the bot's profile, 0 to hide it. Required
notices "accept" to get the group's notices, "reject" to stop them. Optional

Plus action, apikey and botname, like every call.

Example response
Example response
result=OK
Code
moonbotsAPI("group_visibility", [
    "group_uuid", "2666017d-7a44-78eb-fbe9-4b46df67296a",
    "profile",    "YOUR_VALUE"
]);

These use the helper script from Getting Started.

Money 3 commands
get_balance Check how many L$ the bot has
Parameters

Nothing extra. Just send action, apikey and botname.

What comes back
balanceThe bot's L$ balance.
Example response
Example response
result=OK
balance=2500
Code
moonbotsAPI("get_balance", []);

These use the helper script from Getting Started.

give_money Pay L$ to an avatar
The bot needs enough L$ to cover it.
Parameters
slname The person's name, like "Yaueger Resident". Required, or use the other name or uuid field
uuid The person's UUID. Use this instead of slname if you have it. Optional
amount How many L$ to send, like "100". Required

Plus action, apikey and botname, like every call.

Example response
Example response
result=OK
Code
moonbotsAPI("give_money", [
    "slname", "Yaueger Resident",
    "amount", "100"
]);

These use the helper script from Getting Started.

give_money_object Pay L$ to an object
The object must be in the same region and close enough for the bot to see. The bot needs enough L$ to cover it.
Parameters
object_uuid The UUID of the object to pay, like a vendor or tip jar. Required
amount How many L$ to pay, like "100". Required

Plus action, apikey and botname, like every call.

Example response
Example response
result=OK
Code
moonbotsAPI("give_money_object", [
    "object_uuid", "abcdef12-3456-7890-abcd-ef1234567890",
    "amount",      "100"
]);

These use the helper script from Getting Started.

Avatar Info 7 commands
name2key Look up an avatar's UUID from their name
Works when the bot is offline.
Parameters
slname The avatar's name, like "Yaueger Resident". Required

Plus action, apikey and botname, like every call.

What comes back
uuidThe avatar's UUID.
Example response
Example response
result=OK
uuid=7d32f86c-4b44-494a-b90b-fc0d4e3f71bf
Code
moonbotsAPI("name2key", [
    "slname", "Yaueger Resident"
]);

These use the helper script from Getting Started.

key2name Look up an avatar's name from their UUID
Works when the bot is offline.
Parameters
uuid The avatar's UUID, like "7d32f86c-4b44-494a-b90b-fc0d4e3f71bf". Required

Plus action, apikey and botname, like every call.

What comes back
nameThe avatar's Second Life name.
Example response
Example response
result=OK
name=Yaueger Resident
Code
moonbotsAPI("key2name", [
    "uuid", "7d32f86c-4b44-494a-b90b-fc0d4e3f71bf"
]);

These use the helper script from Getting Started.

avatar_info Get an avatar's display name
Parameters
slname The avatar's name, like "Yaueger Resident". Required, or use the other name or uuid field
uuid The avatar's UUID. Use this instead of slname if you have it. Optional

Plus action, apikey and botname, like every call.

What comes back
display_nameThe avatar's display name.
Example response
Example response
result=OK
display_name=Yaueger
Code
moonbotsAPI("avatar_info", [
    "slname", "Yaueger Resident"
]);

These use the helper script from Getting Started.

bot_location Find out where the bot is
Works when the bot is offline and shows where it was last seen.
Parameters

Nothing extra. Just send action, apikey and botname.

What comes back
locationThe region and position the bot is at.
slurlA map link to where the bot is.
Example response
Example response
result=OK
location=MoonBots/128/128/25
slurl=https://maps.secondlife.com/secondlife/MoonBots/128/128/25
Code
moonbotsAPI("bot_location", []);

These use the helper script from Getting Started.

nearbyavatars_scan List the avatars in the bot's region
Includes everyone in the region, not just those close to the bot.
Parameters

Nothing extra. Just send action, apikey and botname.

What comes back
dataFor each avatar: their name in quotes, their UUID and their position, all separated by commas.
Example response
Example response
result=OK
data="Yaueger Resident",9fa3334a-bc0d-4c3d-829f-c72ed3b24843,"<128, 130, 25>"
Code
moonbotsAPI("nearbyavatars_scan", []);

These use the helper script from Getting Started.

avatar_groups List the groups the bot is in
With dataType=json you also get each group's picture, member counts and what the bot is allowed to do there.
Parameters

Nothing extra. Just send action, apikey and botname.

What comes back
countHow many groups were found.
dataEach group as name,UUID with | between groups.
Example response
Example response
result=OK
count=2
data=MoonBots Fans,2666017d-7a44-78eb-fbe9-4b46df67296a|Cloudlings,b572d860-1c2e-4f0a-9d3b-5e8a7c61f204
Code
moonbotsAPI("avatar_groups", []);

These use the helper script from Getting Started.

avatar_picks List an avatar's profile picks
Parameters
avatar The avatar's UUID or name, like "Yaueger Resident". Required
skipnames Leave out picks whose name contains this text. Optional
matchnames Only show picks whose name contains this text. Optional
matchuuid Only show the pick with this UUID. Optional

Plus action, apikey and botname, like every call.

What comes back
totalHow many picks the avatar has in total.
picksOne pick per line as pick UUID then the pick name.
Example response
Example response
result=OK
total=2
picks=b572d860-1c2e-4f0a-9d3b-5e8a7c61f204 My Store
1f0a6c3e-77d2-4b19-a0c4-3e2d9b8f5a17 Favourite Beach
Code
moonbotsAPI("avatar_picks", [
    "avatar", "Yaueger Resident"
]);

These use the helper script from Getting Started.

World Interaction 13 commands
touch_prim Touch an object
The object must be close enough for the bot to see it.
Parameters
uuid The UUID of the object to touch. Required

Plus action, apikey and botname, like every call.

Example response
Example response
result=OK
Code
moonbotsAPI("touch_prim", [
    "uuid", "9fa3334a-bc0d-4c3d-829f-c72ed3b24843"
]);

These use the helper script from Getting Started.

find_objects List the objects near the bot
Right after login the list can say "Still Loading Objects..." for a moment.
Parameters

Nothing extra. Just send action, apikey and botname.

What comes back
dataEach object as name,UUID, all separated by commas, closest first.
Example response
Example response
result=OK
data=Tip Jar,b572d860-1c2e-4f0a-9d3b-5e8a7c61f204,Welcome Board,1f0a6c3e-77d2-4b19-a0c4-3e2d9b8f5a17
Code
moonbotsAPI("find_objects", []);

These use the helper script from Getting Started.

sim_access Ban, unban, allow or disallow someone on the estate
The bot must be an Estate Manager. Allow and disallow only matter on regions that are not open to the public.
Parameters
avatar The avatar's UUID or name, like "Yaueger Resident". Required
operation "ban", "unban", "allow" or "disallow". Required
all_estates 1 to do it on every estate the bot manages. Optional

Plus action, apikey and botname, like every call.

Example response
Example response
result=OK
Code
moonbotsAPI("sim_access", [
    "avatar",    "Yaueger Resident",
    "operation", "ban"
]);

These use the helper script from Getting Started.

sim_kick Kick an avatar out of the region
The bot must be an Estate Manager of the region it is in.
Parameters
avatar The avatar's UUID or name, like "Yaueger Resident". Required

Plus action, apikey and botname, like every call.

Example response
Example response
result=OK
Code
moonbotsAPI("sim_kick", [
    "avatar", "Yaueger Resident"
]);

These use the helper script from Getting Started.

sim_restart Start or cancel a region restart
The bot must be an Estate Manager of the region it is in.
Parameters
state "begin" to start the countdown, "cancel" to stop it. Required
delay Seconds before the restart, from 30 to 240, like "120". Default: 120. Optional

Plus action, apikey and botname, like every call.

What comes back
statebegin or cancel.
delayThe countdown in seconds that was used.
Example response
Example response
result=OK
state=begin
delay=120
Code
moonbotsAPI("sim_restart", [
    "state", "begin"
]);

These use the helper script from Getting Started.

sim_send_message Send a message to everyone in the region
Shows as a blue estate message. The bot must be an Estate Manager.
Parameters
message What to say, like "The region restarts in 5 minutes". Required
all_estates 1 to send it to every estate the bot manages. Optional

Plus action, apikey and botname, like every call.

Example response
Example response
result=OK
Code
moonbotsAPI("sim_send_message", [
    "message", "The region restarts in 5 minutes"
]);

These use the helper script from Getting Started.

region_info Get details about a region
Parameters
name The region's name, like "MoonBots". Default: the region the bot is in. Optional

Plus action, apikey and botname, like every call.

What comes back
region_nameThe region's name.
region_handleThe region's handle number.
region_xIts X spot on the world map.
region_yIts Y spot on the world map.
region_water_heightThe water height.
region_imageThe UUID of the map picture.
region_accessPG, Mature or Adult.
region_flagsThe region's settings.
region_agentsHow many avatars are there.
region_idThe region's UUID. Only for the region the bot is in.
region_ownerThe estate owner's UUID. Only for the region the bot is in.
region_productThe region type, like Estate / Full Region. Only for the region the bot is in.
region_sizeThe size, like 256x256. Only for the region the bot is in.
is_estate_manager1 if the bot is an Estate Manager. Only for the region the bot is in.
Example response
Example response
result=OK
region_name=MoonBots
region_x=1005
region_y=1010
region_water_height=20
region_access=Mature
region_agents=4
Code
moonbotsAPI("region_info", []);

These use the helper script from Getting Started.

parcel_info Get details about a parcel
You also get a few more values such as the claim date, auto return time, snapshot and other prim counts.
Parameters
x The X position of a spot in the parcel, like "128". Default: where the bot is. Optional
y The Y position of a spot in the parcel, like "128". Default: where the bot is. Optional
getvalue Only return this one value, like "parcel_owner". Optional

Plus action, apikey and botname, like every call.

What comes back
parcel_nameThe parcel's name.
parcel_descriptionThe parcel's description, URL escaped unless you use JSON.
parcel_areaThe size in square metres.
parcel_ownerThe owner's UUID.
parcel_groupThe group's UUID.
parcel_groupowned1 if a group owns it.
parcel_maxprimsHow many prims it can hold.
parcel_totalprimsHow many prims are on it now.
parcel_musicurlThe music stream link.
parcel_forsale1 if it is for sale.
parcel_salepriceThe sale price in L$.
parcel_landingpointThe landing point as .
parcel_flagsThe parcel's settings, separated by commas.
Example response
Example response
result=OK
parcel_name=My Land
parcel_owner=7d32f86c-4b44-494a-b90b-fc0d4e3f71bf
parcel_area=4096
parcel_forsale=0
parcel_flags=AllowFly,AllowLandmark
Code
moonbotsAPI("parcel_info", []);

These use the helper script from Getting Started.

parcel_eject Eject an avatar from the parcel the bot is on
The bot must own the parcel, be in the group that owns it, or be an Estate Manager.
Parameters
slname The avatar's name, like "Yaueger Resident". Required, or use the other name or uuid field
uuid The avatar's UUID. Use this instead of slname if you have it. Optional
ban 1 to ban them from the parcel too. Optional

Plus action, apikey and botname, like every call.

Example response
Example response
result=OK
Code
moonbotsAPI("parcel_eject", [
    "slname", "Yaueger Resident"
]);

These use the helper script from Getting Started.

set_parcel_infoNEW! Change a parcel's name, description, music or sale setting
The bot must own the parcel, be in the group that owns it, or be an Estate Manager.
Parameters
entry What to change: "name", "description", "music_url" or "for_sale". Required
value The new value. For for_sale use "on 500" with your price, or "off". Required
x The X position of a spot in the parcel, like "128". Default: where the bot is. Optional
y The Y position of a spot in the parcel, like "128". Default: where the bot is. Optional

Plus action, apikey and botname, like every call.

Example response
Example response
result=OK
Code
moonbotsAPI("set_parcel_info", [
    "entry", "name",
    "value", "on 500"
]);

These use the helper script from Getting Started.

parcel_accessNEW! Control who can visit a parcel
Use public to let anyone in, group to only let in the parcel's group and the allowed list, or closed to only let in the allowed list. Each list holds up to 300 people. The bot must own the parcel, be in the group that owns it, or be an Estate Manager.
Parameters
operation "public", "group", "closed", "allow", "disallow", "ban", "unban" or "list". Required
slname The avatar's name, like "Yaueger Resident". Needed for allow, disallow, ban and unban. Optional
uuid The avatar's UUID. Use this instead of slname if you have it. Optional
hours How many hours a ban lasts, like "24". Leave it out for a ban that never ends. Optional
age_verified With public, group or closed: 1 to only let in age verified avatars, 0 to turn it off. Optional
payment_info With public, group or closed: 1 to only let in avatars with payment info, 0 to turn it off. Optional
x The X position of a spot in the parcel, like "128". Default: where the bot is. Optional
y The Y position of a spot in the parcel, like "128". Default: where the bot is. Optional

Plus action, apikey and botname, like every call.

What comes back
accessAfter public, group or closed: the new setting.
avatarAfter a list change: the avatar's UUID.
countAfter a list change: how many people are on that list now.
allowedWith list: one person per line as UUID;name.
bannedWith list: one person per line as UUID;name;when the ban ends.
Example response
Example response
result=OK
access=group
Code
moonbotsAPI("parcel_access", [
    "operation", "public"
]);

These use the helper script from Getting Started.

parcel_listNEW! List all the parcels in the bot's region
With dataType=json each parcel also has its group, sale details and prim counts.
Parameters

Nothing extra. Just send action, apikey and botname.

What comes back
region_nameThe region's name.
countHow many parcels there are.
parcelsOne parcel per line as id;name;owner UUID;area.
Example response
Example response
result=OK
region_name=MoonBots
count=2
parcels=1;Main Store;7d32f86c-4b44-494a-b90b-fc0d4e3f71bf;16384
2;Beach;7d32f86c-4b44-494a-b90b-fc0d4e3f71bf;4096
Code
moonbotsAPI("parcel_list", []);

These use the helper script from Getting Started.

parcel_info_updateNEW! Change a parcel's name, description, music or sale setting
This is another name for set_parcel_info and works the same way.
Parameters
entry What to change: "name", "description", "music_url" or "for_sale". Required
value The new value. For for_sale use "on 500" with your price, or "off". Required
x The X position of a spot in the parcel, like "128". Default: where the bot is. Optional
y The Y position of a spot in the parcel, like "128". Default: where the bot is. Optional

Plus action, apikey and botname, like every call.

Example response
Example response
result=OK
Code
moonbotsAPI("parcel_info_update", [
    "entry", "name",
    "value", "on 500"
]);

These use the helper script from Getting Started.

Need help with the API?

Join our Discord for API help, feature requests and updates.

Join MoonBots Discord
We use cookies
Your browser sent a Global Privacy Control signal and we have honoured it. Analytics and advertising are switched off, and we are not selling or sharing your information.

A few cookies keep you logged in and block bots, so those always run. Everything else stays off until you allow it: loading PayPal checkout, and any analytics we might add later. See our Cookie Policy.