Skip to content

API Authentication

All Piora API requests require authentication. Piora uses Bearer Tokens for API authentication.

  1. Log into the Piora Dashboard
  2. Go to “Settings” > “API Tokens”
  3. Click “Generate New Token”
  4. Name the token (e.g., ci-cd-pipeline)
  5. Select token permission scopes
  6. Click “Create”

When generating a token, you can select the following permission scopes:

PermissionDescription
servers:readRead server information
servers:writeManage servers
applications:readRead application information
applications:writeManage applications
applications:deployDeploy applications
databases:readRead database information
databases:writeManage databases
backups:readRead backup information
backups:writeManage backups

Include the token in the Authorization header of every API request:

Terminal window
curl -X GET https://app.piora.dev/api/v1/servers \
-H "Authorization: Bearer piora_token_xxxxxxxxxxxx"
// Node.js (fetch)
const response = await fetch('https://app.piora.dev/api/v1/servers', {
headers: {
'Authorization': 'Bearer piora_token_xxxxxxxxxxxx',
'Content-Type': 'application/json',
},
});
const data = await response.json();
# Python (requests)
import requests
response = requests.get(
'https://app.piora.dev/api/v1/servers',
headers={'Authorization': 'Bearer piora_token_xxxxxxxxxxxx'}
)
data = response.json()
// Go
req, _ := http.NewRequest("GET", "https://app.piora.dev/api/v1/servers", nil)
req.Header.Set("Authorization", "Bearer piora_token_xxxxxxxxxxxx")
resp, _ := http.DefaultClient.Do(req)

On the “Settings” > “API Tokens” page, you can see all created tokens:

  • Token name
  • Permission scopes
  • Creation date
  • Last used time

If a token may have been compromised, revoke it immediately:

  1. Go to “Settings” > “API Tokens”
  2. Find the target token
  3. Click “Revoke”
  4. Confirm the operation

Once revoked, all requests using that token will immediately receive a 401 Unauthorized response.

  1. Never hardcode tokens in source code — Use environment variables
  2. Never commit tokens to version control — Add tokens to .gitignore
  3. Rotate tokens regularly — We recommend every 90 days
  4. Use least privilege — Only grant the necessary permission scopes
  5. Monitor usage — Regularly review token usage logs
Terminal window
# Use environment variables
export PIORA_API_TOKEN=piora_token_xxxxxxxxxxxx
# Use in your application
curl -H "Authorization: Bearer $PIORA_API_TOKEN" \
https://app.piora.dev/api/v1/servers
HTTP StatusDescription
401Token is invalid or expired
403Token has insufficient permissions
429Rate limit exceeded