Skip to content

Why is Endpoint address data not available via the API? #20818

Description

@luckman212

I have a need to retrieve the "Endpoint IPs" of my nodes.

I am referring to this:

Image

This data does not seem to be available anywhere in the v2 API

I can (sometimes) get it via tailscale whois e.g.

$ tailscale whois --json 100.84.155.68 | jq .Node.Endpoints
[
  "[2001:470:1f07:230:xxxx:xxxx:xxxx:xxxx]:41641",
  "[2606:3580:215:6a00:xxxx:xxxx:xxxx:xxxx]:41641",
  "142.154.215.50:13537",
  "142.154.215.50:17147",
  "142.154.215.50:41641",
  "192.168.20.44:41641",
  "[2001:470:1f07:230:xxxx:xxxx:xxxx:xxxx]:41641"
]

But this info is STALE as you can see, my device is no longer on the 142.154.215.50 public IP (that was like 12 hours ago...) The 2606:3680:xxx IPv6 is also stale.

Any way to do this?

Related

Activity

  1. added
    api
    on Aug 11, 2026
  2. self-assigned this
    on Aug 11, 2026
  3. changed the title [-]Why is "Endpoints" data not available via the API?[/-] [+]Why is Endpoint address data not available via the API?[/+] on Aug 11, 2026
  4. luckman212 commented on Aug 11, 2026

    @luckman212
    Author

    Thanks for peeking at this. Let me know if any debug info is needed, or running with TS_DEBUG_MAP=1 etc

  5. alexwlchan commented on Aug 11, 2026

    @alexwlchan
    Member

    Have you looked at the clientConnectivity field in the API response? That looks like it contains the Endpoints data you're looking for – but you need to opt-in to receiving it in the devices API. For example:

    $ curl -H "Authorization: Bearer $API_KEY" "https://api.tailscale.com/api/v2/tailnet/-/devices?fields=nodeId,clientConnectivity" | jq .
    {
      "devices": [
        {
          "nodeId": "nooqMxPLN211CNTRL",
          "clientConnectivity": {
            "endpoints": [
              "192.168.1.10:50244",
              "89.168.152.222:41641",
              "10.12.224.169:41641",
              "192.168.4.248:41641",
              "[2a03:dd00:1180:fa19:f:d7ab:c7ce:2c2f]:41641",
              "[2a03:dd00:1180:fa19:bd37:f27c:b409:a27e]:41641"
            ],

    That's not especially clear from the API docs though; we should think about how to make that more discoverable.

  6. luckman212 commented on Aug 12, 2026

    @luckman212
    Author

    @alexwlchan thanks for that! looks like that is the data I was after. Yes I couldn't find that noted anywhere in the docs, so agree it would be great to have a list of additional fields.

  7. added
    web-ui
    on Aug 12, 2026
  8. added
    console
    and removed
    web-ui
    on Aug 12, 2026
  9. luckman212 commented on Aug 16, 2026

    @luckman212
    Author

    Circling back to thank you again @alexwlchan

    This extended API is exactly what I needed. I had a quick dig through the source to find some other useful field names (in case it helps anyone...)

    type Device struct {
    // Addresses is a list of the devices's Tailscale IP addresses.
    // It's currently just 1 element, the 100.x.y.z Tailscale IP.
    Addresses []string `json:"addresses"`
    DeviceID string `json:"id"`
    NodeID string `json:"nodeId"`
    User string `json:"user"`
    Name string `json:"name"`
    Hostname string `json:"hostname"`
    ClientVersion string `json:"clientVersion"` // Empty for external devices.
    UpdateAvailable bool `json:"updateAvailable"` // Empty for external devices.
    OS string `json:"os"`
    Tags []string `json:"tags"`
    Created string `json:"created"` // Empty for external devices.
    LastSeen string `json:"lastSeen"`
    KeyExpiryDisabled bool `json:"keyExpiryDisabled"`
    Expires string `json:"expires"`
    Authorized bool `json:"authorized"`
    IsExternal bool `json:"isExternal"`
    MachineKey string `json:"machineKey"` // Empty for external devices.
    NodeKey string `json:"nodeKey"`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

apiconsole

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions