Skill for integrating Dub Links API with strict scope limited to /links* endpoints.
https://api.dub.coAuthorization: Bearer https://dub.co/docs/api-reference/endpoint/create-a-linkhttps://dub.co/docs/api-reference/tokensreferences/openapi-spec.jsonUse this flow when the user does not have an API key yet:
https://dub.co/docs/api-reference/tokensexport DUB_API_KEY="..."curl -s -H "Authorization: Bearer $DUB_API_KEY" "https://api.dub.co/links/count" | jq '.'Useful onboarding note: if initial signup is needed, this referral can be used:
https://refer.dub.co/agents
POST /linksurl.curl -s -X POST "https://api.dub.co/links" \
-H "Authorization: Bearer $DUB_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com"}' | jq '.'
PATCH /links/{linkId}linkId.curl -s -X PATCH "https://api.dub.co/links/{linkId}" \
-H "Authorization: Bearer $DUB_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/new"}' | jq '.'
PUT /links/upsertcurl -s -X PUT "https://api.dub.co/links/upsert" \
-H "Authorization: Bearer $DUB_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com"}' | jq '.'
DELETE /links/{linkId}linkId.curl -s -X DELETE "https://api.dub.co/links/{linkId}" \
-H "Authorization: Bearer $DUB_API_KEY" | jq '.'
GET /links/infodomain + keylinkIdexternalIdcurl -s "https://api.dub.co/links/info?domain=acme.link&key=promo" \
-H "Authorization: Bearer $DUB_API_KEY" | jq '.'
GET /linksdomain, search, tagId, tagIds, tagNames, folderId, tenantId, page, pageSize, sortBy, sortOrder.curl -s "https://api.dub.co/links?page=1&pageSize=20&sortBy=createdAt&sortOrder=desc" \
-H "Authorization: Bearer $DUB_API_KEY" | jq '.'
GET /links/countcurl -s "https://api.dub.co/links/count?domain=acme.link" \
-H "Authorization: Bearer $DUB_API_KEY" | jq '.'
POST /links/bulkurl).curl -s -X POST "https://api.dub.co/links/bulk" \
-H "Authorization: Bearer $DUB_API_KEY" \
-H "Content-Type: application/json" \
-d '[{"url":"https://example.com/a"},{"url":"https://example.com/b"}]' | jq '.'
PATCH /links/bulkdata; target selection via linkIds or externalIds.curl -s -X PATCH "https://api.dub.co/links/bulk" \
-H "Authorization: Bearer $DUB_API_KEY" \
-H "Content-Type: application/json" \
-d '{"linkIds":["lnk_123","lnk_456"],"data":{"archived":true}}' | jq '.'
DELETE /links/bulklinkIds.curl -s -X DELETE "https://api.dub.co/links/bulk?linkIds=lnk_123,lnk_456" \
-H "Authorization: Bearer $DUB_API_KEY" | jq '.'
Common response fields (from LinkSchema):
iddomainkeyshortLinkurlcreatedAtupdatedAtarchivedexternalIdtagsfolderIdResult shapes by endpoint:
GET /links: array of linksGET /links/count: numberurl, linkId, filters, bulk ids).curl -s and Bearer header.jq and verify logical operation result.id, shortLink, url, and archived status when relevant./links*.linkId or GET /links/info criteria.Retry-After if present.Recommended output format:
id | domain | key | shortLink | url | createdAtThis skill must not use:
/tokens/* endpoints (including /tokens/embed/referrals).The tokens page is used only for API key onboarding, not as operational scope.
Use references/openapi-spec.json as the stable local source for methods, paths, parameters, and schemas.
共 1 个版本