Appearance
Credentials API
Project-scoped credential vault. Secrets are encrypted at rest. API responses never include secret plaintext (except the human-only reveal endpoint).
The assistant and AI tools only receive credential refs (cred:CRD…, names, or @name mentions), never secret values. CredentialBroker#resolve_one strips a leading @ and also matches case-insensitive / slugified names.
Authentication
Authorization: Bearer <project_or_user_token> (same as servers). Prefer project token or user token + X-Project-UUID.
List credentials
GET /api/v1/credentials
json
[
{
"uuid": "CRD...",
"name": "prod-ssh",
"kind": "username_password",
"url": "https://example.com",
"field_names": ["username", "password"],
"ref": "cred:CRD...",
"system": false,
"deletable": true,
"created_at": "...",
"updated_at": "..."
}
]List/show return field_names (keys only) — never field values. There is no env_key or metadata.env_key in the API surface.
System credentials
Every project has a locked Project API Token credential (system: true, deletable: false) that mirrors projects.api_token. Field keys are token and api_token (injected as TOKEN / API_TOKEN). It is created automatically, stays in sync when the project API token is rotated, and cannot be edited or deleted via the credentials API.
Rotate the underlying token with POST /api/v1/users/regenerate_current_project_api_token (admin/owner; user auth).
Create
POST /api/v1/credentials
json
{
"name": "Prod SSH",
"kind": "username_password",
"url": "https://example.com",
"fields": { "username": "alice", "password": "s3cret" }
}Also accepted nested under credential. For backward compatibility, a bare secret string (without fields) is mapped into the kind’s primary field (password, private_key, token, or secret).
Kinds
Prefer GET /api/v1/credentials/kinds for the full schema (labels, categories, required/optional fields) used by dynamic forms.
Basic
| Kind | Required fields | Notes |
|---|---|---|
username_password | username, password | |
ssh_pem | private_key | Optional username. Private key is also materialized to SSH_KEY_FILE / PRIVATE_KEY_FILE when used in commands. |
token | token | |
generic_secret | secret | |
other | ≥1 custom fields | Field names must be non-blank (alphanumeric + underscore preferred). |
Cloud
| Kind | Required fields | Optional |
|---|---|---|
aws | access_key_id, secret_access_key | session_token, region |
gcp | service_account_json | project_id — JSON is materialized to GOOGLE_APPLICATION_CREDENTIALS / GCP_CREDENTIALS_FILE |
azure | tenant_id, client_id, client_secret | subscription_id |
digitalocean | token | |
cloudflare | api_token | account_id, email |
vercel | token | |
heroku | api_key |
Code management
| Kind | Required fields | Optional |
|---|---|---|
github | token | username |
gitlab | token | username, host |
bitbucket | username, app_password | workspace |
azure_devops | token | organization |
docker_hub | username, token |
url is an optional non-secret identifier (website/URL).
Legacy kinds (ssh_password, ssh_key, api_token, generic, database) are accepted and remapped. aws, azure, and github are real kinds and are not remapped.
List kind schemas
GET /api/v1/credentials/kinds
Returns an array of schemas for dynamic forms:
json
[
{
"kind": "aws",
"label": "AWS",
"category": "cloud",
"fields": [
{ "name": "access_key_id", "label": "Access key ID", "required": true },
{ "name": "secret_access_key", "label": "Secret access key", "required": true, "secret": true },
{ "name": "session_token", "label": "Session token", "required": false, "secret": true },
{ "name": "region", "label": "Region", "required": false }
]
}
]Categories: basic, cloud, code, other.
Show / Update / Delete
GET /api/v1/credentials/:uuidPATCH /api/v1/credentials/:uuid(optionalfieldsorsecretto rotate)DELETE /api/v1/credentials/:uuid(soft-delete)
System credentials (system: true) reject PATCH and DELETE with 422 and an error message.
Reveal (humans only)
POST /api/v1/credentials/:uuid/reveal
Returns { uuid, name, kind, url, fields }. Rate-limited. Not registered as an assistant tool.
Env injection
When commands run with credential_refs, each field is injected as an uppercased env var (username → USERNAME). Collisions across credentials in one run are prefixed with the sanitized credential name or CRED_<shortuuid>_.
Command allowlist
GET /api/v1/command_allowlistPATCH /api/v1/command_allowlist
json
{
"allow_all_commands": false,
"command_allowlist": ["uptime", "systemctl", "aws*"]
}All local and remote commands go through CommandAllowlistFilter unless allow_all_commands is true.
Server commands (Go agent)
Auth: project API token via Authorization: Bearer <project_api_token> (same as POST /api/v1/server_metrics). User session auth is skipped; the controller scopes the server by motherboard_id within the authenticated project.
Both path prefixes are equivalent (same ServerCommandJobsController):
| Action | Canonical | Alias (Go agent) |
|---|---|---|
| Claim pending jobs | GET /api/v1/server_command_jobs/pending?motherboard_id=… | GET /api/v1/server_commands/pending?motherboard_id=… |
| Report result | POST /api/v1/server_command_jobs/:uuid/result | POST /api/v1/server_commands/:uuid/result |
Result body: { stdout, stderr, exit_code } (secrets scrubbed server-side).