API Reference Navigation

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

POST /api/account/token

Generate a new API token for your account.

Services

GET /api/services

List all services in your account.

Response

[
  {
    "id": "uuid",
    "name": "my-service",
    "image": "nginx:alpine",
    "status": "RUNNING",
    "replicas": 2
  }
]
POST /api/deploy

Deploy a new service.

Request Body

{
  "name": "my-service",
  "image": "nginx:alpine",
  "containerPort": 80,
  "public": true,
  "replicas": 2,
  "env": {
    "NODE_ENV": "production"
  }
}
POST /api/services/:id/redeploy

Redeploy an existing service with the latest image.

GET /api/services/:id/logs

Get logs from a service's containers.

POST /api/services/:id/pause

Pause or resume a service.

{ "pause": true }

Databases

GET /api/databases

List all managed databases.

POST /api/databases

Create a new managed database.

{
  "name": "my-postgres",
  "type": "postgres",
  "size": "small"
}

Teams

GET /api/teams

List all teams.

POST /api/teams

Create a new team.

{ "name": "Engineering" }
POST /api/teams/:id/members

Add a member to a team.

Environment Groups (Secrets)

GET /api/env-groups

List all environment groups.

POST /api/env-groups

Create a new environment group.

{
  "name": "production-secrets",
  "variables": {
    "DATABASE_URL": "postgres://...",
    "API_KEY": "secret123"
  }
}
POST /api/services/:id/attach-group/:groupId

Attach an environment group to a service.

Webhooks

GitHub Webhook

POST /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-After header indicates when to retry

Error Codes

Code Description
200Success
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing token
403Forbidden - Insufficient permissions
404Not Found - Resource doesn't exist
429Too Many Requests - Rate limited
500Internal Server Error
503Service Unavailable - Feature requires K8s