Shlink icon

Shlink

Interact with Shlink URL Shortener API

Actions12

Overview

This node integrates with the Shlink URL Shortener API to manage short URLs. Specifically, the Update operation for the Short URL resource allows users to modify properties of an existing short URL identified by its short code. This is useful when you want to change the destination long URL, update metadata like tags or title, or adjust access restrictions such as maximum visits or validity period.

Practical examples include:

  • Correcting a typo in the original long URL without creating a new short URL.
  • Adding or updating descriptive tags to organize URLs better.
  • Setting or changing the maximum number of allowed visits to limit usage.
  • Defining a validity window during which the short URL is active.

Properties

Name Meaning
Short Code The unique short code identifying the short URL to update.
Update Fields Collection of fields to update on the short URL:
- Long URL: New destination URL for the short URL.
- Tags: Comma-separated list of tags to apply to the short URL.
- Title: A descriptive title for the short URL.
- Max Visits: Maximum number of visits allowed (0 means unlimited).
- Valid Since: Date/time from which the short URL becomes valid.
- Valid Until: Date/time until which the short URL remains valid.

Output

The node outputs JSON data representing the updated short URL object returned by the Shlink API. This typically includes all details of the short URL after modification, such as:

  • The short code
  • The updated long URL
  • Tags array
  • Title
  • Visit limits and counts
  • Validity dates
  • Other metadata managed by Shlink

No binary data output is produced by this operation.

Dependencies

  • Requires connection to a Shlink URL Shortener instance via its REST API.
  • Needs an API key credential configured in n8n for authentication.
  • The base URL of the Shlink server must be provided and should start with http:// or https://. If missing, https:// is automatically prefixed.

Troubleshooting

  • Invalid Short Code: If the specified short code does not exist, the API will return an error. Verify the short code is correct.
  • Authentication Errors: Ensure the API key credential is valid and has sufficient permissions.
  • Invalid Field Values: For example, setting maxVisits to a negative number or invalid date formats for validSince/validUntil may cause errors.
  • Network Issues: Check connectivity to the Shlink server and that the base URL is correctly set.
  • API Version Mismatch: The node uses version 3 of the Shlink API endpoints; ensure your Shlink instance supports this version.

If an error occurs, the node logs detailed debug information including request URLs and response data to help diagnose issues.

Links and References

Discussion