Script & in-world automation

OneBot HTTP API (v1)

Control your hosted bot from LSL scripts or any HTTP client using per-bot API tokens from the customer portal.

Overview

All bot API routes live under:

https://getonebot.com/api/v1/bot/{botId}

Replace {botId} with your bot's numeric id from the portal. Responses are JSON unless you pass ?format=text (plain ok or error: …).

Most actions enqueue work on the bot host and return a commandId. Long operations may return pending: true; poll GET …/commands/{commandId}.

Authentication

Generate a token on your bot's API tab in the customer portal. Tokens are shown once; store them securely. Regenerate or revoke anytime.

  • Authorization: Bearer obt_example_secret_replace_in_portal
  • or X-OneBot-Token: obt_example_secret_replace_in_portal

Tokens begin with obt_ (placeholders above are examples only).

Optional headers (recommended in-world):

  • X-SecondLife-Owner-Key — required when the token has Require owner key (default). Must match the bot owner's avatar UUID.
  • X-SecondLife-Object-Name, X-SecondLife-Region — audit metadata.
  • X-Idempotency-Key — for pay (see endpoint).

Token scopes

Each token stores a bitmask of allowed actions. Choose scopes when generating the token.

ScopeValueAllows
Status1GET …/status (balance needs Status or Money)
Chat2say, im
Movement4teleport, sit, stand, sethome
Groups8group/invite, group/notice
Inventory16give
Money32pay

Request body formats

POST bodies accept:

  • JSON object (Content-Type: application/json)
  • HTML form fields
  • LSL-friendly pipe: key|value|key2|value2
  • Query string style: a=b&c=d

Endpoints

GET /api/v1/bot/{botId}/status Status

Bot status

Returns whether the bot is online, current region, position, and optionally balance.

Parameters

  • format (query, optional) — Set to text for plain ok / error responses instead of JSON.

Example response

{"online":true,"region":"Example Region","position":"128.0,128.0,25.0","balanceL":5000}

curl

curl -sS -H "Authorization: Bearer obt_example_secret_replace_in_portal" "https://getonebot.com/api/v1/bot/12345/status"

LSL (llHTTPRequest)

llHTTPRequest(
    "https://getonebot.com/api/v1/bot/12345/status",
    [HTTP_METHOD, "GET", HTTP_CUSTOM_HEADER, "Authorization", "Bearer obt_example_secret_replace_in_portal"],
    ""
);

C#

using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
    new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", "obt_example_secret_replace_in_portal");
var response = await client.GetAsync("https://getonebot.com/api/v1/bot/12345/status");
var json = await response.Content.ReadAsStringAsync();
POST /api/v1/bot/{botId}/say Chat

Say in local chat

Enqueue a local chat message. Optional channel: say (default), shout, or whisper.

Parameters

  • message (body, required) — Text to speak.
  • channel (body, optional) — say, shout, or whisper.
  • format (query, optional) — text for plain response.

Example request

{"message":"Hello from my script"}

Example response

{"ok":true,"commandId":42}

curl

curl -sS -X POST -H "Authorization: Bearer obt_example_secret_replace_in_portal" -H "Content-Type: application/json" -d "{\"message\":\"Hello from my script\"}" "https://getonebot.com/api/v1/bot/12345/say"

LSL (llHTTPRequest)

llHTTPRequest(
    "https://getonebot.com/api/v1/bot/12345/say",
    [HTTP_METHOD, "POST", HTTP_CUSTOM_HEADER, "Authorization", "Bearer obt_example_secret_replace_in_portal"],
    "message|Hello from my script"
);

C#

using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
    new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", "obt_example_secret_replace_in_portal");
var content = new StringContent(
    "{\"message\":\"Hello from my script\"}",
    System.Text.Encoding.UTF8,
    "application/json");
var response = await client.PostAsync("https://getonebot.com/api/v1/bot/12345/say", content);
POST /api/v1/bot/{botId}/im Chat

Instant message

Send an IM. Recipient to can be a UUID or owner (bot owner avatar).

Parameters

  • to (body, required) — Recipient UUID or owner.
  • message (body, required) — IM body.

Example request

{"to":"owner","message":"Ping"}

Example response

{"ok":true,"commandId":43}

curl

curl -sS -X POST -H "Authorization: Bearer obt_example_secret_replace_in_portal" -H "Content-Type: application/json" -d "{\"to\":\"owner\",\"message\":\"Ping\"}" "https://getonebot.com/api/v1/bot/12345/im"

LSL (llHTTPRequest)

llHTTPRequest(
    "https://getonebot.com/api/v1/bot/12345/im",
    [HTTP_METHOD, "POST", HTTP_CUSTOM_HEADER, "Authorization", "Bearer obt_example_secret_replace_in_portal"],
    "to|owner|message|Ping"
);

C#

using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
    new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", "obt_example_secret_replace_in_portal");
var content = new StringContent(
    "{\"to\":\"owner\",\"message\":\"Ping\"}",
    System.Text.Encoding.UTF8,
    "application/json");
var response = await client.PostAsync("https://getonebot.com/api/v1/bot/12345/im", content);
POST /api/v1/bot/{botId}/teleport Movement

Teleport

Teleport the bot to a region and position.

Parameters

  • region (body, required) — Region name.
  • x (body, required) — X coordinate.
  • y (body, required) — Y coordinate.
  • z (body, required) — Z coordinate.

Example request

{"region":"Example Region","x":128,"y":128,"z":25}

Example response

{"ok":true,"commandId":44}

curl

curl -sS -X POST -H "Authorization: Bearer obt_example_secret_replace_in_portal" -H "Content-Type: application/json" -d "{\"region\":\"Example Region\",\"x\":128,\"y\":128,\"z\":25}" "https://getonebot.com/api/v1/bot/12345/teleport"

C#

using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
    new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", "obt_example_secret_replace_in_portal");
var content = new StringContent(
    "{\"region\":\"Example Region\",\"x\":128,\"y\":128,\"z\":25}",
    System.Text.Encoding.UTF8,
    "application/json");
var response = await client.PostAsync("https://getonebot.com/api/v1/bot/12345/teleport", content);
POST /api/v1/bot/{botId}/sit Movement

Sit

Sit on a target object or the ground.

Parameters

  • target (body, optional) — Object key to sit on; omit for ground sit.

Example request

{"target":"00000000-0000-0000-0000-0000000000dd"}

Example response

{"ok":true,"commandId":45}
POST /api/v1/bot/{botId}/stand Movement

Stand

Stand up if the bot is sitting.

Example request

{}

Example response

{"ok":true,"commandId":46}

C#

using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
    new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", "obt_example_secret_replace_in_portal");
var content = new StringContent(
    "{}",
    System.Text.Encoding.UTF8,
    "application/json");
var response = await client.PostAsync("https://getonebot.com/api/v1/bot/12345/stand", content);
POST /api/v1/bot/{botId}/sethome Movement

Set home

Set the bot's home location to its current position.

Example request

{}

Example response

{"ok":true,"commandId":47,"resultJson":"{\"region\":\"Example Region\"}"}
POST /api/v1/bot/{botId}/group/invite Groups

Group invite

Invite an avatar to a group. group can be UUID or a name substring from the bot's group list.

Parameters

  • group (body, required) — Group UUID or searchable name.
  • avatar (body, required) — Avatar UUID or owner.
  • role (body, optional) — Role UUID.
  • role_name (body, optional) — Role name (e.g. Officers); resolved when role is omitted.

Example request

{"group":"00000000-0000-0000-0000-0000000000bb","avatar":"00000000-0000-0000-0000-0000000000aa"}

Example response

{"ok":true,"commandId":48}
POST /api/v1/bot/{botId}/group/notice Groups

Group notice

Send a group notice (bot needs officer permission).

Parameters

  • group (body, required) — Group UUID or searchable name.
  • subject (body, optional) — Notice subject.
  • message (body, required) — Notice body.

Example request

{"group":"00000000-0000-0000-0000-0000000000bb","subject":"Hello","message":"Weekly update"}

Example response

{"ok":true,"commandId":49}
POST /api/v1/bot/{botId}/give Inventory

Give inventory item

Give an inventory item to an avatar.

Parameters

  • item (body, required) — Inventory item UUID.
  • avatar (body, required) — Recipient UUID or owner.
  • itemName (body, optional) — Display name hint.

Example request

{"item":"00000000-0000-0000-0000-0000000000cc","avatar":"owner"}

Example response

{"ok":true,"commandId":50}
POST /api/v1/bot/{botId}/pay Money

Pay L$

Send Linden dollars. Subject to daily cap and send rate limits. Bot must be online.

Parameters

  • avatar (body, required) — Recipient UUID or owner.
  • amount (body, required) — Positive integer L$ amount.
  • note (body, optional) — Payment note (max 63 characters).
  • idempotency (body, optional) — Idempotency key; or header X-Idempotency-Key.

Example request

{"avatar":"owner","amount":10,"note":"Thank you"}

Example response

{"ok":true,"commandId":51}

curl

curl -sS -X POST -H "Authorization: Bearer obt_example_secret_replace_in_portal" -H "Content-Type: application/json" -d "{\"avatar\":\"owner\",\"amount\":10,\"note\":\"Thank you\"}" "https://getonebot.com/api/v1/bot/12345/pay"

LSL (llHTTPRequest)

llHTTPRequest(
    "https://getonebot.com/api/v1/bot/12345/pay",
    [HTTP_METHOD, "POST", HTTP_CUSTOM_HEADER, "Authorization", "Bearer obt_example_secret_replace_in_portal"],
    "avatar|owner|amount|10"
);

C#

using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
    new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", "obt_example_secret_replace_in_portal");
var content = new StringContent(
    "{\"avatar\":\"owner\",\"amount\":10,\"note\":\"Thank you\"}",
    System.Text.Encoding.UTF8,
    "application/json");
var response = await client.PostAsync("https://getonebot.com/api/v1/bot/12345/pay", content);
GET /api/v1/bot/{botId}/commands/{commandId} (any valid token)

Poll command status

Check status of an async host command. No specific scope required.

Parameters

  • commandId (path, required) — Host command id from a prior POST response.
  • format (query, optional) — text for plain response.

Example response

{"status":"Completed","error":null,"resultJson":null}

curl

curl -sS -H "Authorization: Bearer obt_example_secret_replace_in_portal" "https://getonebot.com/api/v1/bot/12345/commands/51"

LSL (llHTTPRequest)

llHTTPRequest(
    "https://getonebot.com/api/v1/bot/12345/commands/51",
    [HTTP_METHOD, "GET", HTTP_CUSTOM_HEADER, "Authorization", "Bearer obt_example_secret_replace_in_portal"],
    ""
);

C#

using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
    new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", "obt_example_secret_replace_in_portal");
var response = await client.GetAsync("https://getonebot.com/api/v1/bot/12345/commands/51");
var json = await response.Content.ReadAsStringAsync();

Errors

Failed calls return HTTP 400 Bad Request with JSON {"error":"message"} (or error: message in text mode). Common messages:

  • Missing API token.
  • Invalid token format.
  • Invalid or revoked token.
  • Rate limit exceeded (60 calls per minute).
  • Owner key required (X-SecondLife-Owner-Key).
  • Request not from an allowed simulator IP (when token restricts IPs).
  • Missing scope.
  • Validation errors per endpoint (e.g. message required, amount required).
  • Money errors: daily cap, 10-minute send limit, offline bot, insufficient balance.

Rate limits

  • 60 requests per minute per API token (rolling window; includes failed auth attempts).
  • 5 pay attempts per 10 minutes per bot when using pay.

L$ send cap

API pay shares the same rules as the portal: default daily send cap L$10,000 per bot (UTC day), configurable by admins. Notes are limited to 63 characters. The bot must be online and the token needs the Money scope.