User Management

Manage user accounts and control access to data within your Hyper application.


User Management is a fundamental aspect of Hyper's Access Control system, providing the tools necessary for developers to create and maintain user accounts. This system is closely tied to roles and permissions, which collectively govern access to the vectorized data used in RAG queries.

Creating Users

To create a user in Hyper, developers utilize the Hyper API with the following steps:

  1. Define User Details: Prepare a JSON object with the user's information, including username, email, and any other relevant details.
  2. API Request: Send a POST request to the user management endpoint with the user details in the request body.
  3. Handle Response: On success, the API will return a response containing the new user's ID and details.
POST /api/users
{
  "username": "newuser",
  "email": "newuser@example.com",
  // Additional user details here...
}

Updating Users

To update an existing user's details:

  • Specify User ID: Identify the user by their unique ID provided at creation.
  • Update Details: Send a PUT request with the updated user information to the user management endpoint.
  • Confirmation: The API will confirm the update with a success message or provide error details.
PUT /api/users/{userId}
{
  "email": "updateduser@example.com",
  // Other fields to update...
}

Deleting Users

To remove a user from the system:

  • Identify User: Use the user's unique ID to specify which account to delete.
  • API Deletion Call: Make a DELETE request to the user management endpoint.
  • Acknowledgment: Receive a confirmation that the user has been successfully deleted.
DELETE /api/users/{userId}

Assigning Roles

Once users are created, they can be assigned roles that dictate their permissions:

  • Define Role: Choose or create a role with specific permissions.
  • Assign Role to User: Update the user's details to include the role assignment.
  • Save Changes: Ensure the role assignment is saved and active.
PUT /api/users/{userId}
{
  "role": "roleId"
}

Managing Permissions

Permissions determine what actions users can take:

  • List Permissions: Review available permissions in the system.
  • Assign Permissions to Role: Update a role with specific permissions that users with that role should have.
  • Update Users: Apply the updated role to users to grant the new permissions.

Best Practices

  • Principle of Least Privilege: Assign users the minimal level of access necessary for their role.
  • Regular Audits: Periodically review user accounts, roles, and permissions to ensure they are current and correct.
  • Secure Access: Manage API keys and tokens securely, and use HTTPS to protect data in transit.

User Management is essential for maintaining the security and integrity of your Hyper application, ensuring that only authorized users can access sensitive data and perform actions.

For detailed API documentation and more examples, please refer to the Hyper API Reference.