User Profile Endpoints
Get Current User
Retrieve the authenticated user’s profile information.
Authentication Required: Yes
Response
Whether the email has been verified
Profile image URL (optional)
Account creation timestamp (ISO 8601)
Number of servers owned by the user
curl -X GET https://api.stellarstack.app/api/account/me \
-H "Authorization: Bearer YOUR_SESSION_TOKEN"
{
"id": "clx1234567890",
"name": "John Doe",
"email": "[email protected]",
"emailVerified": true,
"image": "https://example.com/avatar.jpg",
"role": "user",
"createdAt": "2024-01-15T10:30:00.000Z",
"_count": {
"servers": 5
}
}
Update Current User
Update the authenticated user’s profile information.
Authentication Required: Yes
Request Body
Display name (1-100 characters)
Profile image URL (must be valid URL)
Response
Returns the updated user object with id, name, email, image, and role fields.
curl -X PATCH https://api.stellarstack.app/api/account/me \
-H "Authorization: Bearer YOUR_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Jane Doe",
"image": "https://example.com/new-avatar.jpg"
}'
Delete Current User
Delete the authenticated user’s account. This action is irreversible.
Authentication Required: Yes
Restrictions
- Cannot delete account if user owns any servers
- Must delete or transfer all servers first
Response
true if account was successfully deleted
Error Responses
400 Bad Request - User has active servers
curl -X DELETE https://api.stellarstack.app/api/account/me \
-H "Authorization: Bearer YOUR_SESSION_TOKEN"
Admin User Management
These endpoints require admin role. Regular users cannot access admin-only endpoints.
List All Users
Retrieve a list of all users in the system.
Authentication Required: Admin only
Response
Returns an array of user objects, each containing:
Email verification status
Account creation timestamp
curl -X GET https://api.stellarstack.app/api/account/users \
-H "Authorization: Bearer ADMIN_SESSION_TOKEN"
Create User
Create a new user account (admin only).
Authentication Required: Admin only
Request Body
User’s display name (1-100 characters)
User’s email address (must be unique)
User’s password (minimum 8 characters)
Response
Returns the created user object with 201 Created status. Admin-created users have their email automatically verified.
Error Responses
400 Bad Request - Email already exists or validation failed
500 Internal Server Error - Failed to create user
curl -X POST https://api.stellarstack.app/api/account/users \
-H "Authorization: Bearer ADMIN_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "New User",
"email": "[email protected]",
"password": "securepassword123",
"role": "user"
}'
{
"id": "clx9876543210",
"name": "New User",
"email": "[email protected]",
"emailVerified": true,
"role": "user",
"createdAt": "2024-03-01T15:45:00.000Z"
}
Get User
GET /api/account/users/:id
Retrieve detailed information about a specific user.
Authentication Required: Admin only
Path Parameters
Response
Returns user object including owned servers list.
Array of server objects owned by the user
curl -X GET https://api.stellarstack.app/api/account/users/clx1234567890 \
-H "Authorization: Bearer ADMIN_SESSION_TOKEN"
Update User
PATCH /api/account/users/:id
Update a user’s profile or role (admin only).
Authentication Required: Admin only
Path Parameters
Request Body
Display name (1-100 characters)
Response
Returns the updated user object.
curl -X PATCH https://api.stellarstack.app/api/account/users/clx1234567890 \
-H "Authorization: Bearer ADMIN_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"role": "admin"
}'
Delete User
DELETE /api/account/users/:id
Delete a user account (admin only).
Authentication Required: Admin only
Path Parameters
Restrictions
- Admins cannot delete their own account via this endpoint
- User must not have associated servers
Response
true if user was successfully deleted
Error Responses
400 Bad Request - Cannot delete own account or user has servers
404 Not Found - User not found
curl -X DELETE https://api.stellarstack.app/api/account/users/clx1234567890 \
-H "Authorization: Bearer ADMIN_SESSION_TOKEN"
Admin Email Management
Get Email Status
GET /api/account/admin/email/status
Check email configuration status.
Authentication Required: Admin only
Response
Whether email is configured
Email provider: smtp, resend, sendgrid, or none
curl -X GET https://api.stellarstack.app/api/account/admin/email/status \
-H "Authorization: Bearer ADMIN_SESSION_TOKEN"
{
"configured": true,
"provider": "smtp"
}
Send Test Email
POST /api/account/admin/email/test
Send a test email to verify email configuration.
Authentication Required: Admin only
Request Body
Email address to send test email to
Response
true if email was sent successfully
Message ID from email provider (if available)
Error Responses
400 Bad Request - Invalid email format or missing email address
500 Internal Server Error - Failed to send email
curl -X POST https://api.stellarstack.app/api/account/admin/email/test \
-H "Authorization: Bearer ADMIN_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]"
}'
Authentication
Learn about authentication methods
User Management
User-facing authentication guide