Users API Reference

Manage user accounts, profiles, authentication, and user lifecycle operations.

Base Path: /api/users

Overview

The Users API provides endpoints for managing user accounts, profiles, passwords, and user authentication. Supports user creation, profile management, and account verification.

Key Operations


API Endpoints

POST /api/users/signup

User Signup

Allows new user to signup.

Authentication

None

Request Body

{
  "email": "user@example.com",
  "password": "secure_password",
  "firstName": "John",
  "lastName": "Doe"
}

Response

{
  "id": 123,
  "email": "user@example.com",
  "firstName": "John",
  "lastName": "Doe",
  "createdAt": "2026-06-02T10:30:00Z"
}
GET /api/users

List Users

Gets all users with filters and pagination.

Authentication

Bearer Token

Query Parameters

Parameter Type
$filter string
$skip integer
$top integer

Response

{
  "value": [
    {
      "id": 123,
      "email": "user@example.com",
      "firstName": "John",
      "status": "active"
    }
  ],
  "count": 1
}
GET /api/users/{id}

Get User by ID

Gets user details by ID.

Authentication

Bearer Token

Response

{
  "id": 123,
  "email": "user@example.com",
  "firstName": "John",
  "lastName": "Doe",
  "status": "active",
  "createdAt": "2026-06-02T10:30:00Z"
}
GET /api/users/{name}

Get User by Name

Gets user by username.

Authentication

Bearer Token

Response

{
  "id": 123,
  "username": "john_doe",
  "email": "user@example.com",
  "firstName": "John",
  "lastName": "Doe"
}
PATCH /api/users/{id}

Edit User (Admin)

Edits user data (Admin only).

Authentication

Bearer Token (Admin role required)

Request Body

{
  "firstName": "Jane",
  "lastName": "Smith",
  "status": "active"
}

Response

{
  "id": 123,
  "firstName": "Jane",
  "lastName": "Smith",
  "updatedAt": "2026-06-02T11:00:00Z"
}
POST /api/users

Create User (Admin)

Creates new user account (Admin only).

Authentication

Bearer Token (Admin role required)

Request Body

{
  "email": "newuser@example.com",
  "firstName": "Jane",
  "lastName": "Smith",
  "password": "temporary_password"
}

Response

{
  "id": 124,
  "email": "newuser@example.com",
  "createdAt": "2026-06-02T10:30:00Z"
}
DELETE /api/users/{id}

Delete User (Admin)

Soft deletes user account (Admin only).

Authentication

Bearer Token (Admin role required)

Response

{
  "success": true,
  "message": "User deleted"
}
PUT /api/users/password

Set Own Password

Sets authenticated user's password.

Authentication

Bearer Token

Request Body

{
  "currentPassword": "old_password",
  "newPassword": "new_secure_password"
}

Response

{
  "success": true,
  "message": "Password updated"
}
PUT /api/users/{id}/password

Set User Password (Admin)

Sets user's password (Admin only).

Authentication

Bearer Token (AppAdmin/Admin role required)

Request Body

{
  "newPassword": "new_temporary_password"
}

Response

{
  "success": true,
  "message": "Password set"
}
POST /api/users/{id}/verification

Reissue Verification Email

Sends verification email again.

Authentication

Bearer Token

Response

{
  "success": true,
  "message": "Verification email sent"
}
POST /api/users/{id}/invitation

Reissue Invitation Email

Sends invitation email again.

Authentication

Bearer Token

Response

{
  "success": true,
  "message": "Invitation email sent"
}
GET /api/users/profile/image

Get User Profile Image

Gets current user's profile image.

Authentication

Bearer Token

Response

Image file (JPEG/PNG)

POST /api/users/profile/image

Upload Profile Image

Uploads user profile image.

Authentication

Bearer Token

Request

Multipart form-data with image file

Response

{
  "imageUrl": "https://api.racknap.com/users/123/profile/image",
  "uploadedAt": "2026-06-02T10:30:00Z"
}
DELETE /api/users/profile/image

Delete Profile Image

Deletes user profile image.

Authentication

Bearer Token

Response

{
  "success": true,
  "message": "Profile image deleted"
}
GET /api/users/{id}/accessible-organizations

Get Accessible Organizations

Gets organizations accessible to user.

Authentication

Bearer Token

Response

{
  "organizations": [
    {
      "id": 1,
      "name": "Organization 1",
      "role": "Admin"
    }
  ]
}

Error Responses

Code HTTP Status
USER_NOT_FOUND 404
WEAK_PASSWORD 400
UNAUTHORIZED 403

Quick Links