Skip to main content

API Endpoints

Detailed documentation for all Dploy API endpoints.

Health Endpoints

GET /health

Liveness probe for Kubernetes.

Authentication: None

Response:

{
"status": "ok"
}

GET /ready

Readiness probe - verifies environments are loaded.

Authentication: None

Response (200):

{
"status": "ready"
}

Response (503):

{
"error": "Service not ready"
}

Environment Listing

GET /api/environments/available

List all enabled environment templates.

Authentication: None

Response:

[
{
"name": "webterm",
"description": "Web Terminal for students",
"icon": "terminal"
},
{
"name": "vscode",
"description": "VS Code in the browser",
"icon": "code"
}
]

GET /api/environments

List the authenticated user's active environments.

Authentication: Required

Response:

{
"environments": [
{
"name": "webterm",
"uuid": "a1b2c3d4",
"status": "healthy",
"url": "https://john-doe-a1b2c3d4.env.dploy.dev",
"expiresAt": "2024-01-15T16:00:00Z",
"icon": "terminal"
}
],
"count": 1,
"limit": 5
}

Fields:

FieldTypeDescription
environmentsarrayList of user's environments
countintegerNumber of active environments
limitintegerMaximum allowed (quota)

Environment Object:

FieldTypeDescription
namestringEnvironment type name
uuidstring8-character unique identifier
statusstringArgoCD health status
urlstringEnvironment access URL
expiresAtstringISO 8601 expiration timestamp
iconstringIcon identifier

Run Endpoints

GET /run/:env

Create a new environment or return existing one.

Authentication: Required

Path Parameters:

ParameterTypeDescription
envstringEnvironment name (e.g., webterm)

Response (200):

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

Status Values:

StatusDescription
pendingEnvironment is being created
progressingArgoCD is syncing resources
healthyEnvironment is ready
degradedSome resources have issues
missingResources not found

Error Responses:

CodeErrorDescription
401UnauthorizedInvalid or missing token
403Maximum N environments allowedQuota exceeded
404Environment not foundUnknown environment name

GET /run/:env/status

Get the current status of a user's environment.

Authentication: Required

Path Parameters:

ParameterTypeDescription
envstringEnvironment name

Response (200):

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

Error Response (404):

{
"error": "Environment webterm not found"
}

POST /run/:env/extend

Extend the TTL of an existing environment.

Authentication: Required

Path Parameters:

ParameterTypeDescription
envstringEnvironment name

Response (200):

{
"expiresAt": "2024-01-15T18:00:00Z"
}

The TTL is extended by EXTEND_TTL seconds (default: 2 hours).

Error Response (404):

{
"error": "Environment webterm not found"
}

DELETE /run/:env

Delete a user's environment.

Authentication: Required

Path Parameters:

ParameterTypeDescription
envstringEnvironment name

Response: 204 No Content

Error Response (404):

{
"error": "Environment webterm not found"
}

Authentication Endpoints

GET /auth/login

Initiate OIDC authorization code flow.

Query Parameters:

ParameterTypeDescription
return_urlstringURL to redirect after login (optional)

Behavior:

  1. Generates a secure state parameter
  2. Redirects to OIDC provider authorization endpoint
  3. After successful auth, redirects to callback

GET /auth/callback

Handle OIDC callback from provider.

Query Parameters:

ParameterTypeDescription
codestringAuthorization code from OIDC provider
statestringState parameter for CSRF protection

Behavior:

  1. Validates state parameter
  2. Exchanges code for tokens
  3. Redirects to return URL with token in hash fragment: [return_url]#token=[id_token]

GET /auth/logout

Clear authentication state.

Behavior:

  • Clears any server-side session state
  • Client should clear localStorage token

Alternative API Paths

All /run/* endpoints are also available under /api/run/*:

StandardAlternative
GET /run/:envGET /api/run/:env
GET /run/:env/statusGET /api/run/:env/status
POST /run/:env/extendPOST /api/run/:env/extend
DELETE /run/:envDELETE /api/run/:env

Timestamps

All timestamps are in ISO 8601 format with timezone:

2024-01-15T16:00:00Z

The Web UI and clients should parse these appropriately for display.