User Endpoints
User profile and account management endpoints
The User API allows you to manage user profile information and account settings. All endpoints require authentication and appropriate scopes.
Available Endpoints
Complete list of user management endpoints and their purposes:
Endpoint | Method | Purpose | Required Scope |
---|---|---|---|
/api/user/me | GET | Get current user information | user:read |
/api/user/me/email | PUT | Update user email address | user:write |
/api/user/me/password | PUT | Update user password | user:write |
/api/user/me/enable-twofactor | POST | Enable/disable 2FA | user:write |
/api/user/me/limits | GET | Get account usage limits | user:read |
/api/user/me | DELETE | Delete user account | user:write |
GET /api/user/me
GET /api/user/me
Get current user information.
Required Scope: user:read
Request:
curl -X GET https://api.tinyrebrand.com/api/user/me \
-H "Authorization: Bearer at_1234567890abcdef"
Response:
{
"status": 200,
"code": "OK",
"message": "User fetched successfully",
"data": {
"id": "507f1f77bcf86cd799439011",
"email": "[email protected]",
"name": "John Doe",
"isVerified": true,
"isActive": true,
"createdAt": "2024-01-15T10:30:00.000Z"
}
}
PUT /api/user/me/email
PUT /api/user/me/email
Update user email address.
Required Scope: user:write
Request:
curl -X PUT https://api.tinyrebrand.com/api/user/me/email \
-H "Authorization: Bearer at_1234567890abcdef" \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]"
}'
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
string | ✅ | New email address |
Response:
{
"status": 200,
"code": "OK",
"message": "User email updated successfully",
"data": {
"id": "507f1f77bcf86cd799439011",
"email": "[email protected]",
"isVerified": false,
"updatedAt": "2024-07-02T15:00:00.000Z"
}
}
PUT /api/user/me/password
PUT /api/user/me/password
Update user password and security settings.
Required Scope: user:write
Request:
curl -X PUT https://api.tinyrebrand.com/api/user/me/password \
-H "Authorization: Bearer at_1234567890abcdef" \
-H "Content-Type: application/json" \
-d '{
"currentPassword": "old_password",
"newPassword": "new_password"
}'
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
currentPassword | string | ✅ | Current password |
newPassword | string | ✅ | New password |
Response:
{
"status": 200,
"code": "OK",
"message": "Password updated successfully",
"data": {
"id": "507f1f77bcf86cd799439011",
"updatedAt": "2024-07-02T15:00:00.000Z"
}
}
POST /api/user/me/enable-twofactor
POST /api/user/me/enable-twofactor
Enable or disable 2FA for account security.
Required Scope: user:write
Request:
curl -X POST https://api.tinyrebrand.com/api/user/me/enable-twofactor \
-H "Authorization: Bearer at_1234567890abcdef" \
-H "Content-Type: application/json" \
-d '{
"enable": true
}'
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
enable | boolean | ✅ | Enable or disable 2FA |
Response:
{
"status": 200,
"code": "OK",
"message": "2FA enabled successfully",
"data": {
"qrCode": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
"secret": "JBSWY3DPEHPK3PXP",
"backupCodes": ["12345678", "87654321"]
}
}
GET /api/user/me/limits
GET /api/user/me/limits
Get current account usage and limits.
Required Scope: user:read
Request:
curl -X GET https://api.tinyrebrand.com/api/user/me/limits \
-H "Authorization: Bearer at_1234567890abcdef"
Response:
{
"status": 200,
"code": "OK",
"message": "Limits fetched successfully",
"data": {
"domains": { "used": 2, "limit": 3 },
"links": { "used": 150, "limit": 500 },
"tags": { "used": 25, "limit": 100 }
}
}
DELETE /api/user/me
DELETE /api/user/me
Permanently delete user account.
Required Scope: user:write
Request:
curl -X DELETE https://api.tinyrebrand.com/api/user/me \
-H "Authorization: Bearer at_1234567890abcdef"
Response:
{
"status": 200,
"code": "OK",
"message": "Account deleted successfully",
"data": {
"deletedAt": "2024-07-02T15:00:00.000Z"
}
}