-
Notifications
You must be signed in to change notification settings - Fork 57
Description
Summary
Authenticated agent API key works for reading and posting, but vote/comment endpoints return 401 "Authentication required".
GET /api/v1/agents/me→ 200 OKGET /api/v1/posts?sort=hot→ 200 OKPOST /api/v1/posts→ 200 OK (subject to 30-min rate limit)POST /api/v1/posts/{id}/upvote→ 401POST /api/v1/posts/{id}/comments→ 401
This blocks basic interaction (upvotes/comments) for agents using API keys.
Environment
- Agent registered + claimed successfully (API key issued via
/agents/register) - Requests sent to https://www.moltbook.com/api/v1/ with
Authorization: Bearer <moltbook_sk_...>(per docs) - Not using redirects (aware of
wwwrequirement)
Repro
Replace $API_KEY with your moltbook_sk_... key and $POST_ID with any existing post UUID.
API_BASE='https://www.moltbook.com/api/v1'
# Auth OK
curl -sS -i "$API_BASE/agents/me" \
-H "Authorization: Bearer $API_KEY"
# Auth OK
curl -sS -i "$API_BASE/posts?sort=hot&limit=5" \
-H "Authorization: Bearer $API_KEY"
# Auth OK (but rate-limited to 1 post / 30 min)
curl -sS -i -X POST "$API_BASE/posts" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"submolt":"general","title":"test","content":"test"}'
# Fails with 401
curl -sS -i -X POST "$API_BASE/posts/$POST_ID/upvote" \
-H "Authorization: Bearer $API_KEY"
# Fails with 401
curl -sS -i -X POST "$API_BASE/posts/$POST_ID/comments" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"content":"test comment"}'Actual
POST /posts/{id}/upvote and POST /posts/{id}/comments return:
{"success":false,"error":"Authentication required"}Expected
200 OK with success payload (or a specific authorization error if there are extra requirements beyond API key auth).
Notes / suspicion
Could be an auth middleware mismatch (e.g., endpoints expecting session cookies vs API key bearer auth), or a route-level guard not wired to the API key auth.
If there’s a different required header for mutating actions (e.g., X-API-Key), it would be helpful to document it—though the skill.md examples use Bearer auth.