HumHub

To get a list of users from your HumHub instance using n8n and the HTTP Request node, follow these steps. This assumes you have the official RESTful API module installed and enabled on your HumHub site (available in the HumHub Marketplace).

u

N8N & HumHub

1. Prerequisites on HumHub Side

  1. Install and activate the RESTful API module (free) via Administration > Modules.
  2. Configure authentication in the module settings:
    • Recommended: Enable Bearer Authentication and generate a bearer token for a user with sufficient permissions (usually an admin). Or enable HTTP Basic Authentication.
    • Alternative: Use JWT (login first to get a token) or an API key (some older setups use ?access_token=...).
  3. Ensure URL rewriting is enabled on your HumHub server.

The main endpoint for listing users is:

GET https://your-humhub-domain.com/api/v1/user

  • Optional query parameters:
    • eager=true → Includes profile data (recommended for more details).
    • Pagination parameters (if supported): page, per-page or limit.

The response is usually a JSON array of user objects (or a paginated object with results, total, etc., depending on your HumHub version).

2. Set Up in n8n

Use the HTTP Request node (built-in core node).

Basic Configuration (Single Request)

  • Method: GET
  • URL: https://your-humhub-domain.com/api/v1/user?eager=true
  • Authentication:
    • Bearer Token (most common): Select "Bearer Token" and paste your token.
    • Or Basic Auth: Enter HumHub username and password.
    • Or Header Auth: Add a custom header like Authorization: Bearer your-token-here.
  • Response Format: JSON (default).

If the API returns a paginated response, you may need to handle multiple pages.

Handling Pagination (Recommended)

Many HumHub REST endpoints support pagination. Use n8n's built-in pagination in the HTTP Request node:

  1. In the HTTP Request node, enable Pagination.
  2. Choose Mode: "Update parameter per request" (or "Response contains next URL" if the API provides a next link).
  3. Set Parameter to Update: page (or whatever parameter your API uses).
  4. Increment By: 1
  5. Optional: Set a Maximum Results limit.

Alternatively, use a Loop Over Items or Split In Batches node combined with the HTTP Request for more control.

3. Example Workflow in n8n

  1. Add a Manual Trigger (or Schedule, Webhook, etc.).
  2. Add an HTTP Request node with the settings above.
  3. (Optional) Add an Item Lists or Code node to process the results (e.g., extract usernames, emails, or filter users).
  4. Connect to other nodes (e.g., Google Sheets, Slack, Email, or your database) to store or act on the user list.

Example response structure (approximate):

JSON
[
  {
    "id": 1,
    "guid": "abc123...",
    "username": "john.doe",
    "display_name": "John Doe",
    "email": "john@example.com",
    "profile": { ... }  // if eager=true
  },
  ...
]

4. Tips & Troubleshooting

  • Test the endpoint first: Use tools like Postman or curl to verify the URL and authentication before building in n8n.
    • Example curl: curl -H "Authorization: Bearer YOUR_TOKEN" https://your-humhub.com/api/v1/user?eager=true
  • Permissions: The token/user must have rights to view the user list (usually admin-level).
  • Rate limits / large instances: If you have many users, always use pagination to avoid timeouts or overload.
  • Errors:
    • 401/403 → Check authentication.
    • 404 → Wrong base URL (ensure /api/v1/ is correct; some older modules used different paths).
    • Check HumHub logs or the REST module manual for exact parameters.
  • Full documentation: After installing the REST module, check Administration > Modules > RESTful API > Manual or the /docs/html folder on your server for all endpoints.

5. Advanced Options

  • To get a single user: GET /api/v1/user/{id}
  • Search users: Some setups support /api/v1/user/search/{text}
  • If you need more fields or custom logic, combine with HumHub's other endpoints.

If you run into a specific error (e.g., authentication issue or unexpected response), share the exact error message and your HumHub version, and I can help refine the setup.