MyClaude Docs
MyClaude Docs

Getting Started

Buyers

Creators

CLI

API

API OverviewProducts APIUsers APIPayments APIDownloads API

Agent Integration

Developers

Security

Legal

API Reference

Users API

Reference for user endpoints: profile updates, follow/unfollow, account deletion, and messaging.

ReferenceUpdated 2026-03-25

The Users API manages user profiles, social relationships, direct messaging, and account lifecycle. All endpoints require authentication.

Update profile

Update the authenticated user's profile. Changes to username and display name are cascaded to all products authored by the user. Username uniqueness is enforced atomically via a dedicated usernames collection in Firestore.

POST /users/update-profile

Auth: Required (Bearer token) Rate limit: 5/min (strict)

Request body

{
  "displayName": "Jane Doe",
  "username": "janedoe",
  "bio": "Building tools for the Claude Code ecosystem",
  "country": "US",
  "avatarUrl": "https://example.com/avatar.jpg"
}
FieldTypeRequiredConstraints
displayNamestringYesMax 50 characters
usernamestringYesLowercase alphanumeric + _ + -, 3--30 characters. Must match /^[a-z0-9_-]{3,30}$/
biostringNoMax 500 characters
countrystringNoMax 100 characters
avatarUrlstringNoMust be a valid HTTPS URL

Response

{
  "success": true
}

Side effects

When username, display name, or avatar changes, the server cascades the update to all products authored by this user (denormalized fields: authorUsername, authorDisplayName, authorAvatar). Updates are batched in chunks of 500 documents.

Username changes are audited in the server log.

Errors

StatusCondition
400Invalid display name, username format, bio/country too long, or invalid avatar URL
404User profile not found
409Username is taken by another user

Follow / unfollow

Toggle a follow relationship with another user. Uses a Firestore transaction for atomic counter updates on both users.

POST /users/follow

Auth: Required (Bearer token) Rate limit: 30/min (strict)

Request body

{
  "targetUid": "uid_of_user_to_follow"
}
FieldTypeRequiredDescription
targetUidstringYesUID of the user to follow or unfollow

Response

{
  "following": true
}

following: true means the follow was created. following: false means the follow was removed (toggled off).

Side effects

  • Creates/deletes documents in both users/{myUid}/following and users/{targetUid}/followers subcollections.
  • Increments/decrements stats.following on the current user and stats.followers on the target user.

Errors

StatusCondition
400Missing targetUid, or attempting to follow yourself
404Target user not found

Delete account

Permanently delete the authenticated user's account. This is an irreversible operation that anonymizes the user profile, removes all products, cleans up subcollections, and deletes the Firebase Auth account.

DELETE /users/delete-account

Auth: Required (Bearer token) Rate limit: 1/min (strict)

Request body

None.

Response

{
  "success": true
}

Deletion sequence

The server performs these steps in order:

StepActionDetails
0Release usernameDeletes the username reservation from the usernames collection
1Anonymize profileSets display name to "Deleted User", clears bio, avatar, email, Stripe data
2Remove productsSets all user's products to status: "removed", anonymizes author fields
3Delete achievementsRemoves all documents in users/{uid}/achievements
4Delete followingRemoves all documents in users/{uid}/following
5Delete followersRemoves all documents in users/{uid}/followers
6Delete Firebase AuthDeletes the Firebase Authentication account (irreversible)

An audit trail is written before deletion begins, recording the username and product count.

Errors

StatusCondition
404User profile not found

List conversations

Retrieve all conversations the authenticated user is participating in, ordered by most recent message.

GET /messages

Auth: Required (Bearer token) Rate limit: 60/min (standard)

Response

{
  "conversations": [
    {
      "id": "productId_buyerUid",
      "productId": "abc123",
      "productTitle": "Code Review Skill",
      "productSlug": "code-review-skill",
      "buyerUid": "uid_buyer",
      "buyerUsername": "buyer1",
      "buyerDisplayName": "Buyer One",
      "buyerAvatar": "https://...",
      "sellerUid": "uid_seller",
      "sellerUsername": "seller1",
      "sellerDisplayName": "Seller One",
      "sellerAvatar": "https://...",
      "participants": ["uid_buyer", "uid_seller"],
      "lastMessage": "Thanks for the quick response!",
      "lastMessageAt": "2026-03-24T16:30:00.000Z",
      "lastMessageSenderUid": "uid_buyer",
      "unreadBySeller": 1,
      "unreadByBuyer": 0,
      "createdAt": "2026-03-24T10:00:00.000Z"
    }
  ]
}

Returns up to 50 conversations.


Send a message

Send a message about a product. Buyers can initiate conversations; sellers can only reply to existing ones. A conversation is uniquely identified by {productId}_{buyerUid}.

POST /messages

Auth: Required (Bearer token) Rate limit: 20/min (strict)

Request body

{
  "productId": "abc123",
  "text": "Is this compatible with Claude Code 2.0?"
}
FieldTypeRequiredConstraints
productIdstringYesValid product ID
textstringYes1--1000 characters

Response

{
  "success": true,
  "conversationId": "abc123_uid_buyer"
}

Side effects

  • Creates a conversation document if one does not exist (buyer-initiated only).
  • Increments the unread counter for the recipient.
  • Creates a notification for the recipient.

Errors

StatusCondition
400Missing productId, empty text, text too long, or seller has no conversation to reply to
404Product not found

Get conversation messages

Retrieve messages in a specific conversation. Marks the conversation as read for the authenticated user.

GET /messages/{conversationId}

Auth: Required (Bearer token, must be a conversation participant) Rate limit: 60/min (standard)

Path parameters

ParameterTypeDescription
conversationIdstringConversation ID (format: {productId}_{buyerUid})

Response

{
  "messages": [
    {
      "id": "msg_001",
      "senderUid": "uid_buyer",
      "senderUsername": "buyer1",
      "senderDisplayName": "Buyer One",
      "senderAvatar": "https://...",
      "text": "Is this compatible with Claude Code 2.0?",
      "createdAt": "2026-03-24T10:05:00.000Z"
    }
  ],
  "conversation": {
    "id": "abc123_uid_buyer",
    "productTitle": "Code Review Skill",
    "productSlug": "code-review-skill",
    "buyerUsername": "buyer1",
    "buyerDisplayName": "Buyer One",
    "buyerAvatar": "https://...",
    "sellerUsername": "seller1",
    "sellerDisplayName": "Seller One",
    "sellerAvatar": "https://...",
    "buyerUid": "uid_buyer",
    "sellerUid": "uid_seller"
  }
}

Returns up to 100 messages per conversation, ordered oldest first.

Errors

StatusCondition
403Authenticated user is not a participant in this conversation
404Conversation not found

Server-side user data (internal)

User profiles and product listings are rendered server-side for SEO via Next.js Server Components. These are not public API endpoints -- they are internal lib/server/ functions used during SSR:

FunctionPathDescription
getUserProfile(uid)lib/server/users.tsFetch user profile by UID
getUserByUsername(username)lib/server/users.tsFetch user profile by username

These functions return full profile data which is then stripped to SafeUserProfile before being passed to client components.


Related pages

  • API Overview -- Auth model, rate limits, error format
  • Products API -- Product operations
  • Payments API -- Stripe Connect setup for creators
  • Creator Onboarding -- Getting started as a creator
  • Security Model -- How user data is protected

Products API

Complete reference for product endpoints: search, upload, scan, download, like, reviews, self-approve, and CLI create.

Payments API

Reference for payment endpoints: Stripe Checkout, Stripe Connect onboarding, webhook handling, and the secure purchase flow.

On this page

Update profileRequest bodyResponseSide effectsErrorsFollow / unfollowRequest bodyResponseSide effectsErrorsDelete accountRequest bodyResponseDeletion sequenceErrorsList conversationsResponseSend a messageRequest bodyResponseSide effectsErrorsGet conversation messagesPath parametersResponseErrorsServer-side user data (internal)Related pages