The Users API exposes your Surqo profile, real-time quota consumption, and — for admin accounts — the ability to upgrade any user to the Pro plan. All user endpoints require a valid Supabase JWT in theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ricardomb-tech/surqo/llms.txt
Use this file to discover all available pages before exploring further.
Authorization: Bearer header. User profiles are created automatically on first authenticated request; the default plan is "free".
Endpoints
GET /api/v1/users/me
Returns the full profile for the authenticated user, including farm list, quota counters, and computed flags likecan_use_ai_analysis.
Rate limit: 60 requests/minute per IP.
Response — 200 OK
PATCH /api/v1/users/me
Update the authenticated user’s profile. All fields are optional — only provided fields are updated. Rate limit: 20 requests/minute per IP.Display name. Maximum 200 characters.
Phone number. Maximum 30 characters.
Short biography. Maximum 500 characters.
URL to the user’s avatar image. Maximum 500 characters.
URL to the user’s cover/banner image. Maximum 500 characters.
200 OK — Full UserProfileResponse (same as GET /me)
GET /api/v1/users/me/plan-limits
Returns a structured breakdown of current quota usage. Use this endpoint to check remaining capacity before calling analysis endpoints, and to drive progress indicators in your UI. Response —200 OK
PATCH /api/v1/users/{user_id}/plan
Admin only. Promotes or demotes a user’s plan. Returns403 for any non-admin caller.
UUID of the target user. Returns
404 if the user does not exist.Must be
"free" or "paid". Any other value returns 422. When set to "paid", plan_activated_at is stamped with the current UTC timestamp.200 OK — UserProfileResponse for the updated user.
Example:
Free vs Pro Plan Comparison
| Feature | Free | Pro |
|---|---|---|
| Farms | 1 | Unlimited |
| AI analyses | 4 lifetime | Unlimited |
| Tokens per analysis | 800 | 2,048 |
| Email alerts | Unlimited | Unlimited |
| Chat (token budget) | 3,200 tokens | Unlimited |
| Priority support | — | ✓ |
Stripe integration is planned but not yet implemented. Plan upgrades are currently performed manually via the admin endpoint above.