Install
openclaw skills install sure-apiUse the we-promise/sure REST API with X-Api-Key auth. Covers accounts, transactions, categories, tags, merchants, imports, holdings, trades, valuations, chat...
openclaw skills install sure-apiUse this skill when the user asks to:
These are the URLs the agent should trust first when updating or validating this skill:
https://github.com/we-promise/surehttps://github.com/we-promise/sure/tree/main/docs/apihttps://github.com/we-promise/sure/blob/main/docs/api/openapi.yamlhttps://raw.githubusercontent.com/we-promise/sure/main/docs/api/openapi.yamlIf behavior and local scripts disagree, re-check the upstream OpenAPI first.
Read secrets from secure env only:
SURE_BASE_URLSURE_API_KEYSingle source of truth: secure/api-fillin.env
Never paste the API key into chat or into non-secure files.
Default auth header:
X-Api-Key: <SURE_API_KEY>Note: the current upstream OpenAPI snapshot also shows Authorization header notes on some valuation endpoints. Treat upstream OpenAPI as authoritative if those endpoints behave differently in practice.
skills/sure-api/
├── SKILL.md
├── references/
│ ├── openapi.yaml
│ └── api_endpoints_summary.md
└── scripts/
├── sure_api_request.sh
├── sure_api_smoke.sh
├── sure_api_cli.js
├── sure_openapi_update.sh
├── sure_openapi_summarize.js
└── sure_api_acceptance.sh
This skill has two layers:
Use these first for common operations.
Implemented in scripts/sure_api_cli.js:
accounts:listcategories:listtags:listtags:createtags:updatetags:deletemerchants:listtransactions:listtransactions:gettransactions:createtransactions:updatetransactions:deleteimports:listholdings:listtrades:listFor any official endpoint not yet wrapped by the high-level CLI, use:
bash skills/sure-api/scripts/sure_api_request.sh <METHOD> <PATH> [curl args...]This means the skill can still operate against official endpoints such as:
references/openapi.yamlbash skills/sure-api/scripts/sure_api_smoke.sh
node skills/sure-api/scripts/sure_api_cli.js accounts:list
node skills/sure-api/scripts/sure_api_cli.js categories:list --classification expense
node skills/sure-api/scripts/sure_api_cli.js tags:list
node skills/sure-api/scripts/sure_api_cli.js merchants:list
node skills/sure-api/scripts/sure_api_cli.js transactions:list --start_date 2026-03-01 --end_date 2026-03-31 --type expense
node skills/sure-api/scripts/sure_api_cli.js holdings:list --account_id <uuid>
node skills/sure-api/scripts/sure_api_cli.js trades:list --account_id <uuid> --start_date 2026-03-01 --end_date 2026-03-31
Always prefer:
Example:
node skills/sure-api/scripts/sure_api_cli.js transactions:create \
--account_id <uuid> \
--date 2026-03-01 \
--amount 12.34 \
--name "午饭" \
--nature expense \
--dry-run
node skills/sure-api/scripts/sure_api_cli.js transactions:create \
--account_id <uuid> \
--date 2026-03-01 \
--amount 12.34 \
--name "午饭" \
--nature expense \
--yes
bash skills/sure-api/scripts/sure_api_request.sh GET /api/v1/merchants/<merchant-id>
bash skills/sure-api/scripts/sure_api_request.sh GET /api/v1/holdings/<holding-id>
bash skills/sure-api/scripts/sure_api_request.sh GET /api/v1/imports/<import-id>
bash skills/sure-api/scripts/sure_api_request.sh POST /api/v1/imports \
-H 'Content-Type: application/json' \
-d '{
"raw_file_content": "date,amount,name\n2026-03-01,12.34,午饭",
"type": "TransactionImport",
"account_id": "<account-uuid>",
"publish": "true"
}'
bash skills/sure-api/scripts/sure_api_request.sh POST /api/v1/trades \
-H 'Content-Type: application/json' \
-d '{
"trade": {
"account_id": "<account-uuid>",
"date": "2026-03-01",
"qty": 10,
"price": 12.5,
"type": "buy",
"ticker": "AAPL"
}
}'
bash skills/sure-api/scripts/sure_api_request.sh POST /api/v1/valuations \
-H 'Content-Type: application/json' \
-d '{
"valuation": {
"account_id": "<account-uuid>",
"amount": 10000,
"date": "2026-03-01",
"notes": "Month-end valuation"
}
}'
bash skills/sure-api/scripts/sure_api_request.sh POST /api/v1/chats \
-H 'Content-Type: application/json' \
-d '{"title":"Monthly review","message":"Summarize March spending"}'
bash skills/sure-api/scripts/sure_api_request.sh POST /api/v1/chats/<chat-id>/messages \
-H 'Content-Type: application/json' \
-d '{"content":"Show biggest merchant changes"}'
Most list endpoints return a resource list plus a pagination block. Typical filters in the official API include:
pageper_pageFor exact parameters, read references/openapi.yaml.
401 / 403 → auth missing, invalid, or insufficient feature scope404 → wrong path or object not found422 → validation error; inspect request body against references/openapi.yaml429 / 5xx → retry with backoff up to 3 times if the action is idempotentThis skill is designed to be self-maintainable.
bash skills/sure-api/scripts/sure_openapi_update.sh
What it does:
references/openapi.yamlreferences/api_endpoints_summary.mdDo this in order:
references/api_endpoints_summary.mdsure_api_cli.jssure_api_request.shRead references/openapi.yaml when you need:
Read references/api_endpoints_summary.md when you need:
Before publishing or bumping a version, run:
bash skills/sure-api/scripts/sure_api_acceptance.sh
Optional live API validation:
bash skills/sure-api/scripts/sure_api_acceptance.sh --with-live-api
The acceptance script checks:
SKILL.md frontmatter is valid enough for publishingFirst confirm login:
clawhub whoami
Initial publish example:
cd /root/.openclaw/workspace
clawhub publish ./skills/sure-api \
--slug sure-api \
--name "Sure API" \
--version 1.0.0 \
--changelog "Initial public release." \
--tags latest
Update publish example:
cd /root/.openclaw/workspace
clawhub publish ./skills/sure-api \
--slug sure-api \
--name "Sure API" \
--version 1.0.1 \
--changelog "Refresh official OpenAPI, tighten docs, and improve publish readiness." \
--tags latest
SKILL.md concise; put exact API detail in references/.sure_api_cli.js; leave long-tail official endpoints to the raw request wrapper.