← Back to Skills Marketplace
ferminrp

Dub.co Links API

cross-platform ⚠ suspicious
724
Downloads
0
Stars
0
Active Installs
2
Versions
Install in OpenClaw
/install dub-links-api
Description
Integrates Dub Links API endpoints to create, update, delete, retrieve, list, count, and run bulk operations on short links. Use when the user asks for "dub...
README (SKILL.md)

Dub Links API

Skill for integrating Dub Links API with strict scope limited to /links* endpoints.

API Overview

  • Base URL: https://api.dub.co
  • Auth: Bearer token required
  • Header: Authorization: Bearer \x3CDUB_API_KEY>
  • Response format: JSON
  • Scope: Links endpoints only
  • Docs: https://dub.co/docs/api-reference/endpoint/create-a-link
  • Token docs (onboarding): https://dub.co/docs/api-reference/tokens
  • Local snapshot: references/openapi-spec.json

API Key Onboarding

Use this flow when the user does not have an API key yet:

  1. Create a Dub account/workspace (if needed).
  2. Go to the dashboard token section (per docs):
    • https://dub.co/docs/api-reference/tokens
  3. Generate an API key and export it in shell:
    • export DUB_API_KEY="..."
  4. Validate credentials with a Links endpoint:
    • 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

Links Endpoints

1) Create

  • POST /links
  • Creates a link in the authenticated workspace.
  • Minimum recommended body: url.
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 '.'

2) Update

  • PATCH /links/{linkId}
  • Updates an existing link by 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 '.'

3) Upsert

  • PUT /links/upsert
  • If a link with the same URL exists, returns/updates it; otherwise creates it.
curl -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 '.'

4) Delete

  • DELETE /links/{linkId}
  • Deletes a link by linkId.
curl -s -X DELETE "https://api.dub.co/links/{linkId}" \
  -H "Authorization: Bearer $DUB_API_KEY" | jq '.'

5) Retrieve one

  • GET /links/info
  • Retrieves a link by one of these selectors:
    • domain + key
    • linkId
    • externalId
curl -s "https://api.dub.co/links/info?domain=acme.link&key=promo" \
  -H "Authorization: Bearer $DUB_API_KEY" | jq '.'

6) List

  • GET /links
  • Returns paginated list with filters.
  • Common query params: domain, 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 '.'

7) Count

  • GET /links/count
  • Returns number of links for the provided filters.
curl -s "https://api.dub.co/links/count?domain=acme.link" \
  -H "Authorization: Bearer $DUB_API_KEY" | jq '.'

8) Bulk create

  • POST /links/bulk
  • Creates up to 100 links.
  • Body: array of objects (each item should include url).
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 '.'

9) Bulk update

  • PATCH /links/bulk
  • Updates up to 100 links.
  • Body requires data; 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 '.'

10) Bulk delete

  • DELETE /links/bulk
  • Deletes up to 100 links.
  • Required query param: linkIds.
curl -s -X DELETE "https://api.dub.co/links/bulk?linkIds=lnk_123,lnk_456" \
  -H "Authorization: Bearer $DUB_API_KEY" | jq '.'

Key Fields

Common response fields (from LinkSchema):

  • id
  • domain
  • key
  • shortLink
  • url
  • createdAt
  • updatedAt
  • archived
  • externalId
  • tags
  • folderId

Result shapes by endpoint:

  • GET /links: array of links
  • GET /links/count: number
  • Bulk endpoints: array/object depending on operation

Recommended Workflow

  1. Detect intent: create/update/upsert/delete/get/list/count/bulk.
  2. Validate minimum inputs (url, linkId, filters, bulk ids).
  3. Execute request with curl -s and Bearer header.
  4. Parse with jq and verify logical operation result.
  5. Respond first with a useful snapshot:
    • id, shortLink, url, and archived status when relevant.
  6. For lists, provide a short table with relevant columns.
  7. Keep strict scope on /links*.

Error Handling

  • 401/403: missing, invalid, or unauthorized token.
  • 404: link not found for linkId or GET /links/info criteria.
  • 422: invalid payload (missing/invalid fields).
  • 429: rate limited; respect Retry-After if present.
  • Network/timeout: retry up to 2 times with short delay.
  • Unexpected JSON: return minimal raw output and warn about inconsistency.

Presenting Results

Recommended output format:

  • Executive summary (action + result).
  • Short table for multiple links:
    • id | domain | key | shortLink | url | createdAt
  • For bulk operations:
    • requested total, processed total, errors if any.
  • Clarify data is scoped to the authenticated workspace.

Out of Scope

This skill must not use:

  • Analytics, events, conversions, partners, customers, commissions, payouts endpoints.
  • Domains, folders, tags endpoints.
  • /tokens/* endpoints (including /tokens/embed/referrals).

The tokens page is used only for API key onboarding, not as operational scope.

OpenAPI Spec

Use references/openapi-spec.json as the stable local source for methods, paths, parameters, and schemas.

Usage Guidance
This skill appears to do what it says (operate only on /links endpoints), but the manifest omits important runtime requirements. Before installing: (1) confirm how the platform will collect and store the DUB_API_KEY (the SKILL.md expects you to export it), and prefer a secure credential store rather than pasting into shell history; (2) ensure curl and jq are available where the agent runs (examples assume them); (3) verify the minimal API key permissions/scope on dub.co and avoid using highly privileged keys; (4) ask the publisher to update the skill metadata to declare required env vars (DUB_API_KEY) and required binaries, or decline until that is fixed. These inconsistencies are probably sloppy packaging rather than malicious, but they materially affect security and operational behavior.
Capability Analysis
Type: OpenClaw Skill Name: dub-links-api Version: 1.0.1 The skill bundle is designed to interact with the Dub Links API using `curl` commands, as demonstrated in `SKILL.md`. While the examples themselves are benign and the skill explicitly defines 'Out of Scope' actions, the instruction for the AI agent to construct and execute `curl` commands based on user input introduces a shell injection vulnerability. If the agent fails to properly sanitize user-provided data before interpolating it into the `curl` command's URL, headers, or body, it could lead to arbitrary command execution. This is a vulnerability (RCE risk) rather than intentional malice, classifying it as suspicious.
Capability Assessment
Purpose & Capability
The skill's stated purpose (Dub Links API) matches the instructions (calls to https://api.dub.co/links*). However, the SKILL.md repeatedly requires a bearer token (DUB_API_KEY) and examples use curl and jq, yet the skill metadata declares no required env vars or binaries. That mismatch suggests the manifest is incomplete or misleading.
Instruction Scope
SKILL.md confines behavior to /links* endpoints and documents onboarding, token export, and curl/jq usage. The instructions tell an agent to export and use DUB_API_KEY and to run curl commands (including retries), and to parse output with jq. There is no instruction to read or send unrelated system files, but the guidance to 'export' tokens and run shell commands means the agent will handle secrets and invoke network calls — expected for this API but not reflected in declared requirements.
Install Mechanism
This is an instruction-only skill with no install spec and no code files, lowering disk-write/execution risk. The included OpenAPI JSON is a local API spec snapshot (large but expected).
Credentials
The skill requires a bearer token (DUB_API_KEY) to operate per SKILL.md, but the registry lists no required environment variables or primary credential. Asking users to export an API key is reasonable for this integration, but the absence of that declaration is a proportionality/integrity issue: the platform or manifest should explicitly declare the required credential and how it will be stored/used.
Persistence & Privilege
always is false, no install steps, and the skill does not request persistent system-level changes. Autonomous invocation is allowed (platform default) but not combined with other high-risk flags.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install dub-links-api
  3. After installation, invoke the skill by name or use /dub-links-api
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
- Full documentation translated from Spanish to English for broader accessibility. - All endpoint descriptions, onboarding steps, and example requests now provided in English. - Skill description and scope clarified using standard English terminology. - No functional/API changes—documentation update only; no code or logic changes.
v1.0.0
Initial release of dub-links-api skill: - Integrates Dub Links API for creating, updating, deleting, retrieving, listing, counting, and bulk operations on short links via `/links*` endpoints. - Provides onboarding instructions for obtaining and verifying a Dub API key. - Documents endpoints for standard and bulk operations: create, update, upsert, delete, retrieve, list, count, and bulk modifications. - Details error handling procedures and recommended response formats. - Strictly limited to `/links*` endpoints—analytics, domains, and token management endpoints are out of scope. - Includes sample cURL commands and key response fields to guide usage.
Metadata
Slug dub-links-api
Version 1.0.1
License
All-time Installs 0
Active Installs 0
Total Versions 2
Frequently Asked Questions

What is Dub.co Links API?

Integrates Dub Links API endpoints to create, update, delete, retrieve, list, count, and run bulk operations on short links. Use when the user asks for "dub... It is an AI Agent Skill for Claude Code / OpenClaw, with 724 downloads so far.

How do I install Dub.co Links API?

Run "/install dub-links-api" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Dub.co Links API free?

Yes, Dub.co Links API is completely free (open-source). You can download, install and use it at no cost.

Which platforms does Dub.co Links API support?

Dub.co Links API is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Dub.co Links API?

It is built and maintained by Fermin Rodriguez Penelas (@ferminrp); the current version is v1.0.1.

💬 Comments