Skip to main content

Admin

Base path: /api/admin

All routes except /login require authentication.

POST /login

Authenticates an admin and returns a JWT token valid for 2 hours.

Public endpoint - no token required.

Request Body

{
"email": "admin@fuowallet.com",
"password": "adminpassword"
}

Responses

200 - Success:

{
"message": "Login successful",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}

404 - Admin not found:

{
"message": "Invalid Admin details"
}

POST /provision

Creates a new admin account.

Requires authentication.

Request Body

{
"email": "newadmin@fuowallet.com",
"password": "adminpassword"
}

Responses

201 - Success:

{
"message": "Admin account created successfully",
"adminId": "uuid-here"
}

GET /users

Returns a list of all registered users.

Requires authentication.

Responses

200 - Success: Array of user objects.


PUT /users/:userId

Updates a user's details. All fields are optional. Only send the fields you want to change.

Requires authentication.

Request Body

{
"username": "new_username",
"email": "newemail@example.com",
"firstName": "NewFirst",
"lastName": "NewLast"
}

Responses

200 - Success:

{
"message": "User updated successfully"
}

404 - User not found:

{
"message": "User not found"
}

DELETE /users/:userId

Permanently deletes a user account.

Requires authentication.

Responses

200 - Success:

{
"message": "User deleted successfully"
}

GET /transactions

Returns all transactions across all users, with the associated username and email for each.

Requires authentication.

Responses

200 - Success: Array of transaction objects with nested user data.


GET /users/:userId/transactions

Returns all transactions for a specific user, sorted by most recent first.

Requires authentication.

Responses

200 - Success: Array of transaction objects.


GET /users/:userId/wallet

Returns the Stellar public and secret keys for a specific user.

Requires authentication.

Responses

200 - Success:

{
"stellarPublicKey": "GDXX...",
"stellarSecretKey": "SXXX..."
}