Skip to content

API reference

Scopes

Each RemiliaNET API scope, the endpoints that it allows, and the token kind that it accepts.

A scope is a named permission that an access token carries. A scoped endpoint returns 403 insufficient_scope when a valid token lacks its scope.

Scope reference

Most scopes need a user-delegated token from a Login client. Each endpoint link opens request and response examples for Remilia Jackson.

ScopeGrantsEndpointsToken
remilia:stats.readRead the account statistics of the authenticated userGET /me/statsUser-delegated
remilia:notifications.readRead the notifications of the authenticated userGET /me/notificationsUser-delegated
remilia:pokes.writePoke other users, attributed to the authenticated userPOST /users/{handle}/poke, GET /users/{handle}/poke/cooldownUser-delegated
remilia:social.readRead the mutual friends of the authenticated user and another userGET /users/{username}/mutual-friendsUser-delegated
remilia:social.writeSend, accept, and reject friend requests as the authenticated userPOST /friendship/request, POST /friendship/accept, POST /friendship/rejectUser-delegated
remilia:beetle.readRead the Beetle game state and cards of the authenticated userGET /me/beetle, GET /me/beetle/cards, GET /me/beetle/cooldownsUser-delegated
remilia:ball.readRead the Ball status of the authenticated user: the unread message count, the date status and partner, and the gallery progressGET /ball/meUser-delegated
remilia:chat.readRead global chat messagesGET /global-chat/messagesUser-delegated or app-only
remilia:chat.writePost to global chat as the authenticated userPOST /global-chat/messagesUser-delegated
remilia:directory.readResolve and enumerate public directory identitiesPOST /directory/resolve, GET /usersUser-delegated or app-only

Scopes for public data

remilia:chat.read and remilia:directory.read cover public data. An app with a server reads this data with an app-only token from an API client. A Login client does not need these scopes when its user-facing features do not use them.

A user-delegated chat read also applies the hidden-user and privacy rules of that user. It suits an app that shows chat as that user sees it. A browser-only app has no client secret, so it reads with the token of the user.

Endpoints without a scope

Four endpoints need no remilia: scope:

Issued scopes

The scope field of the token response lists the granted permissions, separated by spaces:

{
  "scope": "openid remilia:stats.read remilia:pokes.write"
}

For more information about grants, see App permissions.

Errors

A valid token without the required scope returns this error:

{
  "error": {
    "code": "insufficient_scope",
    "message": "scope remilia:pokes.write required"
  }
}

An endpoint that requires the token of a user returns 403 requires_user for an app-only token. Only a Login client obtains the token of a user.