Skip to main content

API Overview

Dploy provides a REST API for managing ephemeral Kubernetes environments.

Base URL

https://dploy.your-domain.com

Authentication

Most endpoints require JWT authentication via Bearer token:

curl -H "Authorization: Bearer $TOKEN" https://dploy.your-domain.com/api/environments

Obtaining a Token

Via OIDC Flow

  1. Redirect users to /auth/login
  2. After authentication, users are redirected back with token in URL hash
  3. Extract token from #token=... fragment

Via Direct OIDC

Obtain a token directly from your OIDC provider and include it in requests.

Response Format

All responses are JSON. Successful responses return data directly:

{
"uuid": "a1b2c3d4",
"status": "healthy",
"url": "https://john-doe-a1b2c3d4.env.dploy.dev",
"expiresAt": "2024-01-15T16:00:00Z"
}

Error responses include an error field:

{
"error": "Environment not found"
}

HTTP Status Codes

CodeDescription
200Success
204Success (no content)
401Unauthorized - invalid or missing token
403Forbidden - quota exceeded or access denied
404Resource not found
500Internal server error

Rate Limiting

No rate limiting is currently implemented. Consider adding rate limiting at the ingress level for production deployments.

API Endpoints

Health

MethodPathAuthDescription
GET/healthNoLiveness probe
GET/readyNoReadiness probe

Environments

MethodPathAuthDescription
GET/api/environments/availableNoList available environments
GET/api/environmentsYesList user's active environments

Run (Environment Management)

MethodPathAuthDescription
GET/run/:envYesCreate or get environment
GET/run/:env/statusYesGet environment status
POST/run/:env/extendYesExtend environment TTL
DELETE/run/:envYesDelete environment

Alternative paths with /api prefix:

MethodPathAuthDescription
GET/api/run/:envYesCreate or get environment
GET/api/run/:env/statusYesGet environment status
POST/api/run/:env/extendYesExtend environment TTL
DELETE/api/run/:envYesDelete environment

Authentication

MethodPathAuthDescription
GET/auth/loginNoInitiate OIDC login flow
GET/auth/callbackNoOIDC callback handler
GET/auth/logoutNoLogout (clears client state)

Quick Examples

# Health check
curl https://dploy.your-domain.com/health

# List available environments (no auth)
curl https://dploy.your-domain.com/api/environments/available

# Create/get an environment
curl -H "Authorization: Bearer $TOKEN" \
https://dploy.your-domain.com/run/webterm

# Check status
curl -H "Authorization: Bearer $TOKEN" \
https://dploy.your-domain.com/run/webterm/status

# Extend TTL
curl -X POST -H "Authorization: Bearer $TOKEN" \
https://dploy.your-domain.com/run/webterm/extend

# Delete environment
curl -X DELETE -H "Authorization: Bearer $TOKEN" \
https://dploy.your-domain.com/run/webterm