tailscale-api
Tailscale REST API v2 (api.tailscale.com/api/v2) — devices, keys, ACL, DNS, webhooks, OAuth scopes.
Skill by Hermes Agent
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/minfengyuan-tailscale-api
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: backend, security
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Shell scripts
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/tailscale-api
What's inside
- Skill name
tailscale-api- Description
- Tailscale REST API v2 (api.tailscale.com/api/v2) — devices, keys, ACL, DNS, webhooks, OAuth scopes. Use for managing tailnet objects over HTTP.
- License
- MIT
- Metadata
- author: Hermes Agent · version: 1.0.0
- Instructions
- 116 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
- Instructions call the network
Files (8)
- SKILL.md
- authentication.md · references/
- devices.md · references/
- dns-logging.md · references/
- keys-users.md · references/
- policy-and-settings.md · references/
- webhooks-services-oauth.md · references/
- tsapi.sh · scripts/
SKILL.md (first lines)
# Tailscale REST API Reference
> Control-plane HTTP API for managing tailnets, devices, keys, DNS, ACL policy, users, webhooks. Mostly RESTful, JSON in/out, no pagination.
> Base URL: `https://api.tailscale.com/api/v2`
## When to use this skill
| Task | Use |
|---|---|
| Manage tailnet objects over HTTP (devices, keys, ACL, DNS, users, invites, webhooks…) | **This skill** |
| Control the local tailscaled daemon (`up`/`down`/`status`/`serve`/`cert`…) | `tailscale-cli` skill |
| Provision a node | CLI `tailscale up --auth-key=<key from this API's POST /tailnet/{tailnet}/keys>` |
## Ground truth & keeping current
- Interactive docs (Scalar UI): <https://tailscale.com/api-docs> · static reference: <https://tailscale.com/docs/reference/tailscale-api>
- **Official OpenAPI 3.1.0 spec (YAML)**: `curl -s "https://api.tailscale.com/api/v2?outputOpenapiSchema=true" > tailscale-openapi.yaml`
- API endpoints are stable unless noted in the spec; the **spec file itself is unstable** and may change without notice. When in doubt, re-download and diff.
- The `references/` files were generated from this spec (Aug 2026) and include per-endpoint params, schemas, and OAuth scopes.
## Conventions
- `{tailnet}` path segment: `-` = default tailnet of the calling token (best for most callers); otherwise the **Tailnet ID** (e.g. `T1234CNTRL`, from admin console → General Settings) is the preferred identifier. Legacy IDs (tailnet names) still work for tailnets created before Oct 2025. Org-scoped ops use `/organizations/{organization}/tailnets` (`-` = token's org).
- Auth header: `Authorization: Bearer <token>`. Tokens also work as HTTP Basic **username** with empty password (`curl -u "tskey-api-xxx:"`).
- **No pagination** — every list endpoint returns all results at once.
- Errors: standard HTTP status codes + JSON body `{"message": "…"}`. Common: `400` bad input, `401` bad/missing token, `403` insufficient scope, `404` not found / wrong `{tailnet}`, `429` rate-limited, `500`/`504` server side.
- Most `POST` endpoints have **full-replace semantics** ("set"); `PATCH` endpoints do partial updates. Send the complete desired state on POSTs.
- OAuth-scoped tokens must hold the scope each endpoint lists (e.g. `devices:core`); owner-role access tokens skip scope checks.
## Authentication — pick the right credential
| | Access token (API key) | Trust credential |
|---|---|---|
| Prefix | `tskey-api-` | `tskey-client-` (OAuth client secret) |
| Created via | Admin console → Settings → Keys | Admin console OAuth apps, or `POST /tailnet/{tailnet}/oauth-apps` |
| Permissions | Same as owning user (Owner/Admin/IT admin/Network admin) | Scoped: grant only the scopes needed |
| Expiry | 1–90 days, then rotate | Non-expiring; mints short-lived access tokens on demand |
| Best for | Quick scripts, personal automation | Services/CI, least-privilege long-running automation |
| API-visible | — | `POST /tailnet/{tailnet}/keys` with `keyType` + `scopes` |
Deep dive (creation steps, full 40-scope list, federated identities, trust-credential token flow): `references/authentication.md`.
## Endpoint map (93 operations)
| Reference file | Resource groups (op count) | Typical use |
|---|---|---|
| `references/devices.md` | Devices (15) · Device invites (6) · Device posture (5) | list/rename/tag devices, set routes & IP, authorize, posture attributes |
| `references/keys-users.md` | Keys (5) · Users (7) · User invites (5) · Contacts (3) | create/revoke auth keys, approve/suspend/delete users |
| `references/dns-logging.md` | DNS (11) · Logging (8) | nameservers, MagicDNS, split DNS, search paths, log streaming |
| `references/policy-and-settings.md` | Policy file (4) · Tailnet settings (2) · Organizations (3) | ACL get/set/validate/preview, device approval, tailnet lifecycle |
| `references/webhooks-services-oauth.md` | Webhooks (7) · Services (7) · OAuth apps (5) | Slack/Discord notifications, service catalog, OAuth app CRUD |
Each entry lists method, path, purpose, params, request/response schemas, required OAuth scope, and notable behavior. Use `references/` for anything beyond the recipes below.
## Quick recipes
```bash
TS_API_TOKEN=tskey-api-xxxxx
TS_BASE=https://api.tailscale.com/api/v2
AUTH="Authorization: Bearer $TS_API_TOKEN"
TAILNET="-" # or tailnet-name
# List devices (fields=all|default)
curl -s -H "$AUTH" "$TS_BASE/tailnet/$TAILNET/devices?fields=all" | jq '.devices[] | {name, hostname, addresses}'
# Create auth key: reusable, preauthorized, tagged, 1h expiry (key returned ONCE — save it)
curl -s -X POST -H "$AUTH" \
-d '{"keyType":"auth","capabilities":{"devices":{"create":{"reusable":true,"ephemeral":false,"preauthorized":true,"tags":["tag:server"]}}},"expirySeconds":3600,"description":"ci"}' \
"$TS_BASE/tailnet/$TAILNET/keys" | jq -r '.key'
# Set device tags / rename device
curl -s -X POST -H "$AUTH" -d '{"tags":["tag:ssh","tag:server"]}' "$TS_BASE/device/$DEVICE_ID/tags"
curl -s -X POST -H "$AUTH" -d '{"name":"db-1"}' "$TS_BASE/device/$DEVICE_ID/name"
# Set policy file (raw huJSON) — POST replaces the whole file
curl -s -X POST -H "$AUTH" -H "Content-Type: application/hujson" \
--data-binary @policy.hujson "$TS_BASE/tailnet/$TAILNET/acl"
# (application/json with a parsed object is also accepted)
# Enable MagicDNS
curl -s -X POST -H "$AUTH" -d '{"magicDNS":true}' "$TS_BASE/tailnet/$TAILNET/dns/preferences"
# Suspend a user
curl -s -X POST -H "$AUTH" "$TS_BASE/users/$USER_ID/suspend"
# Create a Slack webhook
curl -s -X POST -H "$AUTH" \
-d '{"endpointUrl":"https://hooks.slack.com/...","providerType":"slack","subscriptions":["nodeCreated","nodeDeleted"]}' \
"$TS_BASE/tailnet/$TAILNET/webhooks"
```
Helper script: `scripts/tsapi.sh METHOD PATH [JSON_BODY]` — wraps base URL + bearer auth via env `TS_API_TOKEN` (and `TS_TAILNET` for convenience).
## Pitfalls
- `GET /api/v2/tailnet` **without** a `{tailnet}` segment returns 404 even with valid auth; device/user list paths need the segment. Unauthenticated → 401.
- `deviceId`: prefer the device's `nodeId`; the numeric `id` also works but `nodeId` is the documented preference.
- `POST /device/{deviceId}/ip` pins a specific IPv4 (CGNAT `100.64.0.0/10` range) and **breaks all existing connections** to the node; reconnect at the new IP and flush DNS caches.
- Custom device posture attributes MUST use the `custom:` key prefix (max 128 chars); only custom-namespace attributes are user-settable.
- Auth-key capabilities nest under `capabilities.devices.create.{reusable,ephemeral,preauthorized,tags}`; `tags` only applies to auth keys. OAuth/trust credentials use `scopes` instead.
- Webhook `providerType` enum: `slack` | `mattermost` | `googlechat` | `discord`; `subscriptions` must be from the topic enum (full list in `references/webhooks-services-oauth.md`).
- DNS nameservers / search paths / split DNS / device routes: `POST` replaces the entire set — always send the full desired list (routes are `"10.0.0.0/24,10.1.0.0/24"` comma-joined strings).
- Deleting a device you only share into (node sharing) is not supported.
- The API is available on all plans; generate tokens from the console Keys page (1–90 day expiry).
## Verification
```bash
# token + base URL sanity check → expect 200, not 401
curl -s -o /dev/null -w "%{http_code}\n" -H "$AUTH" "$TS_BASE/tailnet/-/devices"
# same check via the bundled helper (requires TS_API_TOKEN; TS_TAILNET optional)
scripts/tsapi.sh GET /tailnet/-/devices | jq '.devices | length' # → device count
```From minfengyuan/harness-knowledge-base, MIT.
More from minfengyuan/harness-knowledge-base
- 0.587score
dev-mode
minfengyuan
Coordinate the project's seven specialized agents through planning, execution, review, debugging, and final acceptance for substantial software-development…
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
conventional-branch-naming
minfengyuan
Generate one descriptive Git branch name from a task using Conventional Commits 1.0.0 types.
SkillAFreshness: A★ 1Claude Code +9 - 0.587score
clarifying-requirements
minfengyuan
Turn vague ideas or requirements into a shared, actionable brief through iterative questions and confirmation.
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
tailscale-cli
minfengyuan
Complete tailscale CLI usage — all subcommands, flags, and common workflows (v1.96+)
SkillAFreshness: A★ 1Claude Code +9 - 0.552score
photo-illustration-styles
minfengyuan
Photo-to-illustration style transfer.
SkillBFreshness: B★ 1Claude Code +9 - 0.552score
optimize-astra-instructions
minfengyuan
Audit or revise Skills, AGENTS.md files, and agent task prompts specifically for GPT-6 Astra.
SkillBFreshness: B★ 1Claude Code +9 - 0.552score
progressive-disclosure-agents-md
minfengyuan
Design, review, or create progressive-disclosure and layered AGENTS.md instruction systems for agentic coding workflows.
SkillBFreshness: B★ 1Claude Code +9 - 0.549score
pi-coding-agent
minfengyuan
Guides agents using Pi coding-agent: install, authenticate, run, configure, automate, and extend the pi CLI.
SkillBFreshness: B★ 1Claude Code +9 - 0.548score
recipe-formatter
minfengyuan
将用户提供的菜谱文字或明确要求保存的菜谱整理为结构化 Obsidian 菜谱,自动分类并打标签。Use when the user wants recipe text formatted, normalized, tagged, or saved as a recipe note.
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
plan-ceo-review
minfengyuan
Use when a user wants product-level review of a plan, especially to challenge scope, ambition, and user value before implementation
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
conventional-commits
minfengyuan
Generate Conventional Commits 1.0.0 messages from staged git changes.
SkillBFreshness: B★ 1Claude Code +9 - 0.546score
tdd
minfengyuan
Use when the user requests test-driven development, red-green-refactor, integration tests, or a test-first bug fix.
SkillBFreshness: B★ 1Claude Code +9
Signals
- Stars
- 1
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Oct 12, 2026 (17 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 1.0.0
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Cite this page
tailscale-api skill. Agent Mart. https://agentmart.dev/skills/minfengyuan-tailscale-api (last updated 2026-10-24)