Skip to content

List apps

GET
/api/apps
curl --request GET \
--url https://opfield.example.com/api/apps \
--header 'Authorization: Bearer <token>'

An app groups resources of several types (containers, deployments, Compose projects, routes, domains, databases, storage, Pages, SSL certificates, logging environments) into environments. A new app has one environment, production, marked as Production; exactly one environment holds the marker. Members sit in hidden folders of their own type, so create a resource inside an environment by passing folderId = placementFolderIds[type] of that environment to the normal create endpoint. Visibility: apps:view broadly, on the app (apps:view:) or on one environment (apps:view:env/); members appear by their own view permissions. Without apps:view an app is still visible when the caller can view one of its members (access “members”): only the environments holding such members, only those members, and overview, activity, health and incident items computed from them alone. Domain allowlist: domainPatterns on the app (every environment) and on each environment, joined; both empty allows every name. A pattern is an exact name (api.example.com) or *.example.com (any name under example.com, not example.com itself). Creating or importing a domain, and the hostnames of a route created, edited or imported in an environment, must match the joined list (422 APP_DOMAIN_NOT_ALLOWED). Each app lists the environments the caller may view with their health, plus the Production environment’s health, incident state, CPU and memory of its containers and running/failing/degraded/stopped member counts and open warnings. Environment health (the Apps list and the overview compute it the same way): unknown without members; failing when a member fails; degraded when a member is degraded or a warning is open; else healthy. Every failing member is a destructive alert and every degraded member or warning a warning alert, so the alerts always explain the health. Containers, deployments and Compose projects: stopped on request (through Opfield, the API, MCP or docker stop: exit 0, 130 or 143, or 137 without an OOM kill; a deployment or Compose project stopped through Opfield) is “stopped”, shown but neutral, while something else of the environment runs; when every one of them is stopped the environment is degraded (nothing runs). Crashed (another exit code, OOM-killed, dead, in a restart loop) is failing; running but restarted 3+ times in the last hour is degraded; a Compose project with only some services up is degraded; a health check that has not reported yet is neutral (“starting”). Routes: disabled or in maintenance is neutral, but when no route of the environment is enabled and serving it is degraded; a route whose target member was stopped on request is degraded (“its target is stopped”), not failing; an expired certificate fails the route, one whose renewal failed or that expires within 14 days is degraded. Managed databases and storage stopped or paused are degraded (dependencies). Pages: with a route, degraded unless an enabled route serves an active deployment; without a route, healthy with a ready deployment that has a preview URL, neutral (“not started”) before the first deployment is ready, else degraded. A member whose node has been offline for 60 s is degraded (“node unreachable”). Warnings: a database or storage disk at least 80% full; at least 2% of the routes’ requests over the last 5 minutes failing with 5xx (from 10 requests on).

Successful response

Media typeapplication/json
object
data
required
Array<object>

Resource object. Exact fields depend on the endpoint.

object
id
string
name
string
key
additional properties
Example
{
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Example resource",
"createdAt": "2024-01-01T12:00:00.000Z",
"updatedAt": "2024-01-01T12:30:00.000Z"
}
]
}

Bad request

Media typeapplication/json
object
code
required

Error code

string
message
required

Human-readable error message

string
details

Additional error details

Example
{
"code": "VALIDATION_ERROR",
"message": "Request validation failed",
"details": [
{
"path": [
"name"
],
"message": "Required"
}
]
}

Authentication required

Media typeapplication/json
object
code
required

Error code

string
message
required

Human-readable error message

string
details

Additional error details

Example
{
"code": "UNAUTHORIZED",
"message": "Authentication required"
}

Forbidden

Media typeapplication/json
object
code
required

Error code

string
message
required

Human-readable error message

string
details

Additional error details

Example
{
"code": "FORBIDDEN",
"message": "Insufficient permissions"
}

Not found

Media typeapplication/json
object
code
required

Error code

string
message
required

Human-readable error message

string
details

Additional error details

Example
{
"code": "NOT_FOUND",
"message": "Resource not found"
}

Conflict

Media typeapplication/json
object
code
required

Error code

string
message
required

Human-readable error message

string
details

Additional error details

Example
{
"code": "CONFLICT",
"message": "Resource already exists"
}

Unprocessable entity

Media typeapplication/json
object
code
required

Error code

string
message
required

Human-readable error message

string
details

Additional error details

Example
{
"code": "UNPROCESSABLE_ENTITY",
"message": "Request could not be processed"
}

Internal server error

Media typeapplication/json
object
code
required

Error code

string
message
required

Human-readable error message

string
details

Additional error details

Example
{
"code": "INTERNAL_ERROR",
"message": "Internal server error"
}