API Reference

Complete reference for CmdVault's WordPress REST API endpoints.

Base URL: https://cmdvault.shjrh.cloud/wp-json/cmdvault/v1

Authentication POST /auth

Returns a Bearer token for use in all protected requests. Token is valid for 30 days.

POST https://cmdvault.shjrh.cloud/wp-json/cmdvault/v1/auth
{
  "username": "your-wp-username",
  "password": "your-application-password"
    }
Response
{
  "success": true,
  "token": "cvt_...",
  "display_name": "Admin",
  "auth_mode": "app_password",
  "expires_at": 1234567890
    }

Recommendation: Use WordPress Application Passwords for improved security. Generate one at Users → Your Profile → Application Passwords.

Get Commands GET /commands

Returns all saved commands for the authenticated user.

Authorization: Bearer cvt_...

Save Commands POST /commands

Replaces the user's entire saved state with the submitted data. The tool sends the full vault on every save.

{
  "commands":   [ { "id": "cmd_...", "title": "...", "command": "..." } ],
  "categories": [ { "id": "cat_...", "name": "...", "color": "#00e5ff" } ],
  "folders":    [ { "id": "fld_...", "name": "..." } ],
  "settings":   { "language": "en", "storageType": "wordpress" }
    }

Connection Status GET /status

Validates the token and returns the current user's display information. Useful for connection health checks.

{
  "success": true,
  "connected": true,
  "display_name": "Admin",
  "user_id": 1
    }

Data Structure

Each command object in the commands array contains:

FieldTypeDescription
idstringAuto-generated unique ID (cmd_…)
titlestringDisplay name for the command
commandstringThe actual command text
descriptionstringOptional notes or description
categorystringCategory ID reference
tagsstring[]Array of tag strings
folderstringFolder ID reference
pinnedbooleanWhether pinned to top
keybindstringKeyboard shortcut (e.g. Ctrl+Shift+D)
createdAtISO8601Creation timestamp
updatedAtISO8601Last update timestamp

Error Codes

CodeMeaning
400Bad Request — missing or malformed body / parameters
401Unauthorised — invalid, expired, or missing token
500Internal Server Error