# 短.在线 — Agent and developer information # Preferred programmatic host: https://xn--s7y.xn--3ds443g # Human brand: https://短.在线 > Bilingual (中文 / English) short-link and QR service. No ads on redirects. Status: public beta. No SLA. 状态:公开 Beta 版,不提供 SLA。 Docs corrected 2026-09-25. Click statistics are available to the account that owns the link. A free plan can use the 7-day window. Pro and Business can use the 7-day, 30-day, and 90-day windows. Owner link disable is available; a disable counts only after Shlink confirms. ## Agent Quick Start Preferred API host (programmatic — use this for all HTTP): https://xn--s7y.xn--3ds443g Human-facing brand host (display / share strings): https://短.在线 Machines talk punycode. Humans may receive Unicode short_url in responses (prefer short_url_ascii when present). OpenAPI version v1.7.0: https://xn--s7y.xn--3ds443g/openapi.json https://xn--s7y.xn--3ds443g/openapi.yaml A2A Agent Card (static discovery; no A2A message endpoint): https://xn--s7y.xn--3ds443g/.well-known/agent-card.json Personal Agent Protocol (Poppy 1.0): https://xn--s7y.xn--3ds443g/.well-known/poppy.json Lists the OpenAPI document and the MCP endpoint. No company agent and no browser session join. A Poppy-Session header on REST /v1 and on /mcp is verified when present. It is not account access. Requests without that header are unchanged. Sign-in for personal agents is not offered. Human docs portal: https://xn--s7y.xn--3ds443g/en/docs https://xn--s7y.xn--3ds443g/zh-cn/docs Single link: POST /v1/links - Header: Idempotency-Key (required; TTL 24h). Scope = authenticated user or API key, or anonymous client id (X-Duan-Client-Id / sealed anon cookie) — not IP-only. - Body: exactly one of url | longUrl; optional alias (lowercase). When Chinese-character aliases are enabled, an alias may also use Chinese characters (2–12, NFKC; Traditional = Simplified). Percent-encode path ids. Give short_url_ascii to ASCII-only systems; QR codes encode it. With that switch off, aliases stay ASCII. Never send conflicting alias/customSlug. Custom alias requires verified email: session, user API key or MCP OAuth token on an unverified account → 403 EMAIL_UNVERIFIED; anonymous → 403 AUTH_REQUIRED (alias_requires_verified_account). An unassigned withheld short name is 400 PREMIUM_ALIAS. A frozen withheld name refuses a destination change with 403 PREMIUM_ALIAS_FROZEN and still redirects. - Prefer reading state, status_url, request_id on success. Destination only when state=active. - Status: GET /v1/links/{id} - Put any campaign tracking (such as UTM parameters) on the destination URL before you create the short link. Query parameters added to the short URL later are not forwarded or merged into the destination. - 请把活动跟踪参数(例如 UTM)放在要缩短的目标地址里,再创建短链接。之后加在短链接后面的查询参数不会被转发或合并到目标地址。 Bulk (sync): POST /v1/links/batch - Prefer batch for ≥2 creates (up to 100 links per sync batch). Do not N× parallel single creates against rate limits. - Per-item client_ref; partial success; per-item problem + retryable. Correlate by client_ref — never by array index. - Async batches are not available; sync batches up to 100 items. Campaign packs (registered account). Seven tools: prepare_campaign_pack, get_campaign_pack, retry_campaign_pack, save_campaign_setup, apply_campaign_setup, delete_campaign_pack, delete_campaign_setup. REST: POST /v1/campaign-packs, GET /v1/campaign-packs/{campaign_id}, POST /v1/campaign-packs/{campaign_id}/retry, DELETE /v1/campaign-packs/{campaign_id}, POST /v1/campaign-setups, GET /v1/campaign-setups/{setup_id}, POST /v1/campaign-setups/{setup_id}/apply, DELETE /v1/campaign-setups/{setup_id}. REST auth: API key (links:create or batches:create to write, links:read to read a pack) or a session cookie. An OAuth access token is not a REST credential. MCP accepts a Bearer API key or an OAuth access token with those scopes. A row may omit destination_url. That row needs attention and is not a rejected request. At most 10000 rows, 64 columns, 8192 characters per field, and 1048576 bytes of items JSON. These are request limits, not a plan allowance, and not the sync batch's 100-item ceiling. Links that are created still count toward the account monthly creation limit. These routes do not use Idempotency-Key. retry_campaign_pack accepts item_id values only. It does not accept replacement rows and does not recreate items that already succeeded. Submit a corrected row with prepare_campaign_pack, recovery_campaign_id, and the same item_id. Rows you do not resubmit stay in the pack. get_campaign_pack and retry_campaign_pack return the full pack (every row and every file), not only the recovered or retried row. ready_to_share is true only when every row is checked and every file is present and generated. Worked example (illustrative; real ids differ): POST /v1/campaign-packs {"items":[{"label":"Saturday workshop","destination_url":"https://example.com/workshop"},{"label":"Venue map"}]} The first row can return a short link and a QR file. The second row has no destination, so it needs attention and has no short link or QR. POST /v1/campaign-packs/{campaign_id}/retry with {"item_ids":[""]} retries that id and does not supply a new destination. GET /v1/campaign-packs/{campaign_id} and that retry both return every row and every generated file. ready_to_share is true only when the full pack is complete. 活动物料包需要已注册账号。七个工具:prepare_campaign_pack、get_campaign_pack、retry_campaign_pack、save_campaign_setup、apply_campaign_setup、delete_campaign_pack、delete_campaign_setup。retry 只接受 item_id,不接受替换行。更正后的行请再次调用 prepare_campaign_pack,并带上 recovery_campaign_id 与原来的 item_id。未再次提交的行会保留。get_campaign_pack 和 retry_campaign_pack 返回完整活动包(全部行和全部文件),不只返回恢复或重试的那一行。ready_to_share 仅在每一行都已核对且每个文件都已生成时为 true。DELETE /v1/campaign-packs/{campaign_id} 和 DELETE /v1/campaign-setups/{setup_id} 删除账号拥有的活动物料包或准备设置。其他账号的 id 返回 404。 Campaign pack CSV and QR files are MCP resources for the authenticated account. Each PNG QR also has an SVG text resource: the filename is the PNG name with .svg, mimeType is image/svg+xml, and qr_files.svg_uri is that resource. resources/read returns the SVG markup as text so a client can save the file. resources/list lists the newest 200 files for that account, including those SVG files. resources/read reads any file the account owns. The resource name is the filename. mimeType is text/csv, image/png, or image/svg+xml. A token needs links:read, links:create, or batches:create. Another account's file is not listed. REST pack JSON still includes the QR bytes. 活动物料包的 CSV 和二维码是已认证账号的 MCP resource。每个 PNG 二维码另有一个 SVG 文本 resource:文件名是 PNG 文件名改为 .svg,mimeType 为 image/svg+xml,qr_files.svg_uri 即该 resource。resources/read 以文本返回 SVG 标记,客户端可将其保存为文件。resources/list 列出该账号最新的 200 个文件,包括这些 SVG 文件。resources/read 读取该账号拥有的任一文件。resource 的 name 是文件名。令牌需要 links:read、links:create 或 batches:create。其他账号的文件不会被列出。REST 的活动物料包 JSON 仍包含二维码字节。 Authentication: - Anonymous REST create: allowed, rate-limited (low volume). On the response that enters idempotency scope (including 409 and 503), store X-Duan-Client-Id (sealed) and Set-Cookie duan_anon, then resend the header. Not an account. Never paste secrets into chat. - Authenticated REST: API key or session cookie for owner list, update, disable, QR, and link analytics. OAuth access tokens authorize MCP account tools only, not REST /v1. Anonymous create stays available. - OAuth (implemented): authorization code + PKCE S256, public clients only (no client secret). Grants: authorization_code and refresh_token. POST /oauth/register, GET /oauth/authorize, browser consent at POST /api/oauth/consent, POST /oauth/token. Discovery: /.well-known/oauth-authorization-server and /.well-known/oauth-protected-resource (same JSON at /.well-known/oauth-protected-resource/mcp). Agent Card: /.well-known/agent-card.json (static discovery; no A2A message endpoint). Issuable scopes: links:create, links:read, links:update, links:disable, analytics:read, batches:create. links:disable and analytics:read are granted only when explicitly requested. Omitted scope grants links:read only. Access token 1 hour. Each refresh returns a new refresh token. Store it and send it next time. The previous refresh token is invalid after use, and presenting it again revokes the connection. Expiry still extends by 30 days from that refresh, never past 365 days from the original grant. POST /oauth/revoke revokes an access or refresh token. No implicit, client-credentials, device-code, or introspection. - OAuth(已实现):公开客户端的授权码 + PKCE S256(无 client secret)。授权类型 authorization_code 与 refresh_token。POST /oauth/register,GET /oauth/authorize,浏览器同意 POST /api/oauth/consent,再 POST /oauth/token。发现文档 /.well-known/oauth-authorization-server 与 /.well-known/oauth-protected-resource。A2A Agent Card:/.well-known/agent-card.json(静态发现文档,没有 A2A 消息端点)。可签发 scope:links:create、links:read、links:update、links:disable、analytics:read、batches:create。links:disable 与 analytics:read 仅在客户端明确请求时签发。未请求 scope 时仅为 links:read。访问令牌有效期为 1 小时。每次刷新都会返回一枚新的刷新令牌,请保存并在下次使用。旧的刷新令牌使用后立即失效,再次出示已经用过的刷新令牌会撤销该连接。有效期自本次刷新起延长 30 天,且自首次授权起不超过 365 天。POST /oauth/revoke 吊销访问令牌或刷新令牌。 - Do not scrape HTML forms when the API is available. Retry policy: - Respect HTTP 429 and Retry-After (and RateLimit-* headers when present). - Idempotent POST replay: same Idempotency-Key → same create; do not invent a second link. - Concurrent reuse of the same key is safe; on IDEMPOTENCY_IN_PROGRESS wait Retry-After and retry with the same key. - Retry only when appropriate (429/5xx with Retry-After, or problem retryable=true). Do not blindly retry 4xx validation. - Destinations must be http/https. No phishing, malware, spam, or safety evasion (see AUP). ## Add MCP to ChatGPT, Claude, and Cursor (copy-paste) Quickstart (EN + ZH): https://xn--s7y.xn--3ds443g/en/docs/mcp and https://xn--s7y.xn--3ds443g/zh-cn/docs/mcp Remote URL: https://xn--s7y.xn--3ds443g/mcp (Streamable HTTP). Prefer OAuth in the browser. Never paste API keys, access tokens or refresh tokens into chat. Cursor mcp.json: {"mcpServers":{"duan-online":{"url":"https://xn--s7y.xn--3ds443g/mcp"}}} Claude / ChatGPT custom connector URL: https://xn--s7y.xn--3ds443g/mcp Revoke: To end access on 短.在线, use Settings › Connected apps (immediate) or revoke the API key. Removing the connector in the assistant stops that assistant from using it but may not revoke the token on 短.在线. Until revoked, OAuth refresh grants can stay valid up to 30 days idle and 365 days from the grant. Log out of all devices does not disconnect apps; password reset does not revoke API keys. Scoped OAuth; omitted scope is links:read only. INSUFFICIENT_SCOPE: this connection was not granted . Disconnect and reconnect so the client requests links:create (and batches:create for batches). Do not paste a key. Offer: HTTP(S) destinations you provide → bilingual short links + QR you can hand to someone else to publish. Creating via MCP needs an account. Docs and public tools/list need no install. QR for a new destination: shorten_url first, then create_qr on the owned link id. Remote MCP: https://xn--s7y.xn--3ds443g/mcp - Streamable HTTP (MCP 2026-07-28). POST only. GET /mcp returns 405 and is not discovery. - Public tool catalog: tools/list. - resolve_short_url is a public read (rate-limited). It is not an owner write. - begin_registration returns signup_url, expires_at, and an opaque resume_token only. It does not create an account or accept terms. - Sign up at https://xn--s7y.xn--3ds443g/en/auth?mode=signup. Then connect MCP with OAuth (authorization code + PKCE S256, public client, no client secret). Accept terms in the browser. Never send email or password through MCP. - Creating and managing links requires a registered account (Bearer API key or OAuth). Sign in and accept terms in the browser. Never send email or password through MCP. - Prefer short_url_ascii in tool results. GET /v1/links/{id}/qr and MCP create_qr return a scannable QR for a link the account owns. The image encodes the tracking URL with ?s=qr. Default PNG is 512×512 and includes an image block. SVG is only when format=svg, and is not an image block. create_qr also returns qr_tracking_url, the MIME type, the pixel size, and, when configured, a short-lived image_url that is not an API key, OAuth token, or session. Returns the stored link's QR as PNG, or SVG when requested, with a short-lived image URL where available. The QR encodes qr_tracking_url. Where an image is not displayed, image_url (when present) or the short link reaches the same code. - Docs: https://xn--s7y.xn--3ds443g/en/docs/mcp - Listed on the official MCP Registry as xn--3ds443g.xn--s7y/duan-online (v1.6.9) — https://registry.modelcontextprotocol.io/v0.1/servers?search=xn--3ds443g.xn--s7y/duan-online ## For AI agents (detail) - OpenAPI 3.1: https://xn--s7y.xn--3ds443g/openapi.json - OpenAPI (YAML): https://xn--s7y.xn--3ds443g/openapi.yaml - Link status via GET /v1/links/{id} — states: active | quarantined | disabled | blocked | expired (destination only when active) - Creating a link does not set an expiry. A link keeps its destination until the owner changes it, unless we restrict it under our Terms (§11). POST /v1/links/{id}/disable stops a link you own (REST: API key scope links:disable or session cookie; MCP: Bearer with links:disable). The account that owns a link can see its click statistics on the link's page in the web app and through the API and MCP. A free plan can use the 7-day window. Pro and Business can use the 7-day, 30-day, and 90-day windows (GET /v1/links/{id}/analytics and MCP get_link_analytics, scope analytics:read). Custom domains are not available. A short code is not a secret. Guessing it does not make the destination private. - 创建短链时不会设置到期时间。短链会保持当前目标,直到所有者更改,但我们依据服务条款(第 11 条)限制该短链的情况除外。POST /v1/links/{id}/disable 可停用你拥有的短链(REST:API 密钥 links:disable 或会话;MCP:Bearer 且 scope 含 links:disable)。拥有该短链的账号可以在网页应用的短链页面上,以及通过 API 和 MCP 查看点击统计。免费方案可以使用 7 日时间范围。Pro 和 Business 可以使用 7 日、30 日和 90 日时间范围(GET /v1/links/{id}/analytics 与 MCP get_link_analytics,权限 analytics:read)。不支持自定义域名。短码不是密钥,不应依靠短码的隐蔽性保护目标地址。 - GET /status only says the app process is up. It does not check the shortener, the database, or analytics. - GET /ready is a separate readiness check. It asks the database one query and reads one existing owned fixture. It does not create a link, send mail, or replace GET /status. - Errors are RFC 9457 problem details (type, title, status, detail, instance) plus error, message, and code. Match `code`. Older names stay in `aliases` (`error` and `code` stay equal). Every code, its HTTP status, Retry-After, plans_url, and the next step: https://xn--s7y.xn--3ds443g/en/docs/errors (中文: /zh-cn/docs/errors). A non-JSON body is INVALID_BODY (alias INVALID_URL on POST /v1/links; alias VALIDATION_ERROR on batch and PATCH). MCP tool argument failures are HTTP 200 isError with INVALID_ARGUMENT (aliases VALIDATION_ERROR and INVALID_ARGUMENTS) and `accepted` parameter names. An unsigned MCP tools/call is HTTP 401 AUTH_REQUIRED (alias invalid_token; WWW-Authenticate is unchanged) and includes a sign-in hint. Accept-Language zh-CN selects the Simplified Chinese message when one exists. - Short links use the apex host only (never www) - List / update / disable: authenticated owner only (API key or session cookie for REST, not an OAuth access token). MCP get_links, update_link, and disable_link call the shared owner handlers with Bearer (scopes links:read, links:update, or links:disable as required). A destination change is screened again, needs a verified email and an account at least 7 days old, and is limited to 3 times per link and 20 times per account in 24 hours. Disabled, quarantined, and reported links cannot be changed. An update does not re-enable a link. POST /v1/links/{id}/disable and MCP disable_link stop serving only after Shlink confirms; if confirm fails the response is 503 and nothing is recorded as success. GET /v1/links/{id}/analytics and MCP get_link_analytics return aggregate click statistics for a link the account owns. period is 7d, 30d, or 90d. A free plan can use 7d. Pro and Business can use 7d, 30d, or 90d. A free plan asking for 30d or 90d receives FEATURE_NOT_AVAILABLE. - POST /v1/links/{id}/enable re-enables a disabled link you own after you verify your email. API key scope links:update, or a session cookie. An OAuth access token is not a REST credential. An already-enabled link succeeds and changes nothing further. A link restricted by abuse, an operator, or a DSA hold stays off. This route is not an MCP tool. - 验证邮箱后,POST /v1/links/{id}/enable 可重新启用你自己停用的短链。API 密钥需要 links:update,或使用登录会话。OAuth 访问令牌不能调用 REST。短链已启用时再次调用成功且不再更改。滥用、运营人员或 DSA 限制的短链保持停用。该接口不是 MCP 工具。 ## Product - Pricing: https://xn--s7y.xn--3ds443g/en/pricing - Home: https://短.在线/ - Short links use the apex host only (never www) - Report illegal content (DSA notice form): https://xn--s7y.xn--3ds443g/en/legal/dsa/report (中文: /zh-cn/legal/dsa/report) - Security: https://短.在线/security - Service providers: https://短.在线/legal/service-providers ## Legal - Terms: https://短.在线/legal/terms - AUP: https://短.在线/legal/aup - Privacy: https://短.在线/legal/privacy ## Crawling - Marketing/legal/security/docs pages may be indexed - Search engines, AI training crawlers, and agent crawlers follow the same rules - Auth pages (/en/auth, /zh-cn/auth) and the DSA notice form (/legal/dsa/report, in all locales) are noindex - User short redirects carry X-Robots-Tag: noindex, nofollow - See https://短.在线/robots.txt ## Contact - Abuse: abuse@短.在线 - Privacy: privacy@短.在线 - Security: see https://短.在线/security ## 中文机器调用速览 登录与注册页(/en/auth、/zh-cn/auth)和 DSA 通知表单(/legal/dsa/report,含各语言路径)为 noindex。搜索引擎、AI 训练爬虫和智能体爬虫遵循同一套规则。 服务:短.在线 / Duan Online;运营方 Arasaka Oy(芬兰)。 HTTP 请求统一使用 https://xn--s7y.xn--3ds443g 。 显示给用户时可用短.在线;程序优先读取 short_url_ascii。 REST 定义:https://xn--s7y.xn--3ds443g/openapi.json 错误码表:https://xn--s7y.xn--3ds443g/zh-cn/docs/errors 。请匹配 code。非 JSON 请求体为 INVALID_BODY。MCP 参数错误为 INVALID_ARGUMENT,可用参数在 accepted。未登录的 tools/call 为 HTTP 401 AUTH_REQUIRED(别名 invalid_token)。Accept-Language 为 zh-CN 时,已有中文文案会使用中文。 当前能力:https://xn--s7y.xn--3ds443g/v1/capabilities MCP:https://xn--s7y.xn--3ds443g/mcp A2A Agent Card(静态发现文档,没有 A2A 消息端点):https://xn--s7y.xn--3ds443g/.well-known/agent-card.json Personal Agent Protocol(Poppy 1.0):https://xn--s7y.xn--3ds443g/.well-known/poppy.json 列出 OpenAPI 文档和 MCP 端点。没有公司客服代理,也没有浏览器会话接入。REST /v1 与 /mcp 上如果带 Poppy-Session,会先校验该头。它不是账户访问。没有该头的请求保持原样。不为个人代理提供登录。 中文说明:https://xn--s7y.xn--3ds443g/zh-cn/docs/mcp 首次体验:调用公开工具 resolve_short_url 查询本站短码。 注册地址:https://xn--s7y.xn--3ds443g/zh-cn/auth?mode=signup。然后用 OAuth 连接 MCP(授权码 + PKCE S256,公开客户端,无 client secret)。请在浏览器中接受条款。不要通过 MCP 发送邮箱或密码。 创建短链需已注册账号,通过客户端 OAuth 或安全保存的 Bearer API 密钥授权。 不要把邮箱、密码或 API 密钥 作为模型工具参数发送。 浏览器注册后应返回原客户端继续原任务。 单条创建:shorten_url;多条创建:shorten_urls,每批最多 100 条。 批量结果按 client_ref 匹配。 仅处理 HTTP(S) 目标地址,保留原始查询参数;不要自行改写签名 URL。 create_qr 为已有短链返回可扫描的二维码,默认 PNG 512×512 并包含图片块;SVG 仅在 format=svg 时返回,且不以 image 块返回。矩阵是带 ?s=qr 的追踪短链。需要已注册账号,且必须是该链接的所有者。不新建短链,也不抓取目标地址。一并返回 qr_tracking_url、MIME 类型、像素边长,以及在已配置时返回短期 image_url(不是 API 密钥、OAuth 令牌或会话)。返回已存储短链的二维码:默认 PNG,请求时为 SVG;可用时附带短期 image_url。二维码编码的是 qr_tracking_url。未显示图片时,可使用 image_url(如有)或短链。 REST 与 MCP 的功能支持分别以当前能力表为准。 MCP 的 get_links、update_link、disable_link 与 get_link_analytics 可用。 MCP get_links, update_link, disable_link, and get_link_analytics are available.