Guides / TP-Link Omada

The Omada external portal API: what the documentation doesn't tell you

Notes from building an external portal server for TP-Link Omada. Each gotcha below cost us time against real controllers, and each fix is what our code does today.

By Andrew Westrope, founder of WifiFee · 22 November 2026

Omada's external portal lets you host the captive portal page yourself. The controller redirects a guest to your server, you decide whether they get online, and you tell the controller. The documentation covers the outline. It leaves out the details that decide whether it works on a real controller, especially across versions and in MSP mode.

Paths below use placeholders: {omadacId} is the controller ID and {scopeId} is explained in the MSP section. Every endpoint is under the controller's own address, for example https://controller.example:8043.

Two logins: hotspot operator and admin

There are two kinds of account, and they reach different parts of the API. We keep them apart as two separate clients in our code.

  • Hotspot operator. An account created under the site's hotspot settings. It logs in at /{omadacId}/api/v2/hotspot/login and can authorise guests through extPortal/auth. Your portal uses this on every guest connection.
  • Admin. A controller admin logs in at /{omadacId}/api/v2/login. You need it to create networks, SSIDs, portals and operators, and at runtime to set per-client speed limits, extend a guest's time or delete a hotspot client.

Note the field names differ. The operator login takes name and password. The admin login takes username and password.

The controller ID comes from GET /api/info, which needs no login. Read result.omadacId, and also result.mspMode, which matters later.

The CSRF token and session cookie

Both logins return a token in result.token and set a session cookie. We send both with every later request: the token in a Csrf-Token header and the cookie sent back. The cookie is called TPOMADA_SESSIONID on current controllers. We also accept TPEAP_SESSIONID as a fallback.

Check errorCode in the JSON body as well as the HTTP status. Zero means success. Anything else is a failure, with the reason in msg.

The time parameter is in milliseconds

The documentation says the time field in the auth request is in seconds. It is not. Send 3600 and the guest gets 3.6 seconds, not an hour.

You can see it in the hotspot client list. The client's end time minus its start time equals exactly the value you sent, in millisecond timestamps. Multiply your duration by 1000.

POST /{omadacId}/api/v2/hotspot/extPortal/auth
Csrf-Token: {token from hotspot login}

{
  "clientMac": "{clientMac from the redirect}",
  "site": "{site from the redirect}",
  "time": 3600000,
  "authType": 4,
  "gatewayMac": "{gatewayMac from the redirect}",
  "vid": 0
}

The same applies when an admin extends a guest's time: the period in the extend command is in milliseconds too.

Gateway or access point: two shapes of auth request

The redirect to your portal carries the guest's details in the query string: clientMac, site, and then either gatewayMac and vid, or apMac, ssidName and radioId. Which set you get depends on whether the portal runs on the gateway or on the access points.

Send back the same set you received. If there is a gatewayMac, send it with vid. Otherwise send apMac, ssidName and radioId. Store these values with the guest's session. You may need them again long after the redirect, for example when a payment confirms or when you take access away.

Ending a guest's access

When a session runs out or a payment is refunded, you have to take access away yourself. Either send the auth request again as the hotspot operator with a very short duration, which needs the stored redirect parameters, or delete the guest's hotspot client as admin, which does not. The hotspot client list writes MACs with dashes (AA-BB-CC-DD-EE-FF), so normalise the format before you compare.

MSP mode: controller ID to log in, customer ID for everything else

An MSP controller manages many customers. If /api/info reports mspMode: true, the rules change.

  • The admin login still goes to /{omadacId}/api/v2/login, using the controller's own ID.
  • Every site and hotspot path must use the ID of the customer that owns the site. Use the controller ID and you get "no permissions to access this site".
  • List customers with GET /{omadacId}/api/v2/customers?currentPage=1&currentPageSize=1000. Each has a customerId.

We call the ID in site paths the scope ID. On a standard controller it is the controller ID. On MSP it is the customer ID. Save the scope ID with each site you connect. The hotspot operator login and extPortal/auth then use the same scope ID in place of {omadacId}.

One trap: if you fetch the ID from /api/info at runtime, an MSP controller gives you its own ID, which will be refused. Fail with a clear error rather than falling back to it.

Omada 6.3 and 6.4 changed the API

Some long-standing paths have gone in recent releases. These are the ones we hit.

  • 6.4 removed GET /sites. Connecting a 6.4 controller failed with "Unsupported request path" before a site could be chosen. Use /{scopeId}/api/v2/sites/basic?currentPage=1&currentPageSize=100, which 6.3 and 6.4 both support. Older controllers do not know it, so if the call fails with errorCode -1600, retry with /sites. Only fall back on -1600, so real errors such as a bad login still surface.
  • 6.3 removed the gateways list. /sites/{siteId}/gateways is gone. Read /sites/{siteId}/devices and keep the entries with type: "gateway".
  • The client list needs a filter on version 6. We call /sites/{siteId}/clients with filters.active=true.

We test against 6.3 and 6.4 controllers in both standard and MSP mode, including an MSP admin limited to one customer.

The controller name is not in /api/info

It is natural to show the venue which controller they connected. /api/info has no name. The name the owner set under Settings → Controller is only available after an admin login, from GET /{omadacId}/api/v2/maintenance/controllerStatus, in result.name. It can be empty, so have a fallback.

What a working setup needs

Before the first guest can connect, the site needs a guest network, an SSID on it, a hotspot operator, an external portal pointing at your server, and pre-authentication rules so guests can reach your portal and payment pages before they are authorised. All of it is created as admin. Two details are worth knowing before you start.

  • Link the portal to the SSID only. If the portal is linked to both the SSID and the network, the gateway drops the body of HTTP POSTs from guests who are not yet authorised. Your portal's forms then arrive empty.
  • Serve the portal over plain HTTP. With HTTPS, the controller intercepts the connection and the guest sees certificate errors. More on this in our captive portal guide.

Guests who pay before they are authorised need the payment provider's pages in pre-auth as well as your own. Our Stripe WiFi payments guide covers that side.

Speed limits and the retry you will need

extPortal/auth has no speed limit field. To give a plan its own speed, set a rate limit on the client separately, as admin, straight after authorising it. The unit codes are 1 for Kbps and 2 for Mbps.

Just after authorisation the controller may not know the client yet, and the call fails with an error saying it "does not exist". Retry a few times with a growing wait. Before changing anything, check that the MAC is online on your guest SSID: it came from the portal request, which the guest controls, and you do not want to throttle a device on the venue's own network. Our Omada bandwidth limits guide goes further, including why we moved away from rate limit profiles.

Reaching the controller: port 8043 and certificates

Your portal server calls the controller's API directly, so the controller must be reachable from wherever that server runs. For a hosted portal that means from the internet, usually by forwarding port 8043 on the venue's router to the controller. Our setup insists the controller URL includes a port.

Most controllers use the self-signed certificate they shipped with, so a client that insists on a publicly trusted certificate will refuse to connect. Plan for that when you build your HTTP client.

Quick answers

Is the time in the Omada extPortal/auth request in seconds or milliseconds?

Milliseconds. The documentation says seconds, but the hotspot client list shows an end time minus start time equal to exactly the value sent, as a millisecond timestamp. For one hour, send 3600000. The extend command takes its period in milliseconds too.

Should my external portal use the hotspot operator or an admin account?

Use a hotspot operator to authorise guests through extPortal/auth. Anything that changes settings or clients, such as creating the SSID and portal, setting per-client speed limits, or extending or deleting hotspot clients, needs an admin login.

Why do I get "no permissions to access this site" on an MSP controller?

An MSP controller takes the admin login under its own ID, but site and hotspot paths must use the ID of the customer that owns the site. List the customers, then use the customer ID in place of the controller ID.

Why does GET /sites fail with "Unsupported request path" on Omada 6.4?

Controller 6.4 removed it. Use /sites/basic, which 6.3 and 6.4 both support, and fall back to /sites when an older controller returns error code -1600.

Can I set a speed limit in the Omada extPortal/auth request?

No. The auth request has no speed field. Set a rate limit on the client separately as admin after authorising it, retrying while the controller does not yet know the client, and check first that the device is on your guest SSID.

Rather not build it yourself?

WifiFee does all of the above for you. Connect your Omada controller, link your Stripe account and set your prices. There is no monthly fee: we take 10% of each payment.