Skip to main content

User Profile Endpoints

Get Current User

GET /api/account/me
Retrieve the authenticated user’s profile information. Authentication Required: Yes Response
id
string
User ID (CUID)
name
string
User’s display name
email
string
User’s email address
emailVerified
boolean
Whether the email has been verified
image
string
Profile image URL (optional)
role
string
User role: user or admin
createdAt
string
Account creation timestamp (ISO 8601)
_count
object
curl -X GET https://api.stellarstack.app/api/account/me \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN"
{
  "id": "clx1234567890",
  "name": "John Doe",
  "email": "john@example.com",
  "emailVerified": true,
  "image": "https://example.com/avatar.jpg",
  "role": "user",
  "createdAt": "2024-01-15T10:30:00.000Z",
  "_count": {
    "servers": 5
  }
}

Update Current User

PATCH /api/account/me
Update the authenticated user’s profile information. Authentication Required: Yes Request Body
name
string
Display name (1-100 characters)
image
string
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 /api/account/me
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
success
boolean
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"
{
  "success": true
}

Admin User Management

These endpoints require admin role. Regular users cannot access admin-only endpoints.

List All Users

GET /api/account/users
Retrieve a list of all users in the system. Authentication Required: Admin only Response Returns an array of user objects, each containing:
id
string
User ID
name
string
Display name
email
string
Email address
emailVerified
boolean
Email verification status
image
string
Profile image URL
role
string
User role
createdAt
string
Account creation timestamp
_count
object
Server count object
curl -X GET https://api.stellarstack.app/api/account/users \
  -H "Authorization: Bearer ADMIN_SESSION_TOKEN"

Create User

POST /api/account/users
Create a new user account (admin only). Authentication Required: Admin only Request Body
name
string
required
User’s display name (1-100 characters)
email
string
required
User’s email address (must be unique)
password
string
required
User’s password (minimum 8 characters)
role
string
default:"user"
User role: user or admin
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": "newuser@example.com",
    "password": "securepassword123",
    "role": "user"
  }'
{
  "id": "clx9876543210",
  "name": "New User",
  "email": "newuser@example.com",
  "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
id
string
required
User ID
Response Returns user object including owned servers list.
servers
array
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
id
string
required
User ID
Request Body
name
string
Display name (1-100 characters)
email
string
Email address
role
string
User role: user or admin
image
string
Profile image URL
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
id
string
required
User ID
Restrictions
  • Admins cannot delete their own account via this endpoint
  • User must not have associated servers
Response
success
boolean
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
configured
boolean
Whether email is configured
provider
string
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
string
required
Email address to send test email to
Response
success
boolean
true if email was sent successfully
messageId
string
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": "test@example.com"
  }'
{
  "success": true,
  "messageId": "abc123@smtp.provider.com"
}

Authentication

Learn about authentication methods

User Management

User-facing authentication guide

Build docs developers (and LLMs) love