Create User
curl -X POST https://api.sfluv.org/users \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json"
201 Created
403 Forbidden
500 Internal Server Error
Creates a new user account using the authenticated user’s DID from the JWT token.
POST /users
Authentication: Required (Bearer token via Privy)
Request Body: None (user ID is extracted from JWT)
Response
Returns 201 Created on success with no body.
Get Authenticated User
curl -X GET https://api.sfluv.org/users \
-H "Authorization: Bearer YOUR_TOKEN"
200 OK
403 Forbidden
404 Not Found
{
"user" : {
"id" : "did:privy:user123" ,
"exists" : true ,
"is_admin" : false ,
"is_merchant" : true ,
"is_organizer" : false ,
"is_improver" : false ,
"is_proposer" : false ,
"is_voter" : true ,
"is_issuer" : false ,
"is_supervisor" : false ,
"is_affiliate" : false ,
"contact_email" : "[email protected] " ,
"contact_phone" : "+1234567890" ,
"contact_name" : "John Doe" ,
"paypal_eth" : "0x..." ,
"last_redemption" : 1678901234
},
"wallets" : [
{
"id" : 1 ,
"owner" : "did:privy:user123" ,
"name" : "My Wallet" ,
"is_eoa" : true ,
"is_redeemer" : false ,
"is_minter" : false ,
"eoa_address" : "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb" ,
"smart_address" : null ,
"smart_index" : null ,
"last_unwrap_at" : null
}
],
"locations" : [],
"contacts" : [],
"affiliate" : null ,
"proposer" : null ,
"improver" : null ,
"issuer" : null ,
"supervisor" : null
}
Retrieves the authenticated user’s complete profile including associated wallets, locations, contacts, and role information.
GET /users
Authentication: Required (Bearer token via Privy)
Response Fields
User profile information Show User object properties
User’s decentralized identifier (DID)
Whether the user record exists in the database
Improver role flag (community project worker)
Proposer role flag (can create workflow proposals)
Voter role flag (can vote on workflows)
Issuer role flag (can issue credentials)
User’s contact email address
User’s contact phone number
User’s PayPal ETH address for payouts
Timestamp of last code redemption
Array of wallet objects associated with the user
Array of merchant location objects
Affiliate information if user has affiliate role
Proposer information if user has proposer role
Improver information if user has improver role
Issuer information if user has issuer role
Supervisor information if user has supervisor role
curl -X PUT https://api.sfluv.org/users \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"contact_email": "[email protected] ",
"contact_phone": "+1234567890",
"contact_name": "Jane Smith"
}'
201 Created
400 Bad Request
403 Forbidden
Updates the authenticated user’s profile information.
PUT /users
Authentication: Required (Bearer token via Privy)
Request Body
Response
Returns 201 Created on success with no body.
Update PayPal ETH Address
curl -X PUT https://api.sfluv.org/paypaleth \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: text/plain" \
-d '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb'
201 Created
403 Forbidden
500 Internal Server Error
Updates the user’s PayPal ETH address for receiving payouts.
PUT /paypaleth
Authentication: Required (Bearer token via Privy)
Request Body
Raw Ethereum address string (Content-Type: text/plain)
Get Verified Emails
curl -X GET https://api.sfluv.org/users/verified-emails \
-H "Authorization: Bearer YOUR_TOKEN"
[
{
"id" : "email_abc123" ,
"user_id" : "did:privy:user123" ,
"email" : "[email protected] " ,
"status" : "verified" ,
"verified_at" : "2024-03-15T10:30:00Z" ,
"verification_sent_at" : "2024-03-15T10:00:00Z" ,
"verification_token_expires_at" : null ,
"created_at" : "2024-03-15T10:00:00Z" ,
"updated_at" : "2024-03-15T10:30:00Z"
},
{
"id" : "email_def456" ,
"user_id" : "did:privy:user123" ,
"email" : "[email protected] " ,
"status" : "pending" ,
"verified_at" : null ,
"verification_sent_at" : "2024-03-16T14:20:00Z" ,
"verification_token_expires_at" : "2024-03-16T14:50:00Z" ,
"created_at" : "2024-03-16T14:20:00Z" ,
"updated_at" : "2024-03-16T14:20:00Z"
}
]
Retrieves all verified and pending email addresses for the authenticated user.
GET /users/verified-emails
Authentication: Required (Bearer token via Privy)
Response Fields
Unique identifier for the email record
Verification status: verified, pending, or expired
ISO 8601 timestamp when email was verified
ISO 8601 timestamp when verification email was sent
verification_token_expires_at
ISO 8601 timestamp when verification token expires (typically 30 minutes)
ISO 8601 timestamp of record creation
ISO 8601 timestamp of last update
Request Email Verification
curl -X POST https://api.sfluv.org/users/verified-emails \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected] "
}'
201 Created
400 Bad Request
409 Conflict
403 Forbidden
{
"id" : "email_abc123" ,
"user_id" : "did:privy:user123" ,
"email" : "[email protected] " ,
"status" : "pending" ,
"verified_at" : null ,
"verification_sent_at" : "2024-03-15T10:00:00Z" ,
"verification_token_expires_at" : "2024-03-15T10:30:00Z" ,
"created_at" : "2024-03-15T10:00:00Z" ,
"updated_at" : "2024-03-15T10:00:00Z"
}
Initiates email verification by creating a verification record and sending a verification email with a token.
POST /users/verified-emails
Authentication: Required (Bearer token via Privy)
Request Body
Response
Returns the created email verification record with pending status. A verification email is sent to the provided address containing a link with a verification token that expires in 30 minutes.
Resend Email Verification
curl -X POST https://api.sfluv.org/users/verified-emails/email_abc123/resend \
-H "Authorization: Bearer YOUR_TOKEN"
200 OK
404 Not Found
409 Conflict
{
"id" : "email_abc123" ,
"user_id" : "did:privy:user123" ,
"email" : "[email protected] " ,
"status" : "pending" ,
"verified_at" : null ,
"verification_sent_at" : "2024-03-15T10:45:00Z" ,
"verification_token_expires_at" : "2024-03-15T11:15:00Z" ,
"created_at" : "2024-03-15T10:00:00Z" ,
"updated_at" : "2024-03-15T10:45:00Z"
}
Resends the verification email for a pending email verification record.
POST /users/verified-emails/{email_id}/resend
Authentication: Required (Bearer token via Privy)
Path Parameters
The ID of the email verification record
Response
Returns the updated email verification record with new verification_sent_at and verification_token_expires_at timestamps. A new verification email is sent.
Verify Email Token
cURL (Query Parameter)
cURL (Request Body)
curl -X POST https://api.sfluv.org/users/verified-emails/verify?token=abc123xyz \
-H "Content-Type: application/json"
200 OK
400 Bad Request
404 Not Found
410 Gone
{
"id" : "email_abc123" ,
"user_id" : "did:privy:user123" ,
"email" : "[email protected] " ,
"status" : "verified" ,
"verified_at" : "2024-03-15T10:15:00Z" ,
"verification_sent_at" : "2024-03-15T10:00:00Z" ,
"verification_token_expires_at" : null ,
"created_at" : "2024-03-15T10:00:00Z" ,
"updated_at" : "2024-03-15T10:15:00Z"
}
Verifies an email address using the token from the verification email.
POST /users/verified-emails/verify
Authentication: Not required (public endpoint)
Request Parameters
Token can be provided via query parameter OR request body (query parameter takes precedence):
Verification token from email link
Verification token (if not provided as query parameter)
Response
Returns the updated email verification record with verified status and verified_at timestamp.
Error Responses
All endpoints may return the following error responses:
Invalid request format or parameters
Missing or invalid authentication token
Requested resource not found
Resource conflict (e.g., email already verified)
Resource has expired (e.g., verification token)
500 Internal Server Error
Server-side error occurred