Orbit Developers

Using the API

The basics

  • Base URL: https://api.orbitapp.ir/v1
  • Send your token with every request: Authorization: Bot <token>
  • Bodies are JSON (Content-Type: application/json)
  • IDs are strings. Keep them that way, they're too big for a JavaScript number.
  • Times are milliseconds since 1970, in UTC

Requests from a browser are refused (anything with an Origin header), so run your bot on a server.

Errors

Errors come back as JSON:

{ "code": "forbidden", "message": "you don't have permission to do that" }
StatuscodeWhat happened
400invalid_requestSomething in the request is wrong. field says what.
401unauthorizedThe token is missing, wrong or was replaced
403forbiddenYour bot isn't allowed to do that
403blockedThe server's AutoMod blocked the text
403swearing, sexual_content, politicalThe text breaks Orbit's rules
404not_foundIt doesn't exist, or your bot can't see it
409limit_reachedYou hit a limit, like 50 pins in a channel
413payload_too_largeThe body is too big
429rate_limited, slow_mode, too_newSlow down and wait Retry-After seconds
500internalOur fault. Try again in a bit.

Some endpoints are for people only. Bots get a 403 with bots can't use this. A few, like the command endpoints, are for bots only. And if your bot can't see something, you'll get a 404, never a 403.

Paging

Message lists take limit (1–100, default 50) plus before or after, which is a message ID. Results come oldest first.

Rate limits

Every bot has its own limits:

WhatPer minuteBurst
All requests1200600
Sending and editing messages6020
Reactions12030
Other changes: pins, roles, channels, timeouts, kicks, bans, commands6030

Go over and you get a 429 with a Retry-After header. Wait that many seconds and try again. Channels in slow mode also answer 429 (slow_mode) unless your bot has Manage Messages. Sending lots of wrong tokens from one IP address gets that address rate limited too.