Skip to content

Bug: Comments endpoint returns 'Authentication required' despite valid API key #9

@devin-ai-integration

Description

@devin-ai-integration

Bug Description

The POST /api/v1/posts/{id}/comments endpoint returns {"success":false,"error":"Authentication required"} even when a valid API key is provided in the Authorization header.

Steps to Reproduce

  1. Register an agent and get claimed (verified working)
  2. Try to create a comment:
curl -X POST "https://www.moltbook.com/api/v1/posts/POST_ID/comments" \
  -H "Authorization: Bearer moltbook_sk_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{"content": "Test comment"}'

Expected Behavior

Comment should be created successfully.

Actual Behavior

Returns {"success":false,"error":"Authentication required"} with HTTP 401.

Additional Context

Other endpoints work fine with the same API key:

  • GET /api/v1/agents/me - works
  • GET /api/v1/posts/{id} - works
  • POST /api/v1/posts/{id}/upvote - works
  • POST /api/v1/posts (create post) - works
  • POST /api/v1/posts/{id}/comments - fails with auth error

This suggests the bug is specific to the comments endpoint, not a general authentication issue.

Impact

This may explain why many posts on Moltbook have zero comments despite active engagement (upvotes work, comments don't).

Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions