AI AdminPanel Documentation

Services API

These routes use /api/v1. Platform administrators manage panel-wide services; constrained administrators are limited by each route's authorization, permission and customer-ownership checks. customerId assigns a service to a customer and does not grant the caller access to that customer. Customers use the portal surface instead. Examples use synthetic UUIDs and securely supplied PANEL_API_KEY environment variables.

Connection metadata (read-only)

GET /api/v1/services/{id}/connection

Authorized callers with services.view can read a service's addressing metadata. Tenant access matches the customer and ownership generation authorized for the request, and the server checks that identity again before returning. Reassignment, including a move back to the original customer, hides an in-flight stale read with 404. Platform administrators can read every service.

{
  "internal": [{
    "host": "app-ab12-postgresql", "port": 5432,
    "scheme": "postgres", "user": "postgres", "database": "shop",
    "passwordRef": "PASSWORD_DB"
  }],
  "public": [
    { "url": "https://app.example.invalid" },
    { "url": "https://app-api.example.invalid" }
  ],
  "internalState": "known"
}

A successful response includes internal, public and internalState. The address arrays may be empty. Each internal entry includes host and port; each public entry includes url. scheme, user, database, passwordRef and databaseUnavailable are optional metadata. The generated schemas and TypeScript models describe the same field-presence contract as the JSON response.

internalState is known when internal addressing metadata was verified, not_shared when the service has no assigned customer, or unavailable when the runtime evidence cannot establish a safe address. A service without a customer has an empty internal array. Metadata describes observed or configured addressing; it does not test whether the endpoint accepts a connection.

An internal host requires the actual managed container, customer network and scoped alias to match. Ports stay with their own containers: Ghost's web port 2368 does not become its database port, and MySQL's auxiliary port 33060 does not receive the MySQL connection fields for 3306. PostgreSQL/MySQL class fields apply only to their matching declared database container. Unclassified Redis/MongoDB endpoints carry host and port only.

A current non-sensitive POSTGRES_DB or MYSQL_DATABASE value supplies the configured database name. An absent or empty value uses the template's declared fallback, if any. A sensitive, unreadable or unusable selected value omits database and adds databaseUnavailable: true; it never falls back to an admin database after a read failure. Verified non-secret addressing can remain available.

passwordRef is a symbolic template key, never a password or permission to reveal one. Existing credential reveal permissions, audit and toolkit behavior apply. The new endpoint provides no password values or environment collection.

public includes all active/verified primary and named-route domain addresses. These are external addresses; existing sign-on and private-route gates still apply. The response never releases a route or asserts that it is anonymously accessible.

The platform MCP tool get_service_connection returns the same DTO. The Go SDK provides GetServicesByIdConnection; the TypeScript SDK provides ServicesService.getServicesConnection. The connection-details UI is a separate Service C8 slice.

Live service updates

Container logs and deployment progress require services.view_logs on the organization that owns the service. Service status and metrics require services.view. The server checks current access before sending each WebSocket data frame, including frames already queued. Moving a service to another owner or removing the viewer's permission stops that subscription; other permitted streams continue. If the permission lookup fails, the affected stream is withheld. Reload the page to subscribe again after access is restored. A subscribe refused at the start gets one forbidden error frame on the system channel; see WebSocket.

Service metrics history

GET /api/v1/services/{id}/metrics?range=1h|6h|24h

Requires services.view and access to the service. For a constrained caller, the server reads container IDs only for the customer and ownership generation authorized by the service gate. It checks the same identity again after preparing the response. If the service moves, changes ownership generation or is deleted during the request, the whole response is withheld with 404 resource not found; a new request must pass current access checks. A database failure returns a generic server error without partial metric data. Platform access retains its existing behavior. This does not define a combined multi-container metric series.

Right now and the Metrics drawer use the same chosen current container. For several containers, choose one explicitly; the panel does not add their percentages. If that chosen container disappears, choose again even when only one container remains. A service change clears the choice.

CPU at 100% means one logical core; a container using two cores can show 200%. Memory uses the raw usage and positive container limit from the same observation, with both byte values shown. Missing or stale current values are dashes, while an observed zero stays zero. Missing historical channels leave gaps. Network charts show cumulative received and sent bytes, not transfer rates. The selected container shows its observed history interval, incomplete-history warning when reported, and whether the latest observation came from the stream or sampler.

List Services

GET /api/v1/services

ParameterMeaning
pagePage number, default 1
pageSizeDefault 20; values outside 1–100 fall back to 20
statusOptional status filter
searchOptional service-name search
curl 'https://panel.example.com/api/v1/services?page=1&pageSize=20&status=running' \
  -H "Authorization: Bearer ${PANEL_API_KEY}"

The result is data plus pagination containing page, pageSize, total, and totalPages. The bundled Ollama infrastructure row is hidden from this list and is not counted in total or totalPages, so both are the same on every page. The handler does not implement customer, sort, or order query filters.

Service rows include id, name, description, status, deploymentType, containerIds, networkId, portMappings, templateName, customerId, resourceLimits (cpuCores, memoryMB, diskMB), createdAt, and updatedAt. The direct url is resolved from the primary active/verified domain and can be null. startedAt and uptimeSeconds can also be null. These fields use camelCase; metrics are fetched separately.

A Git-deployed service (deploymentType git) also carries gitSource: the repoUrl, branch and buildMethod it is rebuilt from, and hasDeployKey. The deploy key itself is never returned. An empty repoUrl means the service has no stored repository; see Git source.

GET /api/v1/services/{id} (not the list) adds two fields that describe the caller, for user interfaces: canEdit (the caller may change the Git source) and redeployRebuilds (the caller's Redeploy clones and builds; otherwise it recreates from the last built image). They are hints; the server decides on the request itself.

Each row also carries networkIsolation, an object with state and reason:

statereasonMeaning
isolatednullEvery container of the service is on its customer's own network only
not_isolatedlegacy_shared_networkA container is still on a network shared with other customers; redeploy the service
not_isolateduntrusted_routing_labelsA container carries proxy routing labels its image defined; fix the image, then redeploy
not_isolatedplatform_forwarding_enabledThe proxy, the AI gateway or the bundled Ollama is attached to the service's network without packet forwarding switched off; apply the update, or Apply again, under Settings → Updates (a redeploy is refused until then). GET /api/v1/system/update-status reports reapplyAvailable: true when no newer release exists and POST /api/v1/system/update/apply would request the running version again
unknownnullThe service has no containers, or the panel has no check newer than two minutes

The panel refreshes this every 30 seconds from Docker. Treat unknown as not proven, never as isolated.

GET /api/v1/system/network-isolation

Platform administrators only; other callers receive 404. Returns the host-wide counts behind the dashboard banner:

{ "notIsolated": 2, "unknown": 1, "total": 14, "checkedAt": "2026-10-03T12:00:00Z",
  "unpinnedPlatforms": ["aiadminpanel_traefik"] }

checkedAt is null until the first check has run.

unpinnedPlatforms names the platform containers (reverse proxy, AI gateway, bundled Ollama) that run without packet forwarding switched off. The panel does not attach such a container to a customer network, so deploys that need it are refused until the panel update has recreated it. It is [] when the last check found none, and also while there is no fresh check, when every service reads unknown.

Get Service

GET /api/v1/services/{id}

Use the service UUID returned by creation or listing. The response is one service object, with the same serializer as the list. It does not return decrypted Compose source or a nested live-metrics object.

Create and Deploy Service

Deployment requests are asynchronous. 202 Accepted means a job was queued, not that the application is ready. Check the service and deployment history for the outcome before opening the application.

Every creation route below (Compose, Git, template) refuses with 400 validation_failed a name that is not 3 to 63 characters of lowercase letters, digits and hyphens starting with a letter, and a name reserved for the platform: auth, ai, www, api, admin, panel, login, sso, keycloak, id, traefik, docs, status, mail, or any name that would produce a hostname the installation's panel, login server or AI gateway answers on. The message is the name "auth" is reserved for the platform; choose another name. Nothing is created. See reserved names.

Compose Deploy

POST /api/v1/services

Required fields are name and composeYaml. Optional fields are description, customerId, and resourceLimits (cpuCores, memoryMB, diskMB, the same names service rows return; the older spelling memoryMb/diskMb is still accepted). Review the Compose definition and image before deployment; this example is a payload shape, not a production configuration.

With a customerId, a new service for a customer whose plan has no free service place left is refused with 403 service_limit_reached and nothing is created (see Service Plans). The same applies to customer_id on POST /api/v1/services/git.

curl -X POST https://panel.example.com/api/v1/services \
  -H "Authorization: Bearer ${PANEL_API_KEY}" \
  -H 'Content-Type: application/json' \
  -d '{"name":"example-web","composeYaml":"services:\n  web:\n    image: nginx:alpine\n"}'

Typical successful response:

{
  "serviceId": "10000000-0000-4000-8000-000000000001",
  "deploymentId": "20000000-0000-4000-8000-000000000002",
  "status": "pending"
}

Git Deploy

POST /api/v1/services/git

Required: name, git_repo_url. Optional: description, git_branch (default: the repository's own default branch, see below), build_method (auto, dockerfile, railpack; default auto; nixpacks is refused since Railpack replaced it), port (default 8080), env, customer_id, resource_limits, start_command, dockerfile_path, build_context, build_target, compose_ignore_env_files, compose_services and deploy_key. start_command (one line, at most 1024 characters) replaces the start command Railpack detects, for example node src/index.js; Dockerfile and Compose builds ignore it. dockerfile_path and build_context (relative to the repository root, at most 255 characters, no ..) and build_target (a stage name such as release) shape a Dockerfile build: for example docker/dockerfile with stage release for louislam/uptime-kuma. A dockerfile_path builds with that file even when the repository has a Compose file. The field names here differ from Compose creation. compose_ignore_env_files (boolean) and compose_services (array of names) are the fixes the repository check offers for a repository's Compose file (AI-2561): the first removes every env_file before the file is read, so the services get the service's env instead; the second runs only the named services and what they depend on. A name is 1–63 letters, digits, ., _ or - and starts with a letter or digit (no path, no ..); at most 64 names. Every build checks the names against the repository's Compose file and stops with an error naming a missing one. Both are stored with the service and apply to every rebuild; they are returned as composeIgnoreEnvFiles and composeServices in gitSource. Supply private-repository access through an approved secret workflow; never copy a deploy key into a shared example.

The repository URL, branch and build method are stored with the service, and a push webhook and Redeploy rebuild from them. The deploy key is stored encrypted and is not returned by any route. The request is refused with 400 when:

  • git_repo_url is not https://, http://, ssh:// or user@host:path, resolves to a private, loopback, link-local, carrier-grade NAT or reserved address, starts with -, or contains whitespace;
  • an https:// or http:// URL carries a username or password (https://token@host/...), a query (?access_token=...) or a fragment. A URL is stored and shown as it is, so credentials do not belong in it;
  • git_branch is not a plain branch or tag name (for example, it starts with - or contains a space, .., ~, ^, :, ?, *, [ or \);
  • build_method is not one of the three values above. (compose is also accepted, for catalog templates: it is stored as auto, which picks a repository's Compose file first.)
  • git_branch is empty and the repository's default branch cannot be read (a private repository, an unreachable host): the message is "We could not read this repository's default branch; enter a branch". The panel no longer guesses main, which failed for every repository whose default branch is master;
  • env breaks one of its rules (next section).

Default branch. Leave git_branch out (or empty) and the panel reads the repository's default branch the same way GET /api/v1/git/refs does, with the same public-host check, and stores and builds that branch. gitBranch in the response says which branch it is.

Environment variables. env is an object of name → string value, for example {"NODE_ENV": "production", "DATABASE_URL": "postgres://..."}:

  • at most 50 variables; names match ^[A-Z][A-Z0-9_]{0,63}$; values are at most 8 KiB and contain no NUL byte;
  • PORT and names starting with AAP_, PANEL_ or LITELLM_ are refused: the panel sets those itself. Use the port field for the app's port;
  • the values are stored encrypted with the service, marked sensitive (masked in the service's environment editor, which can unmark them), before the build is queued. They are never returned, logged, written to the audit log or put into the build job; the response lists envNames only.

The service, its first deployment and its variables are written in one database transaction, and the build is queued only after it: a failure leaves no service behind, and a build never starts without the variables it was given. The create is written to the audit log as service.git_created (the variable names, never their values).

curl -X POST https://panel.example.com/api/v1/services/git \
  -H "Authorization: Bearer ${PANEL_API_KEY}" \
  -H 'Content-Type: application/json' \
  -d '{"name":"example-git","git_repo_url":"https://github.com/your-org/your-app.git","build_method":"auto","port":8080,"env":{"NODE_ENV":"production"}}'

Replace the repository placeholder with a real supported public Git remote. A successful request returns 202 with serviceId, deploymentId, status, gitBranch (the branch being built) and envNames:

{"serviceId":"…","deploymentId":"…","status":"pending","gitBranch":"master","envNames":["NODE_ENV"]}

Over MCP, deploy_git does the same (see MCP server).

Template Deploy

Call POST /api/v1/templates/{id}/deploy with the catalog record's UUID, name, and variable values. See Templates API. The template slug is not the route identifier.

Change a subdomain

PUT /api/v1/services/{id}/domains/{domainId}/subdomain

Body: {"subdomain": "new-name"}. Platform administrators only, with the services.manage_domain permission; a role without it, or an API key whose deny list names it, gets 404 and nothing changes. The value must be one DNS label (lowercase letters, digits and hyphens, starting and ending with a letter or digit) and must not be a reserved name; otherwise the request is refused with 400 validation_failed before the domain is changed or a container is touched. 409 means another service holds the subdomain. On success the service's container is replaced so the proxy routes the new hostname.

A service with several addresses cannot be renamed yet: renaming its main address or one of its second addresses is refused with 400 validation_failed, and nothing is changed.

Add a custom domain

POST /api/v1/services/{id}/domains

Body: {"custom_domain": "app.example.com"}. Platform administrators only, with the services.manage_domain permission, the same one DELETE /api/v1/services/{id}/domains/{domainId} checks. A role without it, or an API key whose deny list names it, gets 404 and no domain is added. The domain starts as pending until its DNS points at the panel.

GET /api/v1/services/{id}/domains lists the main address first, then the second addresses in template order, then custom domains. Each item carries routeName ("" for the main address), routeGate ("locked", "released", "always", or null for the main address, which follows ownerGate) and private (whether a browser needs panel sign-on to open it).

Optional Git repository analysis

Start with POST /api/v1/analyze/github, sending repo_url, optional branch, and optional commit_sha. It uses global Panel AI (including keyless Ollama), or global Provider AI only when Panel AI is genuinely unconfigured. Repository validation is enforced even with an explicit commit; shared MCP/chat admission and old queued jobs apply the same supported-public Git policy. Configured provider errors do not switch keys; customer BYOK is not used. Without branch the repository's default branch is analysed; when it cannot be read the request is refused with 400 and "enter a branch". A newly queued analysis returns 202 with analysis_id, status, and a WebSocket channel; a completed cached analysis can return 200 directly. Poll GET /api/v1/analyze/{id} for the result.

Analysis is not deployment. Review the generated configuration, then submit the appropriate Compose or Git request. The single Git form uses optional analysis to suggest editable build settings, port, resources and env; it submits the Git endpoint. Generated YAML is advisory. Optional suggested_services contains server-validated Compose service names, or is absent for older/unvalidated results. There is no single service-creation field that selects every deploy method. Provider failures return safe category/status text, without upstream response bodies or transport URLs.

Lifecycle Actions

Each route takes a service UUID:

ActionEndpointSuccess
StartPOST /api/v1/services/{id}/start202
StopPOST /api/v1/services/{id}/stop202
RestartPOST /api/v1/services/{id}/restart202
RedeployPOST /api/v1/services/{id}/redeploy202
Roll backPOST /api/v1/services/{id}/rollback202 (see Roll back)
SuspendPOST /api/v1/services/{id}/suspend202
UnsuspendPOST /api/v1/services/{id}/unsuspend202

These responses acknowledge scheduling. For a Compose or catalog service, Redeploy queues the deploy worker with a forced image pull. Inspect the resulting deployment rather than treating the HTTP response as completion.

Containers of a service

A Compose app runs one container per Compose service. These routes list them and restart one of them; the other containers keep running.

ActionEndpointPermissionSuccess
List containersGET /api/v1/services/{id}/containersservices.view200
Restart one containerPOST /api/v1/services/{id}/containers/{containerId}/restartservices.start_stop202

Each entry of containers names the Compose service (name, from the container's Compose label or from Docker's <project>_<service>_1 name), and carries containerId, containerName, status (running, restarting, exited, paused, created, dead, or missing when Docker no longer knows the container), health (healthy, unhealthy, starting, or empty without a health check), image, restartCount, startedAt, the exposed ports, and routed (the container that carries the service's main address).

{ "containers": [
  { "containerId": "4f1c…", "name": "vote", "containerName": "voting-app_vote_1", "status": "running", "health": "healthy",
    "image": "dockersamples/vote:latest", "restartCount": 0, "startedAt": "2026-11-10T09:12:44Z", "ports": [80], "routed": true }
] }

{containerId} is the full container ID, an ID prefix of at least 12 characters, or the Compose service name. A container that is not one of this service's own answers 404, the same as an unknown one, and nothing restarts. The worker checks again, by the container's service label, before it restarts anything.

To open the browser terminal in one container, send {"container_id": "<id or 12+ character prefix>"} in the body of POST /api/v1/services/{id}/terminal. Without a body the terminal opens in the first container, as before. A container of another service answers 404.

Live log lines on the logs:{serviceId} WebSocket channel carry container_id next to the container name, so a client can show one container's lines.

After a Stop (or a Suspend, which stops the service the same way) the service status stays stopped, even though its containers usually exit with code 143 or 137 when they are stopped. The panel remembers that the stop was asked for. A container that exits while the service is meant to run is reported as error. A service is meant to run after Start, Restart, a deploy, a backup restore, a move to another customer, publishing or a secret rotation, since each of these starts its containers, and after a Stop that failed.

For a Git-deployed service, Redeploy depends on the caller, and the response names what was scheduled:

{ "serviceId": "10000000-0000-4000-8000-000000000001", "mode": "rebuild", "queued": true, "message": "Rebuild scheduled: the repository is cloned and built again" }
modeCallerWhat is queued
rebuildA platform operator (session or API key)The repository and branch stored when the job starts are cloned and built again, and the containers replaced
recreateAny other caller who may redeploy the service (a reseller, an organization admin, a key bound to their organization)The container is replaced by one from the image of the last build. Nothing is cloned or built

queued is false when a rebuild or recreate of the service was already waiting; the request is covered by it and no second job is added. The response of a Git service has no deploymentId: the deployment record is created when the job starts, so list the service's deployments to follow it.

A platform operator's Redeploy of a Git service that has no stored repository returns 409 with the error code git_source_missing and queues nothing. Set the Git source first. A recreate needs no stored repository; it fails in the job, with the reason in the deployment history, when the image of the last build is no longer on the host.

Roll back

POST /api/v1/services/{id}/rollback

Deploys the service again from a saved version (a snapshot). The panel saves one each time a deploy succeeds; Roll Back a Service explains what it holds. It needs services.deploy, like Redeploy. The route no longer stops or removes containers by itself.

The body is optional:

{ "snapshotId": "20000000-0000-4000-8000-000000000002" }

Without it the service goes back to the version before the one running now. When the service's newest deployment failed or has not finished, nothing counts as running now, and the service goes back to the version that deployment replaced.

{ "message": "Rollback scheduled", "serviceId": "10000000-0000-4000-8000-000000000001", "deploymentId": "30000000-0000-4000-8000-000000000003", "snapshotId": "20000000-0000-4000-8000-000000000002", "mode": "redeploy" }

mode is redeploy for a Compose or catalog service and recreate for a Git service (the container is created from the image the snapshot recorded; nothing is cloned or built). The job pulls the snapshot's images by digest and checks them before it changes anything; a pull that fails leaves the service on its current version and the deployment failed. The job also refuses, before it pulls, a snapshot whose resource limits are above what the customer's plan allows now; the deployment is failed with that reason.

Refusals change nothing:

StatusCodeWhen
404not_foundThe service is not one the caller may manage, or the snapshot is not one of this service's, or was saved for a previous owner
409no_previous_snapshotNo body, and there is no earlier version
409snapshot_is_currentThe chosen version is the one running now
409snapshot_not_rollbackableA Git service built from a Compose file in its repository
409snapshot_image_releasedThe image of that version is no longer on the server
409snapshot_has_legacy_secretsThe version held the app's passwords as plain text, and they are in the vault now
409operation_runningAnother operation holds the service, or the same rollback is already queued

GET /api/v1/services/{id}/snapshots

Needs services.view. Lists the saved versions, newest first, with defaultTargetId (the version a rollback without a body goes back to) and pinnedSnapshotId (the version a rollback pinned the service to, until a Redeploy). Each entry has id, createdAt, origin (deploy or baseline), deploymentId, images (service, ref, digest, imageId), envSensitiveKeys (names only), domains, resourceLimits, isCurrent, canRollBack and blockedReason (one of the 409 codes above, or previous_owner). A platform caller also sees versions saved for the service's previous owners. GET /api/v1/services/{id}/snapshots/{snapshotId} returns one entry.

Make a private service public

POST /api/v1/services/{id}/publish

Every new service starts private (from templates, Compose and Git, including optional AI checks): the proxy lets in only a browser that is signed in to the panel. This route removes that lock. It needs the services.manage permission on the service's customer. See App Access.

{ "confirmed": true }

confirmed is the owner's statement that the app's admin account is under their control (the default password was changed, or the admin account was created). The panel cannot check it inside the app; without true the request is refused.

StatusMeaning
202The service is marked public and a job is queued. The job recreates the containers without the lock, so the app restarts once. Environment, volumes and address are kept. A Git-built service is recreated from the image of its last build; nothing is cloned or built
400confirmed is missing or not true
404The service does not exist, or the caller may not manage it
409The service is not private (it never was, or it is already public), or it is not running ("start the app first"), or it is a Git-built service with several containers and the caller is not a platform operator: such a service is made public by building it again, which only the platform may start. For a platform operator that build is the queued job (git_source_missing when no repository is stored)
500The job could not be queued. The service is still private

The gate change and the job are written together, so a 500 leaves nothing half done. If the job later fails before it has stopped a container, the service is private again and the call can be repeated. If it fails after that, the service shows error and stays marked public: a Redeploy brings it up public.

Customers use POST /api/v1/portal/services/{id}/publish with the same body. It acts only on a service of the caller's own customer and returns 404 for any other.

To make one second address of an app public, name it: { "confirmed": true, "route": "ui" }. Without route (or with "") the main address is published, as above. For a named route: 404 when the service has no address of that name, 409 when that address is always private ("this address is always private") or not private, and 409 when the app is not running. Only that address's lock changes; the app restarts once.

The portal's service response carries routes for an app with several addresses: [{ "name": "", "url": "https://…", "private": true, "canPublish": false }, …], the main address first (url stays the main address). canPublish is true for a private second address that can be made public.

The service object (list, get and the portal's service response) carries the state:

FieldValues
ownerGate"locked" while the service is private, "released" once it was made public, "" for a service created before every service started private
ownerGateReasonWhy it started private: the template's firstRun ("default-password" or "first-visitor-admin"), otherwise "private-by-default". Kept after the service is made public

AI source

The service object from list and get also carries aiSource: where the app gets its AI model, as chosen at deploy. "provider_ai" is the panel's AI provider, "local_ai" the bundled Local AI, "byo" a key of the app's own, and "none" deployed without AI. "" is the automatic choice, which is also what an app that gets no AI from the panel carries.

Git source

PUT /api/v1/services/{id}/git-source

Replaces what a Git-deployed service is rebuilt from. Platform operators only (permission services.manage); any other caller, and any service that is not Git-deployed, gets 404.

FieldMeaning
git_repo_urlRequired. Same rules as POST /api/v1/services/git
git_branchBranch or tag; default: the repository's default branch, refused with "enter a branch" when it cannot be read
build_methodauto, dockerfile or railpack; default auto. Automatic detection picks a Compose file, then a Dockerfile (Dockerfile, dockerfile, docker/Dockerfile, docker/dockerfile), then Railpack. nixpacks is refused with 400 validation_failed
deploy_keyLeave the field out to keep the stored key. Send "" to remove it. Any other value replaces it
start_commandRailpack start command. Leave the field out to keep the stored one. Send "" to let Railpack choose again. Any other value (one line, at most 1024 characters) replaces it
dockerfile_path, build_context, build_targetDockerfile build settings, each on its own: leave a field out to keep the stored value, send "" to go back to the default (a detected Dockerfile, the repository root, the last stage)
compose_ignore_env_files, compose_servicesFixes for the repository's Compose file (see POST /api/v1/services/git), each on its own: leave a field out to keep the stored choice; false reads env_file again; [] runs every service
curl -X PUT "https://panel.example.com/api/v1/services/${SERVICE_ID}/git-source" \
  -H "Authorization: Bearer ${PANEL_API_KEY}" \
  -H 'Content-Type: application/json' \
  -d '{"git_repo_url":"https://github.com/your-org/your-app.git","git_branch":"main","build_method":"auto"}'

The response is the stored source: repoUrl, branch, buildMethod and hasDeployKey. Nothing is deployed by this call; use Redeploy afterwards. The change is written to the audit log as service.git_source_updated.

A redeploy that fails before it touches the containers (validation, quota, image pull, image-label check) leaves the service running on its previous configuration: the service status returns to running and the deployment is recorded as failed with the reason. The service page shows "The last redeploy failed" in that case. Such a failure does not block the next operation. A failure after the old containers were removed sets the service to error and keeps the service locked until it is reconciled; see Rotate a secret.

Resource limits

PUT /api/v1/services/{id}/resource-limits

Changes the CPU, memory and disk limits of a service. Platform operators only (permission services.manage). An unknown service gets 404.

The limits are stored, then CPU and memory are changed on every existing container of the service in place, without a restart. A disk limit cannot change on a running container and applies at the next redeploy.

FieldMeaning
cpuCoresMore than 0, at most 128
memoryMBAt least 32
diskMB0 or more; 0 means no disk limit

The older spelling memoryMb/diskMb is still accepted. Each field is optional: a field you leave out keeps its stored value. The service's GPU reservation is never changed by this call. The response has two parts:

  • resourceLimits: the full stored object (cpuCores, memoryMB, diskMB, and gpus when set).
  • liveApply: what the change did to the running service.
liveApply fieldMeaning
livetrue when every container of the service now has the new CPU and memory limits
containersHow many containers took the new limits
redeployNeededThe saved limits the running service does not have yet: "disk" when the disk limit changed; "cpu" and "memory" too when the live change failed, or for a service with no container yet. They apply at the next redeploy. [] means nothing waits
errorWhy Docker refused the live change, for example memory below what the app uses now. The limits stay stored. The status is still 200
{
  "resourceLimits": {"cpuCores": 2, "memoryMB": 3072, "diskMB": 0},
  "liveApply": {"live": true, "containers": 2, "redeployNeeded": []}
}

Every container also has a process limit (4096 processes and threads, or the Compose file's own pids_limit, see Validation limits). It is not one of these fields and applies whether or not CPU and memory limits are set.

curl -X PUT "https://panel.example.com/api/v1/services/${SERVICE_ID}/resource-limits" \
  -H "Authorization: Bearer ${PANEL_API_KEY}" \
  -H 'Content-Type: application/json' \
  -d '{"memoryMB":2048}'

Assign a Service to a Customer

PUT /api/v1/services/{id}/customer with {"customerId": "<customer UUID>"} moves a service to another customer. It needs services.manage on the service and on the destination customer. The move itself runs as a background job: the service's secrets are copied into the destination customer's vault space and its containers are recreated on that customer's network.

A move to another customer removes the service's deploy webhook in the same step that switches the owner, and records webhook.deleted (reason service_moved_to_another_customer) in both customers' audit logs. The previous customer held its URL and signing secret, so a delivery signed with them now gets 404. The new customer creates a new webhook, with a new secret, if it wants one. A move within the same customer keeps the webhook (AI-2603).

StatusMeaning
202The move is queued (status: "reassigning"). The job acts only while the service still has the owner it had when the request was accepted; a job for an owner that has changed since is cancelled and changes nothing
403 service_limit_reachedThe destination customer's plan has no free service place: for them the moved service is a new one. Nothing was queued. Remove one of their services or move them to a larger plan, then assign again. Moving a service within the same customer is never refused for this (AI-1452)
403 template_not_in_planThe service's template is not offered by the destination customer's plan, or that customer has no active plan. Nothing was queued and the service stays where it was. Add an exception to the plan or move the customer to a plan that offers the template, then assign again. Moving a service within the same customer is never refused for this (AI-1949)
409 reassign_blockedThe service uses a secret the destination customer does not have, for example its own AI provider key (ai/customer_ai) or a secret of another service that stays with the current customer. The message names each missing secret by path, never its value. Nothing was queued or changed. Create the secret for the destination customer, or remove the reference from the service, then assign again
409 operation_unfinishedAnother operation on the service is still running, or failed and awaits an operator (see the recovery runbook). Nothing was queued
503The secrets the service uses could not be checked (database or vault unreachable). Nothing was queued; try again

The background job repeats the same checks, including the destination's service limit, under the service's lock before it changes anything. If a secret disappeared in between, the job is refused the same way, nothing is changed and the service stays usable (AI-1064).

Once the checks pass, the job copies the secrets, switches the owner, soft-deletes the previous customer's copy and then rebuilds the containers. If it fails after the switch, the service belongs to the new customer and shows status error; an operator clears its operation claim and presses Redeploy to finish. A copy the move left in a customer that does not own the service is soft-deleted by a background sweep about ten minutes later. A move that failed, or was refused by the job, is not retried by itself: assign again to try again.

Delete Service

DELETE /api/v1/services/{id}

Queues removal and returns 202 with status: "removing" and a message. Back up needed data before deleting. The HTTP response is not evidence that every volume, domain, or external DNS record has been purged; confirm the result in the panel. See Backup and restore before removing data.

If an earlier attempt already removed the service's network, a fresh Docker check of that exact network's absence lets cleanup finish. A missing related container does not prove that the network is gone. Other cleanup failures still retain an operation claim for administrator reconciliation; an update does not clear an existing claim automatically.

The built-in Local AI service (aiadminpanel_ollama) is part of the panel and cannot be removed: the request is refused with 409 service_builtin and nothing is queued. Service responses mark it with "builtin": true. The assistant's and the admin MCP server's delete_service tools refuse it the same way.

Service Metrics Summary

GET /api/v1/services/metrics/summary

Optional ids is a comma-separated list of service UUIDs. The summaries object is keyed by service ID, with cpuPct, ramPct, cpuSpark, ramSpark, and available. After a restart, a cold buffer can return available: false, null percentages, and empty sparklines. That is missing history, not proof of a stopped service. Authentication and other request errors can still fail the request.

mode, containerCount and availableContainers distinguish supported single-container values from per-container data. A multi-container service has null aggregate CPU/RAM, empty aggregate sparklines and available: false; its per-container history may still be available. Counts refer to current membership and fresh qualified observations. A single-container first sample can expose valid memory before CPU has a same-generation delta baseline.

The summary includes only entries whose original service, owner generation and complete container membership still match one final database snapshot. A stale or malformed retained capture entry is omitted while valid siblings remain; if no valid entries remain, HTTP 200 contains an empty summaries object. A missing batch capture source fails closed with 404; an unreadable or malformed batch result returns 500. Observations are serialized before this check, so a later lookup cannot relabel an earlier entry. The single-service history endpoint below still withholds its whole response on capture drift.

The default list is bounded to 200 services. For explicit ids, invalid UUIDs are ignored and repeated valid UUIDs count once. At most 200 distinct valid UUIDs may be requested; unknown but well-formed IDs count toward this source-work limit. The 201st distinct valid ID returns 400 validation_failed before another service lookup. This limit does not grant access to unknown or foreign services.

Current-generation container history

GET /api/v1/services/{id}/metrics?range=1h|6h|24h returns containers, one entry per verified current container. Each entry has containerId, required opaque captureId, a short opaque label, points, and coverage. A point keeps its timestamp, CPU availability/value, raw memory usage/limit and availability, cumulative network counters and availability, and producer source (sampler or stream) together. Timestamps retain nanoseconds. A missing CPU baseline or memory denominator is unavailable; a real measured zero remains zero.

cpuUnit is percent_of_one_logical_core: CPU 100 means one fully used logical core and can exceed 100. memoryModel is docker_raw_usage_over_container_limit; this uses Docker API memory fields, without the Docker CLI's Linux cache subtraction. It is not a percentage of the service plan allocation.

mode is single_container or per_container. Legacy top-level cpu, ram and network arrays contain only verified single-container observations. For a multi-container service they are empty even when just one member has samples. Read each qualified series independently; do not pair different containers by array index or add their memory percentages.

coverage.targetHours is 24, with actual retained from/to and truncated. Collection starts cold after process restart. The in-memory store retains at most 5760 observations per series, 512 series and 200000 observations globally, including retired ownership generations. Eviction can shorten the visible window; the target is not a guarantee of complete 24-hour history. After retention or global eviction has removed series, an absent series is conservatively marked truncated: true: its earlier coverage may be incomplete. This flag does not prove that a missing series previously existed. A known retained series keeps its own truncation flag.

Ownership transfer, including A→B→A, does not relabel retained old samples. The new generation remains empty until fresh qualified observations arrive. A transfer, deletion or membership change during history preparation withholds the whole response with 404. A missing capture source also fails closed. Current platform reads still require current capture identity.

The REST captureId and live-frame capture_id identify the same trusted service/container capture. They are 43-character raw-base64url opaque values; clients must match them exactly, never derive authority from them. They expose no raw customer or ownership generation. Missing, malformed or mismatched frame identity is ignored. Capture identity remains stable across nodes and process restarts sharing the configured master key; it does not describe buffer contents.

Every successful REST refresh replaces the browser's live overlay, even when its JSON and capture identity are unchanged. This prevents old live points from filling an authoritative empty history after eviction/restart. Matching current frames can then add fresh observations. Delayed frames from another capture cannot repopulate the new history. This applies to Right now, drawer charts and customer portal charts; selection choices do not authorize data access. Internal forwarding preserves qualified metrics JSON number bytes before sending them to the client; JavaScript clients still have their normal number-precision limits.

Service Logs

Open Logs from the service's Right now card, or use the MCP get_logs tool. The panel's real-time transport is /ws; this release does not register the previously documented REST /services/{id}/logs?follow=true endpoint.

The log drawer retains up to 5,000 observed lines. Search logs filters the local buffer; it does not request remote history. Download logs exports the matching observed lines as plain text. Clear logs clears the local buffer; new output can arrive afterwards. Follow output and Resume auto-scroll control scrolling. Scrolling up pauses following without stopping collection. Metrics opens the existing charts in the same drawer. Closing a panel keeps unrelated query parameters and backup-row anchors; Back and Forward replay the selected panel.

Metrics range buttons stay available while new observations load, so keyboard focus remains in the drawer. Loading charts do not display the previous range's measurements.

While the view remains open, current container membership refreshes every 30 seconds and after reconnection. A new stream ID alone does not establish a current container. If the chosen container disappears, choose a current member explicitly; the view does not silently substitute another container.

Service Events

GET /api/v1/services/{id}/deployments returns deployment history as data with pagination: {page, pageSize}. Entries include id, serviceId, status, trigger, errorMessage, hasLog, and timestamps. This is deployment history, not a registered /services/{id}/events timeline endpoint.

On the service page, History combines observed deployments, saved versions, completed backups and service creation. All, Problems, Deploys and Backups filter these observations. Deployment ordering uses createdAt; start and completion times remain separate details. The UI requests page 1 with 20 deployments and at most one older page per service view. Show older first reveals loaded records. A short deployment page establishes the observed end; a full page means older deployments may exist. The two-page cap is labelled as a limited recent window. Separately observed records outside known deployment coverage appear in Other observed activity, rather than being presented as a complete chronology. The endpoint supplies no total or hasMore value.

Service page controls and drawers

The page has two layouts. At 992 px and wider, the history is on the left and a sticky Summary rail is on the right. The rail is never taller than the window and scrolls inside itself if needed. Its rows are Address (with a copy button), Access (Private · panel sign-in, or Public), Health now (current CPU and RAM with "updated N minutes ago"; a dash when no measurement is under two minutes old), Logs, Last backup, the agent, source or app setup, Configuration (variable count and size) and a Danger zone link. Below 992 px a sticky strip shows the status dot, the address with copy, Private or Public, CPU and RAM, and the one gold action. Under it, a row of buttons opens the same drawers; below 768 px that row becomes a bottom tab bar.

Each rail row and dock button opens one drawer, addressed by ?panel=connection|credentials|setup|config|danger|logs|metrics|terminal|backups|env|size|domains or ?panel=log:<deploymentId>:

PanelContains
connectionAddress and access, every address with its lock, Domains…, admin and API endpoints, connection details for other apps, sign-in details link, Git summary
credentialsThe generated sign-in details (apps whose toolkit shows them do so in setup)
setupRedeploy when no successful deploy is retained, template notes or toolkit, OpenClaw cards, Git source and auto-deploy webhook
configVariable count with Edit environment…, size with Change size…, customer assignment, collapsed technical details (IDs and timestamps)
dangerStop and Remove service… (typed confirmation; not offered for the built-in Local AI)
metricsCurrent CPU/RAM, size, disk and uptime above the charts

Opening and closing preserves unrelated query parameters, saved navigation state and hash anchors. Older ?tab=backups links open backup management; settings and environment open env, resources opens size, and domains opens domains. History and overview links land on the page. An explicit valid panel takes precedence over the older tab value. A captured-log link carrying a #backup-... anchor returns to that backup drawer when closed. The environment and size editors enforce their existing management permission; backend route authorization remains authoritative.

Notices sit above the history under Needs attention · N, one line each: an icon, one sentence, one action and Why?, which opens the explanation and a Learn more link in place. The suggested next step is a dashed hint with Review setup, which opens setup (or config when the service has no setup tools); hiding it is remembered for that service in this browser only. The No backup yet notice requires a successfully observed empty backup list; pending or failed entries do not make a list empty. History rows read as one line with the trigger, the duration and a relative time; the exact time is in the element's title.

When the interactive terminal has focus, Escape is sent to the terminal. Use the drawer's Close button to leave it. Other panels also support Escape to close.

The backups drawer lists backups, schedules and the existing recovery controls. Its create action requires platform scope and a confirmed configured storage target: loading, unavailable or incomplete storage status cannot enable capture. These are the existing backup APIs and capabilities; the layout does not grant a new customer capture or restore capability.

Captured deployment output

GET /api/v1/services/{id}/deployments/{deploymentId}/log requires services.view_logs and access to the service. The response is marked Cache-Control: no-store and contains deploymentId, status, errorMessage, lines: [{seq, text}], truncated, and finalized. Sequence values are positive exact JSON integers. The worker redacts before persistence and live publication; the stored document retains at most 2,000 lines and 256 KiB, with each displayed line bounded to 4 KiB. Omitted history is explicit. Logs are retained for the last 20 deployments of a service after a confirmed terminal write.

Output of a removed first deploy

A first deploy that fails before anything started removes its service, and the service's deployments go with it. Its last deployment is kept for 14 days: GET /api/v1/removed-services/{id}/deploy-log (the removed service's ID) returns the same document as the log route above, with deploymentId, status, errorMessage, lines, truncated and finalized, marked Cache-Control: no-store. It requires services.view_logs. A tenant caller must be allowed to manage the customer the service had when the deploy began; a deploy of an unassigned service is readable by platform callers only. Anyone else, an unknown ID and an expired deploy all get the same 404. The worker's last writes may land after the removal: read again while finalized is false.

A terminal status may be committed before its final output flush. Continue reading while finalized is false; only a terminal status with finalized: true confirms that flush. A resumed attempt can become running again. Sequenced live frames on deploy:{serviceId} carry the same deploymentId, seq and text; merge only the selected capture, with stored text authoritative on overlap.

If a stored sensitive value cannot be loaded with its service and row binding, deployment output is withheld for that attempt. Command output, errors, logger attributes and retained transcript text share that restriction. Capture identity, line sequences and final-flush state remain available; execution continues. Loading another value later does not reopen output.

Tenant history and log reads match the captured customer and ownership generation against authenticated current access. A service moved away and later returned does not expose its old capture to that tenant. Platform administrators retain historical access. Unstructured old logs are never returned or assigned an owner from current service data. Unknown, foreign and unavailable captures are hidden.

The service's deployment chapter reads stored output even when opened mid-build. In Story, View log opens that capture in the shared drawer. Its copied address uses ?panel=log:<deploymentId> and preserves the selected tab and other search parameters and #backup-ID anchors. Follow pauses when focused or scrolled up; Refresh reads the server again. This output is separate from the running container's Logs view.