TraderMemos
API リファレンス

Admin

GET/api/v1/admin/users

Owner-only; anyone else gets 403.

Authorization

bearerAuth
AuthorizationBearer <token>

Session JWT access token or personal access token (tm_pat_…).

In: header

Response Body

curl -X GET "https://example.com/api/v1/admin/users"
Empty
POST/api/v1/admin/users

Bypasses the registration gate — an owner inviting someone is not open sign-up.

Authorization

bearerAuth
AuthorizationBearer <token>

Session JWT access token or personal access token (tm_pat_…).

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

curl -X POST "https://example.com/api/v1/admin/users" \  -H "Content-Type: application/json" \  -d '{    "email": "string",    "password": "stringstri"  }'
Empty
PATCH/api/v1/admin/users/{id}

Authorization

bearerAuth
AuthorizationBearer <token>

Session JWT access token or personal access token (tm_pat_…).

In: header

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

curl -X PATCH "https://example.com/api/v1/admin/users/string" \  -H "Content-Type: application/json" \  -d '{    "is_admin": true  }'
Empty
DELETE/api/v1/admin/users/{id}

Cascades every account, trade, note and attachment they own. No undo.

Authorization

bearerAuth
AuthorizationBearer <token>

Session JWT access token or personal access token (tm_pat_…).

In: header

Path Parameters

id*string

Response Body

curl -X DELETE "https://example.com/api/v1/admin/users/string"
Empty
POST/api/v1/admin/users/{id}/password

No current password — the point is that the user does not have it. Invalidates their refresh tokens.

Authorization

bearerAuth
AuthorizationBearer <token>

Session JWT access token or personal access token (tm_pat_…).

In: header

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

curl -X POST "https://example.com/api/v1/admin/users/string/password" \  -H "Content-Type: application/json" \  -d '{    "new_password": "stringstri"  }'
Empty
GET/api/v1/admin/backup

Owner-only. The server snapshots its SQLite database on a schedule (TM_BACKUP_INTERVAL_MIN, default daily) into TM_BACKUP_DIR (default: backups/ beside the database file) as tradermemos-YYYYMMDD-HHMMSSZ.db, keeping the newest TM_BACKUP_KEEP (default 14). Status is derived from that directory plus the last error held in memory, so last_attempt_at and last_error reset on restart. Postgres deployments report status: unsupported with a hint to use pg_dump.

Authorization

bearerAuth
AuthorizationBearer <token>

Session JWT access token or personal access token (tm_pat_…).

In: header

Response Body

application/json

curl -X GET "https://example.com/api/v1/admin/backup"
{  "enabled": true,  "driver": "sqlite",  "status": "ok",  "hint": "string",  "dir": "string",  "keep": 0,  "interval_min": 0,  "running": true,  "last_success_at": "2019-08-24T14:15:22Z",  "last_attempt_at": "2019-08-24T14:15:22Z",  "last_error": "string",  "latest": {    "name": "string",    "size_bytes": 0,    "created_at": "2019-08-24T14:15:22Z"  },  "file_count": 0}
POST/api/v1/admin/backup

Owner-only. Takes one snapshot immediately (and prunes beyond the keep count), regardless of whether the schedule is enabled. Returns the updated status. Only one snapshot runs at a time.

Authorization

bearerAuth
AuthorizationBearer <token>

Session JWT access token or personal access token (tm_pat_…).

In: header

Response Body

application/json

curl -X POST "https://example.com/api/v1/admin/backup"
{  "enabled": true,  "driver": "sqlite",  "status": "ok",  "hint": "string",  "dir": "string",  "keep": 0,  "interval_min": 0,  "running": true,  "last_success_at": "2019-08-24T14:15:22Z",  "last_attempt_at": "2019-08-24T14:15:22Z",  "last_error": "string",  "latest": {    "name": "string",    "size_bytes": 0,    "created_at": "2019-08-24T14:15:22Z"  },  "file_count": 0}