falafy
EN
Download free

Public API v1 · @falafy/bot

API v1 reference

Base URL: https://falafy.com.br/api/v1. Send JSON and the Authorization: Bot <token> (bots) or Bearer <token> (OAuth2) header.

Conventions

  • Versioned URL: /api/v1/.... Breaking changes only ship in a new version.
  • IDs: UUID v7 strings. Paginate with before/after ids (they are time ordered).
  • Dates: ISO 8601. Fields: camelCase. Permissions: big integer as a string (bitfield).
  • Errors: { code, message, status } with stable string codes; see rate limits and errors.
  • Invisible means 404: a channel or server the bot can’t see answers as if it didn’t exist.
  • User-Agent recommended: FalafyBot (https://your.site, 1.0).

Routes

MethodRoute (/api/v1)AuthWhat it does
GET/users/@meBot · Bearer identifyThe token’s user (email only with the email scope).
GET/users/@me/serversBot · Bearer serversServers of the user/bot with its permissions.
GET/users/{userId}BotPublic profile of someone who shares a server with the bot.
POST/users/@me/channelsBotOpens (or returns) a DM: { recipientId }.
DELETE/users/@me/servers/{serverId}BotThe bot leaves the server.
GET/oauth2/@meBearerApplication, scopes and expiry of the OAuth2 token.
GET/applications/@meBotThe bot’s application (public key, enabled intents).
GET/gateway/botBotGateway URL and heartbeat interval.
GET/servers/{serverId}BotServer data.
GET/servers/{serverId}/channelsBotChannels the bot can see.
GET/servers/{serverId}/rolesBotServer roles.
GET/servers/{serverId}/membersBot + SERVER_MEMBERSMembers (limit up to 1000, after=userId).
GET/servers/{serverId}/members/{userId}BotOne member.
PUT/servers/{serverId}/members/{userId}/roles/{roleId}BotAdds a role (manage roles + hierarchy).
DELETE/servers/{serverId}/members/{userId}/roles/{roleId}BotRemoves a role.
GET/channels/{channelId}BotChannel data.
GET/channels/{channelId}/messagesBotHistory (limit, before, after).
POST/channels/{channelId}/messagesBotSends: content, embeds, components, replyToId, mentions.
GET/channels/{channelId}/messages/{messageId}BotOne message.
PATCH/channels/{channelId}/messages/{messageId}BotEdits one of the bot’s messages.
DELETE/channels/{channelId}/messages/{messageId}BotDeletes (its own, or any with manage messages).
PUT/channels/{channelId}/messages/{messageId}/reactions/{emoji}/@meBotReacts.
DELETE/channels/{channelId}/messages/{messageId}/reactions/{emoji}/@meBotRemoves the reaction.
GET/channels/{channelId}/messages/{messageId}/reactions/{emoji}BotWho reacted (up to 100).
POST/channels/{channelId}/typingBotShows “typing…”.
GET/channels/{channelId}/webhooksBotChannel webhooks (manage webhooks).
POST/channels/{channelId}/webhooksBotCreates a webhook: { name }.
GET · PATCH · DELETE/webhooks/{webhookId}BotManages a webhook.
GET · PUT · POST/applications/{appId}/commandsBotGlobal commands (PUT replaces all).
GET · PATCH · DELETE/applications/{appId}/commands/{commandId}BotOne global command.
GET · PUT · POST/applications/{appId}/servers/{serverId}/commandsBotOne server’s commands (instant).
POST/interactions/{id}/{token}/callbacktokenInitial interaction response.
GET · PATCH · DELETE/webhooks/{appId}/{token}/messages/@originaltokenThe original response.
POST/webhooks/{appId}/{token}tokenFollow-up.
POST/webhooks/{webhookId}/{token}tokenExecutes a webhook (?wait=true).
GET · PATCH · DELETE/webhooks/{webhookId}/{token}/messages/{messageId}tokenWebhook message.

Messages with embeds and components

Bots can send up to 10 embeds (title up to 256 characters, description up to 4096, up to 25 fields, 6000 characters in total) and up to 5 component rows. Embed images must be https; the app shows a link to them instead of loading images from other sites.

{
  "content": "Topa uma partida?",
  "components": [
    { "type": 1, "components": [
      { "type": 2, "style": 3, "label": "Bora", "customId": "aceitar" },
      { "type": 2, "style": 5, "label": "Regras", "url": "https://exemplo.com/regras" }
    ]},
    { "type": 1, "components": [
      { "type": 3, "customId": "jogo", "placeholder": "Qual jogo?",
        "options": [{ "label": "CS2", "value": "cs2" }, { "label": "Valorant", "value": "val" }] }
    ]}
  ]
}

Message content

Without the privileged MESSAGE_CONTENT intent, API reads and gateway events come with empty content, embeds, attachments and components, except in DMs, on the bot’s own messages and on messages that mention the bot.