MoonBots By [Starries]
BETA TESTING API v0.1

MoonBots HTTP API

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

GET POST https://moonbots.co/api/bot.php
Authentication (Required on every call)
action
The command to execute (e.g. "im", "teleport", "status")
apikey
Your API key. Generate one from your dashboard. One key can control multiple bots.
botname
Target bot's SL name: "Firstname Lastname", the bot must be assigned to your API key
Rate Limits & Credits: Each API key has a credit limit. Every API call uses 1 credit. Maintain ~3 second delay between calls. Messaging commands are throttled by Second Life at this rate.
Permissions: Each API key has its own permission set. Commands will return an error if the key lacks the required permission category. You can grant Full Access or pick from: Status, Messaging, Friendship, Inventory, Movement, Groups, Money, Avatar Info, and World.
UUID / Username: Any command that accepts a uuid parameter also accepts slname (avatar name or username). The API will automatically resolve names to UUIDs. Example: slname=Yaueger Resident or uuid=7d32f86c-4b44-...
Status
status Returns the online status, location, UUID, and SL name of the bot Live
Input Parameters
ParameterDescription
action= statusRequired
apikeyYour API keyRequired
botnameBot SL name "Firstname Lastname"Required
secretBot access codeRequired
dataTypeSet to "json" for JSON reply instead of URL-encodedOptional
customCustom string passed back in responseOptional
Output Variables
VariableDescription
resultOK or FAIL
resulttextDetailed failure reason (on FAIL)
customEchoed back from input
statusCurrent status: ONLINE, PRE-CONNECTING, CONNECTING, LOGGED_OUT, OFFLINE
online"1" if online, "0" otherwise
slnameFull SL name of the bot
uuidBot avatar UUID
locationCurrent region and coordinates (Region/X/Y/Z)
Possible status values: ONLINE — bot is online and operational. PRE-CONNECTING — bot is about to log in. CONNECTING — login server is processing. LOGGED_OUT — gracefully logged out by owner. OFFLINE — bot cannot be contacted (server restart or error).
Example Response
result=OK online=1 status=ONLINE slname=Upsies Resident uuid=7d32f86c-4b44-494a-b90b-fc0d4e3f71bf location=Starries/227/201/23
LSL
PHP
Python
JavaScript
moonbotsAPI("status", [
    "secret", "YOUR_VALUE"
]);
moonbots_api('status', [
    'secret' => 'YOUR_VALUE',
]);
moonbots_api("status", secret="YOUR_VALUE")
await moonbotsAPI("status", { secret: "YOUR_VALUE" });
login Initiates the bot login sequence Live
Example Response
result=OK
LSL
PHP
Python
JavaScript
moonbotsAPI("login", []);
moonbots_api('login');
moonbots_api("login")
await moonbotsAPI("login");
logout Logs the bot out of Second Life Live
Example Response
result=OK
LSL
PHP
Python
JavaScript
moonbotsAPI("logout", []);
moonbots_api('logout');
moonbots_api("logout")
await moonbotsAPI("logout");
set_http_callback Set a callback URL to receive bot events (IMs, invitations, etc) Coming Soon
Messaging
im Send an instant message to an avatar Live
Input Parameters
ParameterDescription
slnameAvatar name OR username (e.g. "Yaueger Resident")Required*
uuidAvatar UUID — alternative to slnameOptional
messageMessage textRequired
Example Response
result=OK
LSL
PHP
Python
JavaScript
moonbotsAPI("im", [
    "slname",  "Yaueger Resident",
    "message", "Hello from my bot!"
]);
moonbots_api('im', [
    'slname'  => 'Yaueger Resident',
    'message' => 'Hello from my bot!',
]);
moonbots_api("im", slname="Yaueger Resident", message="Hello from my bot!")
await moonbotsAPI("im", {
    slname:  "Yaueger Resident",
    message: "Hello from my bot!",
});
say_chat_channel Say a message in local chat Live
Input Parameters
ParameterDescription
messageMessage textRequired
chat_typeNormal / Whisper / ShoutOptional (Normal)
Example Response
result=OK
LSL
PHP
Python
JavaScript
moonbotsAPI("say_chat_channel", [
    "message", "Hello from my bot!"
]);
moonbots_api('say_chat_channel', [
    'message' => 'Hello from my bot!',
]);
moonbots_api("say_chat_channel", message="Hello from my bot!")
await moonbotsAPI("say_chat_channel", { message: "Hello from my bot!" });
send_group_im Send a message to a group chat Live
Input Parameters
ParameterDescription
group_uuidTarget group UUIDRequired
messageMessage textRequired
Example Response
result=OK
LSL
PHP
Python
JavaScript
moonbotsAPI("send_group_im", [
    "group_uuid", "2666017d-7a44-78eb-fbe9-4b46df67296a",
    "message",    "Hello from my bot!"
]);
moonbots_api('send_group_im', [
    'group_uuid' => '2666017d-7a44-78eb-fbe9-4b46df67296a',
    'message'    => 'Hello from my bot!',
]);
moonbots_api(
    "send_group_im",
    group_uuid="2666017d-7a44-78eb-fbe9-4b46df67296a",
    message="Hello from my bot!",
)
await moonbotsAPI("send_group_im", {
    group_uuid: "2666017d-7a44-78eb-fbe9-4b46df67296a",
    message:    "Hello from my bot!",
});
reply_dialog Press a button on a script dialog popup Live
Input Parameters
ParameterDescription
channelDialog channel numberRequired
buttonButton label to pressRequired
object_uuidUUID of dialog source objectRequired
Example Response
result=OK
LSL
PHP
Python
JavaScript
moonbotsAPI("reply_dialog", [
    "channel",     "12345",
    "button",      "Accept",
    "object_uuid", "abcdef12-3456-7890-abcd-ef1234567890"
]);
moonbots_api('reply_dialog', [
    'channel'     => '12345',
    'button'      => 'Accept',
    'object_uuid' => 'abcdef12-3456-7890-abcd-ef1234567890',
]);
moonbots_api(
    "reply_dialog",
    channel="12345",
    button="Accept",
    object_uuid="abcdef12-3456-7890-abcd-ef1234567890",
)
await moonbotsAPI("reply_dialog", {
    channel:     "12345",
    button:      "Accept",
    object_uuid: "abcdef12-3456-7890-abcd-ef1234567890",
});
typing_start Show typing indicator to a user Coming Soon
typing_stop Stop typing indicator Coming Soon
Friendship
offer_friendship Send a friendship offer to an avatar Live
Input Parameters
ParameterDescription
slnameAvatar name or usernameRequired*
uuidAvatar UUID — alternativeOptional
messageDefault - Would you like to be my friend?Optional
Example Response
result=OK
LSL
PHP
Python
JavaScript
moonbotsAPI("offer_friendship", [
    "slname", "Yaueger Resident"
]);
moonbots_api('offer_friendship', [
    'slname' => 'Yaueger Resident',
]);
moonbots_api("offer_friendship", slname="Yaueger Resident")
await moonbotsAPI("offer_friendship", { slname: "Yaueger Resident" });
cancel_friendship Remove an avatar from the bot's friend list Live
Input Parameters
ParameterDescription
uuidAvatar UUIDRequired
Example Response
result=OK
LSL
PHP
Python
JavaScript
moonbotsAPI("cancel_friendship", [
    "uuid", "9fa3334a-bc0d-4c3d-829f-c72ed3b24843"
]);
moonbots_api('cancel_friendship', [
    'uuid' => '9fa3334a-bc0d-4c3d-829f-c72ed3b24843',
]);
moonbots_api("cancel_friendship", uuid="9fa3334a-bc0d-4c3d-829f-c72ed3b24843")
await moonbotsAPI("cancel_friendship", { uuid: "9fa3334a-bc0d-4c3d-829f-c72ed3b24843" });
edit_friendship Change friend permission flags (online status, map, edit rights) Coming Soon
Inventory
inventory_give Send an inventory item or folder to an avatar Live
Input Parameters
ParameterDescription
slnameRecipient name or usernameRequired*
uuidRecipient UUID — alternativeOptional
itemInventory item UUID to giveRequired
Example Response
result=OK
LSL
PHP
Python
JavaScript
moonbotsAPI("inventory_give", [
    "slname", "Yaueger Resident",
    "item",   "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
]);
moonbots_api('inventory_give', [
    'slname' => 'Yaueger Resident',
    'item'   => 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
]);
moonbots_api(
    "inventory_give",
    slname="Yaueger Resident",
    item="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
)
await moonbotsAPI("inventory_give", {
    slname: "Yaueger Resident",
    item:   "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
});
wear Wear a clothing item, body part, or attachment Live
Input Parameters
ParameterDescription
itemInventory item UUIDRequired
replacetrue/false — replace existing of same typeOptional (false)
Example Response
result=OK
LSL
PHP
Python
JavaScript
moonbotsAPI("wear", [
    "item", "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
]);
moonbots_api('wear', [
    'item' => 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
]);
moonbots_api("wear", item="a1b2c3d4-e5f6-7890-abcd-ef1234567890")
await moonbotsAPI("wear", { item: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" });
takeoff Remove a worn item (detach or unwear) Live
Input Parameters
ParameterDescription
itemInventory item UUIDRequired
Example Response
result=OK
LSL
PHP
Python
JavaScript
moonbotsAPI("takeoff", [
    "item", "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
]);
moonbots_api('takeoff', [
    'item' => 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
]);
moonbots_api("takeoff", item="a1b2c3d4-e5f6-7890-abcd-ef1234567890")
await moonbotsAPI("takeoff", { item: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" });
rebake Rebake appearance (reload clothing and skin textures) Live
Example Response
result=OK
LSL
PHP
Python
JavaScript
moonbotsAPI("rebake", []);
moonbots_api('rebake');
moonbots_api("rebake")
await moonbotsAPI("rebake");
inventory_list List contents of an inventory folder Live
Input Parameters
ParameterDescription
pathFolder path to list (e.g. "/Objects" or "/My Inventory/Clothing"). Defaults to root.Optional
Output Variables
VariableDescription
resultOK or FAIL
dataStructured list of item names, UUIDs, and types
Lists the contents of an inventory folder by path. Use forward slashes to navigate subfolders. System folders like Clothing, Objects, and Textures are listed at root level. Omit the path parameter or pass "/" to list the root inventory.
Example Response
result=OK data=Folder1,uuid1,Folder|Item1,uuid2,Notecard|...
LSL
PHP
Python
JavaScript
moonbotsAPI("inventory_list", []);
moonbots_api('inventory_list');
moonbots_api("inventory_list")
await moonbotsAPI("inventory_list");
inventory_delete Move an inventory item to the Trash folder Live
Input Parameters
ParameterDescription
itemInventory item UUID to deleteRequired
Output Variables
VariableDescription
resultOK or FAIL
Moves the item to the bot's Trash folder. The item can still be recovered from Trash until it is purged.
Example Response
result=OK
LSL
PHP
Python
JavaScript
moonbotsAPI("inventory_delete", [
    "item", "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
]);
moonbots_api('inventory_delete', [
    'item' => 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
]);
moonbots_api("inventory_delete", item="a1b2c3d4-e5f6-7890-abcd-ef1234567890")
await moonbotsAPI("inventory_delete", { item: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" });
notecard_create Create a notecard in inventory Coming Soon
notecard_read Read the contents of a notecard from inventory Live
Input Parameters
ParameterDescription
itemNotecard inventory UUIDRequired
Output Variables
VariableDescription
resultOK or FAIL
dataFull text contents of the notecard
Downloads and returns the full text contents of a notecard in the bot's inventory. The notecard must be owned by the bot.
Example Response
result=OK data=Line 1 of notecard text\nLine 2...
LSL
PHP
Python
JavaScript
moonbotsAPI("notecard_read", [
    "item", "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
]);
moonbots_api('notecard_read', [
    'item' => 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
]);
moonbots_api("notecard_read", item="a1b2c3d4-e5f6-7890-abcd-ef1234567890")
await moonbotsAPI("notecard_read", { item: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" });
texture_upload Upload a texture (image) to the bot's inventory Live
Input Parameters
ParameterDescription
dataBase64-encoded image data (JPEG, PNG, BMP, GIF, WEBP, J2C)Required*
urlURL to an image file — alternative to data (server will fetch and encode it)Optional
nameInventory name for the textureOptional (Uploaded Texture)
permissionsPermission string (Corrade format)Optional
Output Variables
VariableDescription
resultOK or FAIL
item_uuidInventory UUID of the new texture item
asset_uuidAsset UUID of the uploaded texture
Uploads an image to the bot's inventory as a texture. Provide either base64-encoded image data via data, or a publicly accessible URL via url (the server will fetch and encode it). The image is automatically converted to JPEG2000 and resized to power-of-two dimensions. Standard L$ upload fee applies.
Example Response
result=OK item_uuid=a1b2c3d4-... asset_uuid=e5f6a7b8-...
LSL
PHP
Python
JavaScript
moonbotsAPI("texture_upload", [
    "data", "JPEG, PNG, BMP, GIF, WEBP, J2C"
]);
moonbots_api('texture_upload', [
    'data' => 'JPEG, PNG, BMP, GIF, WEBP, J2C',
]);
moonbots_api("texture_upload", data="JPEG, PNG, BMP, GIF, WEBP, J2C")
await moonbotsAPI("texture_upload", { data: "JPEG, PNG, BMP, GIF, WEBP, J2C" });
Movement
teleport Teleport bot to a specific region and position Live
Input Parameters
ParameterDescription
locationRegion/x/y/z (e.g. "MoonBots/128/128/20")Required
Example Response
result=OK
LSL
PHP
Python
JavaScript
moonbotsAPI("teleport", [
    "location", "MoonBots/128/128/20"
]);
moonbots_api('teleport', [
    'location' => 'MoonBots/128/128/20',
]);
moonbots_api("teleport", location="MoonBots/128/128/20")
await moonbotsAPI("teleport", { location: "MoonBots/128/128/20" });
offer_teleport Send a teleport lure to an avatar Live
Input Parameters
ParameterDescription
slnameAvatar name or usernameRequired*
uuidAvatar UUID — alternativeOptional
messageLure messageOptional
Example Response
result=OK
LSL
PHP
Python
JavaScript
moonbotsAPI("offer_teleport", [
    "slname", "Yaueger Resident"
]);
moonbots_api('offer_teleport', [
    'slname' => 'Yaueger Resident',
]);
moonbots_api("offer_teleport", slname="Yaueger Resident")
await moonbotsAPI("offer_teleport", { slname: "Yaueger Resident" });
sit Sit on a specific prim Live
Input Parameters
ParameterDescription
uuidPrim UUID to sit onRequired
Example Response
result=OK
LSL
PHP
Python
JavaScript
moonbotsAPI("sit", [
    "uuid", "9fa3334a-bc0d-4c3d-829f-c72ed3b24843"
]);
moonbots_api('sit', [
    'uuid' => '9fa3334a-bc0d-4c3d-829f-c72ed3b24843',
]);
moonbots_api("sit", uuid="9fa3334a-bc0d-4c3d-829f-c72ed3b24843")
await moonbotsAPI("sit", { uuid: "9fa3334a-bc0d-4c3d-829f-c72ed3b24843" });
stand Stand up from current seat Live
Example Response
result=OK
LSL
PHP
Python
JavaScript
moonbotsAPI("stand", []);
moonbots_api('stand');
moonbots_api("stand")
await moonbotsAPI("stand");
fly Toggle flight mode on/off Live
Example Response
result=OK
LSL
PHP
Python
JavaScript
moonbotsAPI("fly", []);
moonbots_api('fly');
moonbots_api("fly")
await moonbotsAPI("fly");
move Walk forward or backward for a duration Live
Input Parameters
ParameterDescription
directionforward / backwardRequired
durationMilliseconds to walkOptional (800)
Example Response
result=OK
LSL
PHP
Python
JavaScript
moonbotsAPI("move", [
    "direction", "forward"
]);
moonbots_api('move', [
    'direction' => 'forward',
]);
moonbots_api("move", direction="forward")
await moonbotsAPI("move", { direction: "forward" });
walkto Walk to a nearby object Live
Input Parameters
ParameterDescription
uuidObject prim UUIDRequired
Example Response
result=OK
LSL
PHP
Python
JavaScript
moonbotsAPI("walkto", [
    "uuid", "9fa3334a-bc0d-4c3d-829f-c72ed3b24843"
]);
moonbots_api('walkto', [
    'uuid' => '9fa3334a-bc0d-4c3d-829f-c72ed3b24843',
]);
moonbots_api("walkto", uuid="9fa3334a-bc0d-4c3d-829f-c72ed3b24843")
await moonbotsAPI("walkto", { uuid: "9fa3334a-bc0d-4c3d-829f-c72ed3b24843" });
tp_home Teleport bot to their home location Live
Example Response
result=OK
LSL
PHP
Python
JavaScript
moonbotsAPI("tp_home", []);
moonbots_api('tp_home');
moonbots_api("tp_home")
await moonbotsAPI("tp_home");
Group Control
group_invite Invite an avatar to a group Live
Input Parameters
ParameterDescription
slnameAvatar name or usernameRequired*
uuidAvatar UUID — alternativeOptional
group_uuidTarget group UUIDRequired
Example Response
result=OK
LSL
PHP
Python
JavaScript
moonbotsAPI("group_invite", [
    "slname",     "Yaueger Resident",
    "group_uuid", "2666017d-7a44-78eb-fbe9-4b46df67296a"
]);
moonbots_api('group_invite', [
    'slname'     => 'Yaueger Resident',
    'group_uuid' => '2666017d-7a44-78eb-fbe9-4b46df67296a',
]);
moonbots_api(
    "group_invite",
    slname="Yaueger Resident",
    group_uuid="2666017d-7a44-78eb-fbe9-4b46df67296a",
)
await moonbotsAPI("group_invite", {
    slname:     "Yaueger Resident",
    group_uuid: "2666017d-7a44-78eb-fbe9-4b46df67296a",
});
group_eject Eject an avatar from a group Live
Input Parameters
ParameterDescription
uuidAvatar UUIDRequired
group_uuidGroup UUIDRequired
Example Response
result=OK
LSL
PHP
Python
JavaScript
moonbotsAPI("group_eject", [
    "uuid",       "9fa3334a-bc0d-4c3d-829f-c72ed3b24843",
    "group_uuid", "2666017d-7a44-78eb-fbe9-4b46df67296a"
]);
moonbots_api('group_eject', [
    'uuid'       => '9fa3334a-bc0d-4c3d-829f-c72ed3b24843',
    'group_uuid' => '2666017d-7a44-78eb-fbe9-4b46df67296a',
]);
moonbots_api(
    "group_eject",
    uuid="9fa3334a-bc0d-4c3d-829f-c72ed3b24843",
    group_uuid="2666017d-7a44-78eb-fbe9-4b46df67296a",
)
await moonbotsAPI("group_eject", {
    uuid:       "9fa3334a-bc0d-4c3d-829f-c72ed3b24843",
    group_uuid: "2666017d-7a44-78eb-fbe9-4b46df67296a",
});
send_notice Send a group notice with optional attachment Live
Input Parameters
ParameterDescription
group_uuidGroup UUIDRequired
subjectNotice subject lineRequired
messageNotice body textOptional
itemAttachment inventory UUIDOptional
Example Response
result=OK
LSL
PHP
Python
JavaScript
moonbotsAPI("send_notice", [
    "group_uuid", "2666017d-7a44-78eb-fbe9-4b46df67296a",
    "subject",    "Notice Subject"
]);
moonbots_api('send_notice', [
    'group_uuid' => '2666017d-7a44-78eb-fbe9-4b46df67296a',
    'subject'    => 'Notice Subject',
]);
moonbots_api(
    "send_notice",
    group_uuid="2666017d-7a44-78eb-fbe9-4b46df67296a",
    subject="Notice Subject",
)
await moonbotsAPI("send_notice", {
    group_uuid: "2666017d-7a44-78eb-fbe9-4b46df67296a",
    subject:    "Notice Subject",
});
send_group_im Send a message to group chat Live
Input Parameters
ParameterDescription
group_uuidGroup UUIDRequired
messageMessage textRequired
Example Response
result=OK
LSL
PHP
Python
JavaScript
moonbotsAPI("send_group_im", [
    "group_uuid", "2666017d-7a44-78eb-fbe9-4b46df67296a",
    "message",    "Hello from my bot!"
]);
moonbots_api('send_group_im', [
    'group_uuid' => '2666017d-7a44-78eb-fbe9-4b46df67296a',
    'message'    => 'Hello from my bot!',
]);
moonbots_api(
    "send_group_im",
    group_uuid="2666017d-7a44-78eb-fbe9-4b46df67296a",
    message="Hello from my bot!",
)
await moonbotsAPI("send_group_im", {
    group_uuid: "2666017d-7a44-78eb-fbe9-4b46df67296a",
    message:    "Hello from my bot!",
});
group_activate Activate a group tag on the bot Live
Input Parameters
ParameterDescription
group_uuidGroup UUID (use zeros for none)Required
Example Response
result=OK
LSL
PHP
Python
JavaScript
moonbotsAPI("group_activate", [
    "group_uuid", "use zeros for none"
]);
moonbots_api('group_activate', [
    'group_uuid' => 'use zeros for none',
]);
moonbots_api("group_activate", group_uuid="use zeros for none")
await moonbotsAPI("group_activate", { group_uuid: "use zeros for none" });
group_join Join a group by UUID Coming Soon
group_leave Leave a group Coming Soon
group_list_roles List roles in a group Coming Soon
group_info Get group info, roles, and titles Coming Soon
group_visibility Control group visibility in profile Coming Soon
Money
get_balance Returns the bot's L$ balance Live
Example Response
result=OK balance=366763
LSL
PHP
Python
JavaScript
moonbotsAPI("get_balance", []);
moonbots_api('get_balance');
moonbots_api("get_balance")
await moonbotsAPI("get_balance");
give_money Send L$ to an avatar Live
Input Parameters
ParameterDescription
slnameRecipient name or usernameRequired*
uuidRecipient UUID — alternativeOptional
amountL$ amount to sendRequired
Example Response
result=OK
LSL
PHP
Python
JavaScript
moonbotsAPI("give_money", [
    "slname", "Yaueger Resident",
    "amount", "100"
]);
moonbots_api('give_money', [
    'slname' => 'Yaueger Resident',
    'amount' => '100',
]);
moonbots_api("give_money", slname="Yaueger Resident", amount="100")
await moonbotsAPI("give_money", {
    slname: "Yaueger Resident",
    amount: "100",
});
give_money_object Pay L$ to an in-world object (vendor, tip jar, etc) Live
Input Parameters
ParameterDescription
object_uuidUUID of the prim/object to payRequired
amountL$ amount to payRequired
Output Variables
VariableDescription
resultOK or FAIL
Sends L$ to a nearby in-world prim/object. The object must be in the same region and visible to the bot. Commonly used to pay vendors, tip jars, rental boxes, or scripted objects that accept payments. Will fail if the bot has insufficient funds.
Example Response
result=OK
LSL
PHP
Python
JavaScript
moonbotsAPI("give_money_object", [
    "object_uuid", "abcdef12-3456-7890-abcd-ef1234567890",
    "amount",      "100"
]);
moonbots_api('give_money_object', [
    'object_uuid' => 'abcdef12-3456-7890-abcd-ef1234567890',
    'amount'      => '100',
]);
moonbots_api(
    "give_money_object",
    object_uuid="abcdef12-3456-7890-abcd-ef1234567890",
    amount="100",
)
await moonbotsAPI("give_money_object", {
    object_uuid: "abcdef12-3456-7890-abcd-ef1234567890",
    amount:      "100",
});
Avatar Info
name2key Get avatar UUID from SL name or username Live
Input Parameters
ParameterDescription
slnameAvatar name (e.g. "Yaueger Resident" or "Upsies Resident")Required
Example Response
result=OK uuid=7d32f86c-4b44-...
LSL
PHP
Python
JavaScript
moonbotsAPI("name2key", [
    "slname", "Yaueger Resident"
]);
moonbots_api('name2key', [
    'slname' => 'Yaueger Resident',
]);
moonbots_api("name2key", slname="Yaueger Resident")
await moonbotsAPI("name2key", { slname: "Yaueger Resident" });
key2name Get SL name from avatar UUID Live
Input Parameters
ParameterDescription
uuidAvatar UUIDRequired
Example Response
result=OK name=Upsies Resident
LSL
PHP
Python
JavaScript
moonbotsAPI("key2name", [
    "uuid", "9fa3334a-bc0d-4c3d-829f-c72ed3b24843"
]);
moonbots_api('key2name', [
    'uuid' => '9fa3334a-bc0d-4c3d-829f-c72ed3b24843',
]);
moonbots_api("key2name", uuid="9fa3334a-bc0d-4c3d-829f-c72ed3b24843")
await moonbotsAPI("key2name", { uuid: "9fa3334a-bc0d-4c3d-829f-c72ed3b24843" });
avatar_info Get display name for an avatar Live
Input Parameters
ParameterDescription
uuidAvatar UUIDRequired
Example Response
result=OK display_name=Starries
LSL
PHP
Python
JavaScript
moonbotsAPI("avatar_info", [
    "uuid", "9fa3334a-bc0d-4c3d-829f-c72ed3b24843"
]);
moonbots_api('avatar_info', [
    'uuid' => '9fa3334a-bc0d-4c3d-829f-c72ed3b24843',
]);
moonbots_api("avatar_info", uuid="9fa3334a-bc0d-4c3d-829f-c72ed3b24843")
await moonbotsAPI("avatar_info", { uuid: "9fa3334a-bc0d-4c3d-829f-c72ed3b24843" });
bot_location Get the bot's current region and coordinates Live
Example Response
result=OK location=Starries (227,201,23) slurl=https://maps.secondlife.com/...
LSL
PHP
Python
JavaScript
moonbotsAPI("bot_location", []);
moonbots_api('bot_location');
moonbots_api("bot_location")
await moonbotsAPI("bot_location");
nearbyavatars_scan Scan for nearby avatars with names and positions Live
Example Response
result=OK data="Name",uuid,"<x,y,z>",...
LSL
PHP
Python
JavaScript
moonbotsAPI("nearbyavatars_scan", []);
moonbots_api('nearbyavatars_scan');
moonbots_api("nearbyavatars_scan")
await moonbotsAPI("nearbyavatars_scan");
avatar_groups Get the list of groups for the bot (or a specified avatar) Live
Input Parameters
ParameterDescription
uuidAvatar UUID (omit for bot's own groups)Optional
slnameAvatar name — alternative to uuidOptional
Output Variables
VariableDescription
resultOK or FAIL
countNumber of groups returned
dataPipe-separated list of GroupName,GroupUUID pairs
groups(JSON mode) Array of group objects with uuid, name, image, members, permissions
Returns cached group data from the database when available (includes member counts, permissions, and group images). Falls back to a live query if no cached data exists. Use dataType=json for a richer response with full group details.
Example Response
result=OK count=5 data=MOONPIZZA,656af994-...|Cloudlings,64bd586b-...
LSL
PHP
Python
JavaScript
moonbotsAPI("avatar_groups", []);
moonbots_api('avatar_groups');
moonbots_api("avatar_groups")
await moonbotsAPI("avatar_groups");
avatar_picks Get list of an avatar's picks Coming Soon
World Interaction
touch_prim Touch an in-world prim by UUID Live
Input Parameters
ParameterDescription
uuidPrim UUID to touchRequired
Example Response
result=OK
LSL
PHP
Python
JavaScript
moonbotsAPI("touch_prim", [
    "uuid", "9fa3334a-bc0d-4c3d-829f-c72ed3b24843"
]);
moonbots_api('touch_prim', [
    'uuid' => '9fa3334a-bc0d-4c3d-829f-c72ed3b24843',
]);
moonbots_api("touch_prim", uuid="9fa3334a-bc0d-4c3d-829f-c72ed3b24843")
await moonbotsAPI("touch_prim", { uuid: "9fa3334a-bc0d-4c3d-829f-c72ed3b24843" });
find_objects List nearby objects in the region Live
Example Response
result=OK data=ObjectName,uuid,ObjectName2,uuid2,...
LSL
PHP
Python
JavaScript
moonbotsAPI("find_objects", []);
moonbots_api('find_objects');
moonbots_api("find_objects")
await moonbotsAPI("find_objects");
sim_access Control access to the sim (ban/allow/unban) Coming Soon
sim_kick Kick a resident from the sim Coming Soon
sim_restart Start or cancel sim restart routine Coming Soon
sim_send_message Send a message to all sim visitors Coming Soon
region_info Get region info for a sim Coming Soon
parcel_info Get detailed parcel information Coming Soon
parcel_eject Eject avatar from a parcel Coming Soon
Code Helpers & Setup
Getting Started: Before using these helpers, log in and create an API key from the API Keys manager. Select which bots the key can control and what permissions it should have. Then paste your key into the helper below.
LSL Helper Function

Drop this into your LSL script. All command examples above use this function.

// ── MoonBots API Helper for LSL ──
string mbApiKey  = "YOUR_API_KEY";
string mbBotName = "Firstname Lastname";

moonbotsAPI(string command, list params) {
    list query = [
        "action="  + command,
        "apikey="  + llEscapeURL(mbApiKey),
        "botname=" + llEscapeURL(mbBotName)
    ];
    integer i;
    for(i = 0; i < llGetListLength(params); i += 2) {
        query += [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"],
        llDumpList2String(query, "&"));
}

default {
    touch_start(integer n) {
        moonbotsAPI("im", ["slname", "Yaueger Resident", "message", "Hello!"]);
    }
    http_response(key id, integer s, list m, string body) {
        llOwnerSay("API: " + body);
    }
}
PHP Helper
define('API_KEY',  'YOUR_API_KEY');
define('BOT_NAME', 'Firstname Lastname');

function moonbots_api($action, $params = []) {
    $ch = curl_init();
    $params = array_merge([
        'action'  => $action,
        'apikey'  => API_KEY,
        'botname' => BOT_NAME,
    ], $params);
    curl_setopt_array($ch, [
        CURLOPT_URL            => "https://moonbots.co/api/bot.php",
        CURLOPT_POST           => true,
        CURLOPT_POSTFIELDS     => http_build_query($params),
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_TIMEOUT        => 30,
    ]);
    $response = curl_exec($ch);
    curl_close($ch);
    return $response;
}

// Usage:
echo moonbots_api('status');
echo moonbots_api('im', ['slname' => 'Yaueger Resident', 'message' => 'Hi!']);
Python Helper
import requests

API_KEY  = "YOUR_API_KEY"
BOT_NAME = "Firstname Lastname"
API_URL  = "https://moonbots.co/api/bot.php"

def moonbots_api(action, **kwargs):
    payload = {
        "action": action,
        "apikey": API_KEY,
        "botname": BOT_NAME,
        **kwargs,
    }
    r = requests.post(API_URL, data=payload, timeout=30)
    r.raise_for_status()
    return r.text

# Usage:
print(moonbots_api("status"))
print(moonbots_api("im", slname="Yaueger Resident", message="Hello!"))
print(moonbots_api("teleport", location="MoonBots/128/128/20"))
JavaScript / Node.js
const API_KEY  = "YOUR_API_KEY";
const BOT_NAME = "Firstname Lastname";
const API_URL  = "https://moonbots.co/api/bot.php";

async function moonbotsAPI(action, params = {}) {
    const body = new URLSearchParams({
        action, apikey: API_KEY,
        botname: BOT_NAME, ...params,
    });
    const res = await fetch(API_URL, {
        method: "POST",
        headers: { "Content-Type": "application/x-www-form-urlencoded" },
        body,
    });
    if (!res.ok) throw new Error(`HTTP ${res.status}`);
    return res.text();
}

// Usage:
console.log(await moonbotsAPI("status"));
console.log(await moonbotsAPI("im", { slname: "Yaueger Resident", message: "Hello!" }));

Need help with the API?

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

Join MoonBots Discord