Create Contact
/contacts
Authentication: Required (Bearer token via Privy)
Request Body
Display name for the contact
Ethereum address of the contact (0x-prefixed hex string)
Whether this contact is marked as a favorite (defaults to false)
Response
Returns the created contact object including the auto-generatedid and owner fields.
Unique contact identifier
User’s DID who owns this contact
Display name for the contact
Ethereum address of the contact
Whether this contact is marked as a favorite
Get Contacts
/contacts
Authentication: Required (Bearer token via Privy)
Response
Returns an array of contact objects. The array is empty if the user has no contacts.Unique contact identifier
User’s DID who owns this contact
Display name for the contact
Ethereum address of the contact
Whether this contact is marked as a favorite
Update Contact
/contacts
Authentication: Required (Bearer token via Privy)
Request Body
ID of the contact to update
Updated display name for the contact
Updated Ethereum address of the contact
Updated favorite status
Response
Returns201 Created on success with no body.
Authorization
Users can only update their own contacts. The system automatically validates that the contact belongs to the authenticated user.Delete Contact
/contacts
Authentication: Required (Bearer token via Privy)
Query Parameters
ID of the contact to delete
Response
Returns200 OK on success with no body.
Authorization
Users can only delete their own contacts. The system automatically validates that the contact belongs to the authenticated user before deletion.Use Cases
Address Book for Transactions
Contacts serve as a user-friendly address book for cryptocurrency transactions within SFLUV:- Store frequently used wallet addresses with memorable names
- Mark favorite contacts for quick access
- Avoid copying/pasting long Ethereum addresses
Merchant Contacts
Users can save their favorite merchant locations’ wallet addresses for easy payments:Personal Network
Maintain a list of friends, family, or colleagues for peer-to-peer transfers:Best Practices
Address Validation
Always validate Ethereum addresses on the client side before submitting:- Must start with
0x - Must be 42 characters long (0x + 40 hex characters)
- Must contain only valid hexadecimal characters (0-9, a-f, A-F)
Favorite Management
Use theis_favorite flag to:
- Highlight important contacts in the UI
- Sort favorites to the top of contact lists
- Provide quick access buttons for frequent recipients
Contact Names
Recommend users include context in contact names:- ✅ “Alice - Landlord”
- ✅ “Bob’s Hardware Store”
- ✅ “Mom’s Wallet”
- ❌ “Alice” (too generic if user knows multiple Alices)
Error Responses
400 Bad Request
Invalid request format, missing required fields, or invalid contact ID
401 Unauthorized
Missing or invalid authentication token
500 Internal Server Error
Server-side error occurred during contact operation
Security Notes
- All contact operations are scoped to the authenticated user
- Users cannot access or modify other users’ contacts
- The
ownerfield is automatically set from the authentication token and cannot be overridden - Contact data is stored securely in the PostgreSQL database