API Documentation
Complete reference for the Apex REST API. Base URL: https://www.apexpaas.com/api
Authentication
All API requests require authentication using a Bearer token.
Request Header
Authorization: Bearer YOUR_API_TOKEN
Get API Token
/api/account/token
Generate a new API token for your account.
Services
/api/services
List all services in your account.
Response
[
{
"id": "uuid",
"name": "my-service",
"image": "nginx:alpine",
"status": "RUNNING",
"replicas": 2
}
]
/api/deploy
Deploy a new service.
Request Body
{
"name": "my-service",
"image": "nginx:alpine",
"containerPort": 80,
"public": true,
"replicas": 2,
"env": {
"NODE_ENV": "production"
}
}
/api/services/:id/redeploy
Redeploy an existing service with the latest image.
/api/services/:id/logs
Get logs from a service's containers.
/api/services/:id/pause
Pause or resume a service.
{ "pause": true }
Databases
/api/databases
List all managed databases.
/api/databases
Create a new managed database.
{
"name": "my-postgres",
"type": "postgres",
"size": "small"
}
Teams
/api/teams
List all teams.
/api/teams
Create a new team.
{ "name": "Engineering" }
/api/teams/:id/members
Add a member to a team.
Environment Groups (Secrets)
/api/env-groups
List all environment groups.
/api/env-groups
Create a new environment group.
{
"name": "production-secrets",
"variables": {
"DATABASE_URL": "postgres://...",
"API_KEY": "secret123"
}
}
/api/services/:id/attach-group/:groupId
Attach an environment group to a service.
Webhooks
GitHub Webhook
/api/webhooks/github
Receive GitHub push events for automatic deployments. Configure this URL in your GitHub repository settings.
Supported events: push, pull_request
Rate Limits
API requests are rate limited to ensure fair usage:
- 100 requests per minute per IP address
- Rate limited responses return HTTP 429
- The
Retry-Afterheader indicates when to retry
Error Codes
| Code | Description |
|---|---|
| 200 | Success |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid or missing token |
| 403 | Forbidden - Insufficient permissions |
| 404 | Not Found - Resource doesn't exist |
| 429 | Too Many Requests - Rate limited |
| 500 | Internal Server Error |
| 503 | Service Unavailable - Feature requires K8s |