Skip to content

Users

All endpoints use the base URL /v1. Authenticated endpoints require a valid Bearer token in the Authorization header.


GET /v1/profiles/me

Returns the full profile of the authenticated user, including wallet and installed apps.

Authentication: Required

Response 200 OK:

{
"profile": {
"id": "uuid",
"first_name": "Jane",
"last_name": "Doe",
"username": "janedoe",
"avatar_url": "https://cdn.example.com/avatars/janedoe.jpg",
"caption": "Building cool things.",
"verified": true,
"created_at": "2025-01-15T08:30:00.000Z",
"updated_at": "2025-06-01T12:00:00.000Z"
},
"wallet": {
"id": "uuid",
"balance": 1500,
"currency": "USD"
},
"installed_apps": [
{
"app_id": "uuid",
"is_active": true
}
]
}

Errors:

StatusDescription
401 UnauthorizedMissing or invalid Bearer token.
404 Not FoundNo profile exists for the authenticated user.

PATCH /v1/profiles/me

Updates the authenticated user’s profile. Only whitelisted fields are accepted; any other fields in the request body are ignored.

Authentication: Required

Request Body:

FieldTypeRequiredDescription
first_namestringNoUser’s first name
last_namestringNoUser’s last name
usernamestringNoUnique username
avatar_urlstringNoURL to the avatar image
captionstringNoShort profile bio/caption

Request Example:

{
"first_name": "Jane",
"caption": "New caption here."
}

Response 200 OK:

{
"profile": {
"id": "uuid",
"first_name": "Jane",
"last_name": "Doe",
"username": "janedoe",
"avatar_url": "https://cdn.example.com/avatars/janedoe.jpg",
"caption": "New caption here.",
"verified": true,
"created_at": "2025-01-15T08:30:00.000Z",
"updated_at": "2025-06-02T10:00:00.000Z"
}
}

Errors:

StatusDescription
400 Bad RequestNo valid fields provided, or a database error occurred.
401 UnauthorizedMissing or invalid Bearer token.

DELETE /v1/profiles/me

Permanently deletes the authenticated user’s account. This action is irreversible.

Authentication: Required

Request Body (optional):

FieldTypeRequiredDescription
reasonstringNoReason for deleting the account
feedbackstringNoAdditional feedback about the experience

Side Effects:

  1. A row is inserted into the account_deletion_feedback table (if reason/feedback provided).
  2. The user is deleted from Supabase Auth, which cascades to all related data.

Response 200 OK:

{
"message": "Account deleted"
}

Errors:

StatusDescription
401 UnauthorizedMissing or invalid Bearer token.

GET /v1/profiles/{username}

Returns the public profile for a given username. No authentication required.

Authentication: None

Path Parameters:

ParameterTypeRequiredDescription
usernamestringYesThe user’s unique username

Response 200 OK:

{
"profile": {
"id": "uuid",
"username": "janedoe",
"first_name": "Jane",
"last_name": "Doe",
"avatar_url": "https://cdn.example.com/avatars/janedoe.jpg",
"caption": "Building cool things.",
"verified": true,
"created_at": "2025-01-15T08:30:00.000Z"
},
"followers_count": 128,
"following_count": 64
}

Errors:

StatusDescription
404 Not FoundNo profile found for the given username.

GET /v1/profiles/{username}/posts

Returns a cursor-paginated list of a user’s published posts. No authentication required.

Authentication: None

Path Parameters:

ParameterTypeRequiredDescription
usernamestringYesThe user’s unique username

Query Parameters:

ParameterTypeDefaultDescription
cursorstringCursor value (created_at) from a previous response for pagination.
limitinteger20Number of posts to return. Maximum 50.

Response 200 OK:

{
"posts": [
{
"id": "uuid",
"user_id": "uuid",
"created_at": "2025-06-01T12:00:00.000Z",
"status": "published",
"profiles": {
"id": "uuid",
"username": "janedoe",
"first_name": "Jane",
"last_name": "Doe",
"avatar_url": "https://cdn.example.com/avatars/janedoe.jpg"
}
}
],
"next_cursor": "2025-05-28T09:15:00.000Z"
}

When there are no more results, next_cursor is null.


GET /v1/profiles/{username}/followers

Returns a cursor-paginated list of users who follow the specified user. Only relationships with status='following' are included.

Authentication: None

Path Parameters:

ParameterTypeRequiredDescription
usernamestringYesThe user’s unique username

Query Parameters:

ParameterTypeDefaultDescription
cursorstringCursor value from a previous response for pagination.
limitinteger20Number of followers to return. Maximum 50.

Response 200 OK:

{
"followers": [
{
"follower_id": "uuid",
"created_at": "2025-03-10T14:30:00.000Z",
"profiles": {
"id": "uuid",
"username": "alexsmith",
"first_name": "Alex",
"last_name": "Smith",
"avatar_url": "https://cdn.example.com/avatars/alexsmith.jpg"
}
}
],
"next_cursor": "2025-02-20T08:00:00.000Z"
}

When there are no more results, next_cursor is null.


GET /v1/profiles/{username}/following

Returns a cursor-paginated list of users the specified user is following. Only relationships with status='following' are included.

Authentication: None

Path Parameters:

ParameterTypeRequiredDescription
usernamestringYesThe user’s unique username

Query Parameters:

ParameterTypeDefaultDescription
cursorstringCursor value from a previous response for pagination.
limitinteger20Number of results to return. Maximum 50.

Response 200 OK:

{
"following": [
{
"following_id": "uuid",
"created_at": "2025-04-05T10:00:00.000Z",
"profiles": {
"id": "uuid",
"username": "mchen",
"first_name": "Morgan",
"last_name": "Chen",
"avatar_url": "https://cdn.example.com/avatars/mchen.jpg"
}
}
],
"next_cursor": "2025-03-15T06:45:00.000Z"
}

When there are no more results, next_cursor is null.


All settings endpoints require authentication and use an upsert strategy — if no row exists for the authenticated user, one is created automatically.

GET /v1/settings/privacy

Returns the authenticated user’s privacy preferences.

Authentication: Required

Response 200 OK:

{
"privacy": {
"user_id": "uuid",
"follower_approval": false,
"show_online_status": true,
"show_activity_status": true
}
}

PATCH /v1/settings/privacy

Updates privacy preferences. Uses upsert on user_id.

Authentication: Required

Request Body:

FieldTypeRequiredDescription
follower_approvalbooleanNoRequire approval for new followers.
show_online_statusbooleanNoShow online status to other users.
show_activity_statusbooleanNoShow activity status to other users.

Request Example:

{
"follower_approval": true,
"show_online_status": false
}

Response 200 OK:

{
"privacy": {
"user_id": "uuid",
"follower_approval": true,
"show_online_status": false,
"show_activity_status": true
}
}

Errors:

StatusDescription
401 UnauthorizedMissing or invalid Bearer token.

GET /v1/settings/security

Returns the authenticated user’s security preferences.

Authentication: Required

Response 200 OK:

{
"security": {
"user_id": "uuid",
"two_factor_enabled": false
}
}

PATCH /v1/settings/security

Updates security preferences. Uses upsert on user_id.

Authentication: Required

Request Body:

FieldTypeRequiredDescription
two_factor_enabledbooleanNoEnable or disable 2FA.

Request Example:

{
"two_factor_enabled": true
}

Response 200 OK:

{
"security": {
"user_id": "uuid",
"two_factor_enabled": true
}
}

Errors:

StatusDescription
401 UnauthorizedMissing or invalid Bearer token.

GET /v1/settings/notifications

Returns the authenticated user’s notification preferences.

Authentication: Required

Response 200 OK:

{
"notifications": {
"user_id": "uuid",
"push_enabled": true,
"email_enabled": true,
"marketing_emails": false
}
}

PATCH /v1/settings/notifications

Updates notification preferences. Uses upsert on user_id. The schema is flexible to accommodate new notification types.

Authentication: Required

Request Body:

FieldTypeRequiredDescription
anybooleanNoDynamic key-value pairs for notification preferences.

Request Example:

{
"push_enabled": false,
"email_enabled": true
}

Response 200 OK:

{
"notifications": {
"user_id": "uuid",
"push_enabled": false,
"email_enabled": true,
"marketing_emails": false
}
}

Errors:

StatusDescription
401 UnauthorizedMissing or invalid Bearer token.

GET /v1/settings/account

Returns account-level information fetched from the Supabase Auth system.

Authentication: Required

Response 200 OK:

{
"account": {
"email": "jane@example.com",
"phone": "+1234567890",
"created_at": "2025-01-15T08:30:00.000Z"
}
}

Errors:

StatusDescription
401 UnauthorizedMissing or invalid Bearer token.

PATCH /v1/settings/account

Updates account-level settings via the Supabase Auth Admin API.

Authentication: Required

Request Body:

FieldTypeRequiredDescription
emailstringNoNew email address for the account.
phonestringNoNew phone number for the account.

Request Example:

{
"email": "newemail@example.com"
}

Response 200 OK:

{
"account": {
"email": "newemail@example.com",
"phone": "+1234567890",
"created_at": "2025-01-15T08:30:00.000Z"
}
}

Errors:

StatusDescription
400 Bad RequestInvalid email or phone format.
401 UnauthorizedMissing or invalid Bearer token.

GET /v1/onboarding

Returns the current onboarding state for the authenticated user.

Authentication: Required

Response 200 OK (onboarding in progress or completed):

{
"onboarding": {
"user_id": "uuid",
"completed": true,
"completed_at": "2025-01-16T09:00:00.000Z",
"updated_at": "2025-01-16T09:00:00.000Z",
"profile_setup": {
"first_name": "Jane",
"last_name": "Doe"
},
"interests": {
"categories": ["technology", "design"]
}
}
}

Response 200 OK (no onboarding record exists):

{
"onboarding": {
"completed": false
}
}

Errors:

StatusDescription
401 UnauthorizedMissing or invalid Bearer token.

POST /v1/onboarding

Saves progress for a specific onboarding step. Uses upsert on the user’s onboarding record and dynamically sets the step name as a field on the record.

Authentication: Required

Request Body:

FieldTypeRequiredDescription
stepstringYesThe name of the onboarding step (used as the field key).
dataobjectYesThe data to store for this step.

Request Example:

{
"step": "profile_setup",
"data": {
"first_name": "Jane",
"last_name": "Doe",
"avatar_url": "https://cdn.example.com/avatars/janedoe.jpg"
}
}

This creates or updates the onboarding record, setting the profile_setup field to the provided data object:

Response 200 OK:

{
"onboarding": {
"user_id": "uuid",
"completed": false,
"completed_at": null,
"updated_at": "2025-01-15T10:30:00.000Z",
"profile_setup": {
"first_name": "Jane",
"last_name": "Doe",
"avatar_url": "https://cdn.example.com/avatars/janedoe.jpg"
}
}
}

Errors:

StatusDescription
400 Bad RequestMissing step or data field in request body.
401 UnauthorizedMissing or invalid Bearer token.

POST /v1/onboarding/complete

Marks the onboarding flow as completed for the authenticated user. Sets completed to true and completed_at to the current timestamp.

Authentication: Required

Request Body: None

Response 200 OK:

{
"onboarding": {
"user_id": "uuid",
"completed": true,
"completed_at": "2025-01-16T09:00:00.000Z",
"updated_at": "2025-01-16T09:00:00.000Z",
"profile_setup": {
"first_name": "Jane",
"last_name": "Doe"
},
"interests": {
"categories": ["technology", "design"]
}
}
}

Errors:

StatusDescription
401 UnauthorizedMissing or invalid Bearer token.