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"
}
{
"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:
| Field | Type | Description |
|---|---|---|
id | string | Auto-generated unique ID (cmd_…) |
title | string | Display name for the command |
command | string | The actual command text |
description | string | Optional notes or description |
category | string | Category ID reference |
tags | string[] | Array of tag strings |
folder | string | Folder ID reference |
pinned | boolean | Whether pinned to top |
keybind | string | Keyboard shortcut (e.g. Ctrl+Shift+D) |
createdAt | ISO8601 | Creation timestamp |
updatedAt | ISO8601 | Last update timestamp |
Error Codes
| Code | Meaning |
|---|---|
400 | Bad Request — missing or malformed body / parameters |
401 | Unauthorised — invalid, expired, or missing token |
500 | Internal Server Error |