How Does Authentication Work?
Every request needs one of your server's API tokens. The token tells Melonly which server you're working with, so you never send a server ID yourself.
Create a Token
- Open Your Server Settings
In your dashboard, go to Settings.
- Create the Token
Under Server API Tokens, click Create token, give it a name and optionally an expiry date.
- Copy It
Copy the token straight away. You won't be able to see it again.
See Server API Tokens for editing, deactivating and deleting tokens.
Send the Token
Put the token in the Authorization header, after the word Bearer:
A missing, wrong, expired or deactivated token gets a 401 with the code unauthorized.
What Can a Token Reach?
A token reaches its own server and that server's departments, and nothing else. Asking for something from another server returns 404, as if it didn't exist.
The verification endpoints are the one exception. They look up any Melonly user's linked accounts.
Keep Your Token Safe
- Keep tokens on your server or bot, never in a website's code where visitors can see it.
- Store them in environment variables or a secrets manager, not in your code repository.
- Use a separate token for each bot or tool, so you can turn one off without breaking the rest.
- If a token leaks, deactivate it in your settings or with Deactivate a Token, then create a new one.
Where to Go Next
Need help?
Still have questions? Join our Discord server for support from the Melonly Team.