MikroTik API icon

MikroTik API

Community Node for MikroTik RouterOS API

Actions67

Hotspot → Set

AI-generated

Summary

Set a hotspot entity on the MikroTik device, targeting a specific category and identifier.

Inputs

  • targetId (required) — ID (*1, *2) or Name (e.g., user1, profile1) of the hotspot entity to set.
  • hotspotCategory — Category of hotspot entity to set: servers, users, userProfiles, active, hosts, ipBindings, or cookies. Determines which MikroTik API endpoint and parameters are applicable.
  • commentText — Optional comment attached to the entity.
  • hotspotName — Name of the hotspot user or server (applicable when category is users or servers).
  • hotspotProfile — User profile name (applicable when category is users or servers).
  • hotspotPassword — Password for the hotspot user (applicable when category is users).
  • hotspotAddressPool — Address pool name (applicable when category is userProfiles).
  • hotspotSessionTimeout — Session timeout duration (applicable when category is userProfiles).
  • hotspotIdleTimeout — Idle timeout duration (applicable when category is userProfiles).
  • hotspotKeepaliveTimeout — Keepalive timeout duration (applicable when category is userProfiles).
  • hotspotStatusAutorefresh — Status autorefresh interval (applicable when category is userProfiles).
  • hotspotSharedUsers — Maximum number of shared users (applicable when category is userProfiles).
  • hotspotRateLimit — Rate limit in rx/tx format (e.g., 1M/5M) (applicable when category is userProfiles).
  • hotspotAddMacCookie — Whether to add a MAC cookie (applicable when category is userProfiles).
  • hotspotMacCookieTimeout — MAC cookie timeout duration (applicable when category is userProfiles).
  • hotspotAddressList — Address list name (applicable when category is userProfiles).
  • hotspotIncomingFilter — Incoming filter name (applicable when category is userProfiles).
  • hotspotOutgoingFilter — Outgoing filter name (applicable when category is userProfiles).
  • hotspotIncomingPacketMark — Incoming packet mark (applicable when category is userProfiles).
  • hotspotOutgoingPacketMark — Outgoing packet mark (applicable when category is userProfiles).
  • hotspotOpenStatusPage — Status page access mode: always, http-login, or https-login (applicable when category is userProfiles).
  • hotspotTransparentProxy — Whether transparent proxy is enabled (applicable when category is userProfiles).
  • hotspotInsertQueueBefore — Queue insertion position: first or after (applicable when category is userProfiles).
  • hotspotParentQueue — Parent queue name (applicable when category is userProfiles).
  • hotspotQueueType — Queue type (applicable when category is userProfiles).
  • hotspotOnLogin — Script or text executed on user login (applicable when category is userProfiles).
  • hotspotOnLogout — Script or text executed on user logout (applicable when category is userProfiles).

Output shape

The MikroTik RouterOS API command for the selected hotspot category's set operation is executed (e.g., /ip/hotspot/user/set for users, /ip/hotspot/set for servers, /ip/hotspot/user/profile/set for userProfiles). The response confirms the update and returns the modified entity's properties.

The hotspotCategory parameter dictates which specific API endpoint and which of the above optional parameters are sent. The targetId is always mapped to the .id parameter of the MikroTik command.

Examples

Example 1: Set a hotspot user profile

hotspotCategory: userProfiles, targetId: user1, hotspotProfile: default, hotspotRateLimit: 5M/10M, hotspotAddMacCookie: true

Links

Discussion