githubEdit

key-skeletonAuthentication

Authentication guide for using the Discloud API (how to obtain and safely use your API Token).

circle-info

All requests to the Discloud API must include an API Token in the api-token header.

If you don't have a token yet, generate or retrieve it in your Discloud dashboard. (Replace this note with the exact dashboard link or a screenshot.)


⚙️ How It Works

1

You generate a unique token linked to your account.

2

For every HTTP request include the header: api-token: YOUR_TOKEN_HERE.

3

The token authenticates and authorizes actions on behalf of your account (never share it).

4

Use the /user endpoint to quickly validate the token.


📤 Sending the Token

curl -X GET \
  -H "api-token: $DISCLOUD_TOKEN" \
  https://api.discloud.app/v2/user

🛡 Securing the Token

circle-exclamation

📌 Best practices:

  • Use environment variables instead of hard‑coding.

  • Rotate the token periodically (e.g. every 90 days).

  • Revoke and regenerate immediately if you suspect exposure.

  • Restrict who can access infrastructure where the variable is stored.


⚡ Quick Token Verification

Call /user right after setting the environment variable. If you get HTTP 200 with user data, authentication is working.

circle-info

You can also update the user locale (e.g. en-US) through /locale/{locale} to validate another authenticated route.


The operations below require the api-token header:

Get current user information

get

Returns information about the authenticated user

Authorizations
api-tokenstringRequired
Responses
get
/user

Last updated