Cloudexa API
API v1 gives you access to account, repository, hosting, deployment and database data using JSON and bearer tokens.
Basics
The API is versioned under /api/v1 and returns JSON responses.
Endpoints
Routes currently exposed by API v1.
/api/v1
Public
/api/v1/health
Public
/api/v1/me
Token
/api/v1/repositories
Token
/api/v1/hosting/projects
Token
/api/v1/hosting/projects/:id
Token
/api/v1/deployments
Token
/api/v1/databases
Token
/api/v1/tokens
Session
/api/v1/tokens
Session
/api/v1/tokens/:id
Session
Authentication
Send your API token in the Authorization header.
curl https://cloudexa.dev/api/v1/me \
-H "Authorization: Bearer clx_api_YOUR_TOKEN"
{
"id": 1,
"username": "example",
"plan": "normal",
"authentication": "token"
}
clx_api_. Cloudexa stores the token hash, not the raw token.
Example request
Fetch the hosting projects available to the token owner.
curl https://cloudexa.dev/api/v1/hosting/projects \
-H "Authorization: Bearer clx_api_YOUR_TOKEN"
const response =
await fetch(
"https://cloudexa.dev/api/v1/hosting/projects",
{
headers: {
Authorization:
"Bearer " +
process.env.CLOUDEXA_TOKEN
}
}
);
const data =
await response.json();
console.log(
data.projects
);
Health
The health endpoint is public and can be used for simple monitoring.
{
"status": "operational",
"database": "operational",
"version": "v1",
"latency_ms": 3
}
Security
API v1 is deliberately limited to application-level resources and token management.
Use API v1
Create a token, then send it as a bearer token with your requests.