LammaDevelopers Open Lamma

API reference

Base URL, versioning, conventions, errors and objects of the REST API.

The REST API is how apps read and change things in Lamma. It is versioned, JSON in and out, and shaped like Discord's so code ported from there reads the same.

#Base URL

Text
https://lammapp.sa/v1

Every request needs a bot token in the Authorization header. Request bodies are JSON, up to 64 KB. Responses are never cached (Cache-Control: no-store).

#Versioning

/v1 only grows: new fields, endpoints and error codes can appear, but nothing is removed or changes meaning. Ignore fields you don't know. Anything that would break existing bots goes into a new /v2, with notes on how to move.

#Conventions

  • IDs are strings. They are Lamma's own ids, so a Discord id won't find anything.
  • Times are Unix time in milliseconds, unless a field says otherwise.
  • Servers are called guilds in paths and fields, as on Discord.
  • Responses are the object or list itself, with no wrapper.
  • Path parameters are written {name} on these pages. @me means the bot or its application.

#Errors

Errors have a status and a short code:

JSON
{ "error": "missing_scope", "scope": "messages.read" }
StatusCodeMeaning
400message_invalid and othersThe request body is wrong
401bot_token_requiredNo token was sent
401bot_token_invalidThe token is wrong or revoked
403application_disabledThe app was switched off or deleted
403missing_scopeThe install doesn't include a scope this call needs. scope names it
403missing_permissionsThe bot's role lacks a permission this call needs
404not_foundIt doesn't exist, or the bot can't see it
409nonce_conflictThe nonce was used before with a different message
429rate_limitSlow down. See Rate limits

Anything the bot can't see answers 404 exactly like something that doesn't exist: a server the app isn't in, a hidden or deleted channel, or a direct message. That way the API never confirms what is there.

#Objects

#User object

FieldTypeNotes
idstring
usernamestringUnique handle
namestringDisplay name
avatar_idstring or null
botbooleantrue for app bot accounts

The server, member, role, channel and message objects are described with their endpoints.

#Endpoints

AreaPage
The bot, its application and the gateway addressUsers and applications
Servers, roles and membersServers
Channels, messages and reactionsChannels and messages
Audit logsAudit logs
Slash commands and interaction answersSlash commands