Skip to content

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 ​

KindRequired fieldsNotes
username_passwordusername, password
ssh_pemprivate_keyOptional username. Private key is also materialized to SSH_KEY_FILE / PRIVATE_KEY_FILE when used in commands.
tokentoken
generic_secretsecret
other≥1 custom fieldsField names must be non-blank (alphanumeric + underscore preferred).

Cloud ​

KindRequired fieldsOptional
awsaccess_key_id, secret_access_keysession_token, region
gcpservice_account_jsonproject_id — JSON is materialized to GOOGLE_APPLICATION_CREDENTIALS / GCP_CREDENTIALS_FILE
azuretenant_id, client_id, client_secretsubscription_id
digitaloceantoken
cloudflareapi_tokenaccount_id, email
verceltoken
herokuapi_key

Code management ​

KindRequired fieldsOptional
githubtokenusername
gitlabtokenusername, host
bitbucketusername, app_passwordworkspace
azure_devopstokenorganization
docker_hubusername, 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/:uuid
  • PATCH /api/v1/credentials/:uuid (optional fields or secret to 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_allowlist
PATCH /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):

ActionCanonicalAlias (Go agent)
Claim pending jobsGET /api/v1/server_command_jobs/pending?motherboard_id=…GET /api/v1/server_commands/pending?motherboard_id=…
Report resultPOST /api/v1/server_command_jobs/:uuid/resultPOST /api/v1/server_commands/:uuid/result

Result body: { stdout, stderr, exit_code } (secrets scrubbed server-side).