Skip to content

User API

This page provides routes for managing users. The following routes are available:

  • POST /users/signup Sign up a new user.
  • POST /users/signupLocalUser Sign up a new local user.
  • GET /users Retrieve all users.
  • GET /users/:userId Retrieve a specific user by ID.
  • PUT /users/:userId Update a specific user by ID.
  • DELETE /users/:userId Delete a specific user by ID.
  • GET /users/profile Retrieve the profile of the authenticated user.
  • SignUp user

    This endpoint signs up a new user.

    POST https://nft-platform.azurewebsites.net/api/v1/users/signup

    json
    {
      "user": {
        "firstName": "Jane",
        "lastName": "Doe",
        "email": "tejeka924@confmin.com"
      },
      "hasAccount": true,
      "walletAddress": "0x1dDE63a7A42e643C5B822438E92619CCA92cEc63",
      "orgId": "674ecdcc923de3913822c5fe"
    }
    json
    {
      "localUser": {
        "accountAddress": "0x1dDE63a7A42e643C5B822438E92619CCA92cEc63",
        "deleted": false,
        "email": "tejeka924@confmin.com",
        "orgId": "674ecdcc923de3913822c5fe",
        "privateKey": "encrypted_private_key",
        "userId": "67bc4c6f7ab94fbb2eb0e95b",
        "_id": "67bc4c6fb240d78ffbce83b1",
        "credits": [],
        "createdAt": "2025-02-24T10:39:43.372Z",
        "updatedAt": "2025-02-24T10:39:43.372Z",
        "__v": 0,
        "creditsRemaining": 0,
        "creditsTotal": 0,
        "creditsUsed": 0,
        "id": "67bc4c6fb240d78ffbce83b1"
      },
      "response": {
        "data": {
          "deleted": false,
          "email": "tejeka924@confmin.com",
          "emailVerified": false,
          "failedLoginAttempts": 0,
          "firstName": "Jane",
          "lastName": "Doe",
          "organizations": [
            {
              "accessScope": ["read", "write", "update", "create", "delete", "api_key_management", "user_management"],
              "applicationName": "nft",
              "deleted": false,
              "orgId": "674ecdcc923de3913822c5fe",
              "role": "CUSTOMER",
              "verified": false,
              "wallet": {
                "accountAddress": "0x1dDE63a7A42e643C5B822438E92619CCA92cEc63"
              },
              "_id": "67bc4c6f7ab94fbb2eb0e95c"
            }
          ],
          "profilePicture": {
            "original": "",
            "thumbnail": ""
          },
          "twoFactorAuth": false,
          "_id": "67bc4c6f7ab94fbb2eb0e95b",
          "createdAt": "2025-02-24T10:39:43.760Z",
          "updatedAt": "2025-02-24T10:39:43.760Z",
          "__v": 0
        },
        "message": "Registration successful. Verification email sent.",
        "status": "success"
      }
    }

    SignUp local user

    This endpoint signs up a new local user.

    POST https://nft-platform.azurewebsites.net/api/v1/users/signupLocalUser

    json
    {
      "email": "tejeka924@confmin.com",
      "hasAccount": false,
      "orgId": "674ecdcc923de3913822c5fe",
      "userId": "67bc4c6f7ab94fbb2eb0e95b"
    }
    json
    {
      "user": {
        "deleted": false,
        "email": "tejeka924@confmin.com",
        "emailVerified": false,
        "failedLoginAttempts": 0,
        "organizations": [
          {
            "accessScope": ["read", "write", "update", "create", "delete", "api_key_management", "user_management"],
            "applicationName": "nft",
            "deleted": false,
            "orgId": "674ecdcc923de3913822c5fe",
            "role": "CUSTOMER",
            "verified": false,
            "wallet": {
              "accountAddress": "0x1dDE63a7A42e643C5B822438E92619CCA92cEc63"
            },
            "_id": "67bc4c6f7ab94fbb2eb0e95c"
          }
        ],
        "profilePicture": {
          "original": "",
          "thumbnail": ""
        },
        "twoFactorAuth": false,
        "_id": "67bc4c6f7ab94fbb2eb0e95b",
        "createdAt": "2025-02-24T10:39:43.760Z",
        "updatedAt": "2025-02-24T10:39:43.760Z",
        "__v": 0
      },
      "wallet": {
        "accountAddress": "0x1dDE63a7A42e643C5B822438E92619CCA92cEc63",
        "mnemonic": "encrypted_mnemonic_phrase",
        "privateKey": "encrypted_private_key"
      }
    }

    Retrieve all users

    This endpoint retrieves a list of all users.

    GET https://nft-platform.azurewebsites.net/api/v1/users

    Parameters

    None

    Example

    json
    {}
    json
    [
      {
        "_id": "67a5b467e318e27b6acf1f24",
        "accountAddress": "",
        "deleted": false,
        "email": "calit71340@intady.com",
        "orgId": "674ecdcc923de3913822c5fe",
        "userId": "67a5b464de0cfe544d15a2f8",
        "credits": [],
        "createdAt": "2025-02-07T07:21:11.098Z",
        "updatedAt": "2025-02-07T07:21:11.098Z",
        "__v": 0,
        "creditsRemaining": 0,
        "creditsTotal": 0,
        "creditsUsed": 0,
        "id": "67a5b467e318e27b6acf1f24"
      },
      {
        "_id": "67a5b593e318e27b6acf1f30",
        "accountAddress": "0x1c44fF3328887A0552D60B1dF702CC5be246C7B1",
        "deleted": false,
        "email": "cotaceb884@nike4s.com",
        "orgId": "674ecdcc923de3913822c5fe",
        "privateKey": "encrypted_private_key",
        "userId": "67a5b591de0cfe544d15a305",
        "credits": [],
        "createdAt": "2025-02-07T07:26:11.235Z",
        "updatedAt": "2025-02-07T07:26:11.235Z",
        "__v": 0,
        "creditsRemaining": 0,
        "creditsTotal": 0,
        "creditsUsed": 0,
        "id": "67a5b593e318e27b6acf1f30"
      }
    ]

    HTTP Response Codes

    Status CodeTextDescription
    200OKWith an array of user objects and pagination information.
    400Bad RequestThe request was invalid or cannot be processed.
    401UnauthorizedAuthentication is required or has failed.
    403ForbiddenThe authenticated user is not authorized to perform the requested action.
    404Not FoundThe requested resource could not be found.
    500Internal Server ErrorAn unexpected error occurred.

    Retrieve user by ID

    This endpoint retrieves a specific user by ID.

    GET https://nft-platform.azurewebsites.net/api/v1/users/:userId

    INFO

    Authentication: Requires ApiKey for authentication.

    Permissions: Requires ADMIN or OWNER role with read permission.

    Parameters

    NameTypeRequiredDescription
    userIdstringYesThe ID of the user to retrieve

    Example

    json
    {}
    json
    {
      "_id": "67a5b593e318e27b6acf1f30",
      "accountAddress": "0x1c44fF3328887A0552D60B1dF702CC5be246C7B1",
      "deleted": false,
      "email": "cotaceb884@nike4s.com",
      "orgId": "674ecdcc923de3913822c5fe",
      "privateKey": "encrypted_private_key",
      "userId": "67a5b591de0cfe544d15a305",
      "credits": [],
      "createdAt": "2025-02-07T07:26:11.235Z",
      "updatedAt": "2025-02-07T07:26:11.235Z",
      "__v": 0,
      "creditsRemaining": 0,
      "creditsTotal": 0,
      "creditsUsed": 0,
      "id": "67a5b593e318e27b6acf1f30"
    }

    HTTP Response Codes

    Status CodeTextDescription
    200OKWith an array of user objects and pagination information.
    400Bad RequestThe request was invalid or cannot be processed.
    401UnauthorizedAuthentication is required or has failed.
    403ForbiddenThe authenticated user is not authorized to perform the requested action.
    404Not FoundThe requested resource could not be found.
    500Internal Server ErrorAn unexpected error occurred.

    Update user by ID

    This endpoint updates a specific user by ID.

    PUT https://nft-platform.azurewebsites.net/api/v1/users/:userId

    INFO

    Authentication: Requires ApiKey for authentication.

    Permissions: Requires ADMIN or OWNER role with user_management and update permissions.

    Parameters

    ParameterTypeRequiredDescription
    userIdstringYesThe ID of the user to retrieve

    Example

    json
    { "walletAddress": "0xe09C5f717aA39841deC170B0085C9B9953Ef95d1" }
    
    
    //wallet address of the user to be changed
    json
    {
      "_id": "67a5b593e318e27b6acf1f30",
      "accountAddress": "0x1c44fF3328887A0552D60B1dF702CC5be246C7B1",
      "deleted": false,
      "email": "cotaceb884@nike4s.com",
      "orgId": "674ecdcc923de3913822c5fe",
      "privateKey": "encrypted_private_key",
      "userId": "67a5b591de0cfe544d15a305",
      "credits": [],
      "createdAt": "2025-02-07T07:26:11.235Z",
      "updatedAt": "2025-02-07T07:26:11.235Z",
      "__v": 0,
      "creditsRemaining": 0,
      "creditsTotal": 0,
      "creditsUsed": 0,
      "id": "67a5b593e318e27b6acf1f30"
    }

    HTTP Response Codes

    Status CodeTextDescription
    200OKWith an array of user objects and pagination information.
    400Bad RequestThe request was invalid or cannot be processed.
    401UnauthorizedAuthentication is required or has failed.
    403ForbiddenThe authenticated user is not authorized to perform the requested action.
    404Not FoundThe requested resource could not be found.
    500Internal Server ErrorAn unexpected error occurred.

    Delete user by ID

    This endpoint soft deletes a specific user by ID.

    DELETE https://nft-platform.azurewebsites.net/api/v1/users/:userId

    INFO

    Authentication: Requires ApiKey for authentication.

    Permissions: Requires ADMIN or OWNER role with user_management and delete permissions.

    Parameters

    ParameterTypeRequiredDescription
    userIdstringYesThe ID of the user to delete

    Example

    json
    {}
    json
    {
      "message": "User deleted successfully"
    }

    HTTP Response Codes

    Status CodeTextDescription
    200OKWith an array of user objects and pagination information.
    400Bad RequestThe request was invalid or cannot be processed.
    401UnauthorizedAuthentication is required or has failed.
    403ForbiddenThe authenticated user is not authorized to perform the requested action.
    404Not FoundThe requested resource could not be found.
    500Internal Server ErrorAn unexpected error occurred.

    Retrieve user profile

    This endpoint retrieves the profile of the authenticated user.

    GET https://nft-platform.azurewebsites.net/api/v1/users/profile

    INFO

    Authentication: Requires ApiKey for authentication.

    Permissions: Requires USER role with read permission.

    Parameters

    None

    Example

    json
    {}
    json
    {
      "_id": "67a5b593e318e27b6acf1f30",
      "accountAddress": "0x1c44fF3328887A0552D60B1dF702CC5be246C7B1",
      "deleted": false,
      "email": "cotaceb884@nike4s.com",
      "orgId": "674ecdcc923de3913822c5fe",
      "privateKey": "encrypted_private_key",
      "userId": "67a5b591de0cfe544d15a305",
      "credits": [],
      "createdAt": "2025-02-07T07:26:11.235Z",
      "updatedAt": "2025-02-07T07:26:11.235Z",
      "__v": 0,
      "creditsRemaining": 0,
      "creditsTotal": 0,
      "creditsUsed": 0,
      "id": "67a5b593e318e27b6acf1f30"
    }

    HTTP Response Codes

    Status CodeTextDescription
    200OKWith an array of user objects and pagination information.
    400Bad RequestThe request was invalid or cannot be processed.
    401UnauthorizedAuthentication is required or has failed.
    500Internal Server ErrorAn unexpected error occurred.

    API Documentation created with ❤️ by TrackGenesis