Authentication
Authentication guide for using the Discloud API (how to obtain and safely use your API Token).
⚙️ How It Works
You generate a unique token linked to your account.
For every HTTP request include the header: api-token: YOUR_TOKEN_HERE
.
The token authenticates and authorizes actions on behalf of your account (never share it).
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
Never commit your token (e.g. to Git). Store it in environment variables (.env
, CI/CD secrets, etc.).
📌 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.
📚 Related Endpoints References
The operations below require the api-token
header:
Returns information about the authenticated user
Successful operation
Authentication error
GET /v2/user HTTP/1.1
Host: api.discloud.app
api-token: YOUR_API_KEY
Accept: */*
{
"status": "ok",
"message": "User data were successfully charged",
"user": {
"userID": "803658045736878080",
"totalRamMb": 16384,
"ramUsedMb": 3386,
"subdomains": [
"exemplo"
],
"customdomains": [
"example.discloud.com"
],
"apps": [
"1719010867306"
],
"plan": "Safira",
"locale": "pt-BR",
"lastDataLeft": {
"days": 264,
"hours": 12,
"minutes": 6,
"seconds": 56
},
"planDataEnd": "2026-01-12T22:28:58.189Z"
}
}
Updates the user's preferred language/locale
The locale to set for the user
Locale successfully updated
Authentication error
Invalid locale specified
PUT /v2/locale/{locale} HTTP/1.1
Host: api.discloud.app
api-token: YOUR_API_KEY
Accept: */*
{
"status": "ok",
"locale": "en-US"
}
Last updated