# Shlink

> Shorten links on your own Shlink server from workflows, with custom slugs, tags, domains and limits, read their visits by day, referrer and country, and make QR codes. Start a workflow when a short link is visited, made, or reaches a number of visits.

App · 9 actions. Web page: https://docs.lodol.com/docs/integrations/shlink

## Actions

### Delete short URL

Delete a short URL and its visits from Shlink. The short link stops working, and it can't be restored from Lodol.

**Inputs**

- Short URL (`short_url`, text, required): The short link, such as https://s.example.com/spring-sale, or its short code (spring-sale) from another Shlink step or the trigger. Capitals matter.
- Domain (`domain`, text): The short URL's domain, when it isn't on the server's default domain and is named by its short code alone. Leave blank otherwise.

**Outputs**

- `deleted` (true/false): Whether the short URL was deleted
- `domain` (text): The domain it was on
- `long_url` (text): The address it opened
- `short_code` (text): Its short code
- `short_url` (text): The short link, which no longer works
- `title` (text): Its title
- `visits` (number): How many visits it had, deleted with it

**Example output**

```json
{
  "deleted": true,
  "domain": "s.example.com",
  "long_url": "https://example.com/spring-sale?utm_source=newsletter",
  "short_code": "spring-sale",
  "short_url": "https://s.example.com/spring-sale",
  "title": "Spring sale",
  "visits": 42
}
```

### Find short URLs

Find short URLs by words in their address, title or code, by tag or by domain, newest or most visited first.

**Inputs**

- Search for (`search`, text): Words to find in the long URL, title, short code or tags. Leave blank for every short URL.
- Tags (`tags`, list): Only short URLs with any of these tags.
- Domain (`domain`, text): Only short URLs on this domain. Leave blank for every domain.
- Order (`order`, text): Which come first. Defaults to newest. One of: `newest` (Newest first), `oldest` (Oldest first), `most_visited` (Most visited first), `least_visited` (Least visited first), `title` (Title, A to Z). Default: `newest`.
- Only working ones (`active_only`, true/false): Leave out short URLs past their Valid until date or their most visits. Default: `false`.
- How many (`limit`, number): The most to list. Defaults to 25. From 1 to 100.

**Outputs**

- `count` (number): How many are listed
- `short_urls` (list): The short URLs
- `total` (number): How many there are in all

**Example output**

```json
{
  "count": 1,
  "short_urls": [
    {
      "bot_visits": 3,
      "created_at": "2026-11-06T10:00:00+00:00",
      "domain": "s.example.com",
      "human_visits": 39,
      "long_url": "https://example.com/spring-sale?utm_source=newsletter",
      "max_visits": 0,
      "short_code": "spring-sale",
      "short_url": "https://s.example.com/spring-sale",
      "tags": [
        "campaign",
        "newsletter"
      ],
      "title": "Spring sale",
      "valid_since": "",
      "valid_until": "2026-12-31T23:59:59+00:00",
      "visits": 42
    }
  ],
  "total": 1
}
```

### Get QR code

Make a QR code image of a short link, as a file to attach to an email, put on a poster or upload.

**Inputs**

- Short URL (`short_url`, text, required): The short link, such as https://s.example.com/spring-sale, or its short code (spring-sale) from another Shlink step or the trigger. Capitals matter.
- Domain (`domain`, text): The short URL's domain, when it isn't on the server's default domain and is named by its short code alone. Leave blank otherwise.
- Size (`size`, text): How big the image is. Defaults to medium. One of: `small` (Small (200 pixels)), `medium` (Medium (400 pixels)), `large` (Large (800 pixels)). Default: `medium`.
- File type (`file_format`, text): PNG suits email and the web; SVG stays sharp at any size, for print. Defaults to PNG. One of: `png` (PNG image), `svg` (SVG (sharp at any size, for print)). Default: `png`.

**Outputs**

- `content_type` (text): The file's type, such as image/png
- `document_ref` (text): The QR code in Lodol, to pass to a later step
- `documents` (list): The QR code image, in the shape steps that send or upload files expect
- `filename` (text): The file's name, such as spring-sale-qr-code.png
- `short_code` (text): Its short code
- `short_url` (text): The short link the QR code opens
- `size_bytes` (number): The file's size in bytes
- `url` (text): A link to the file in Lodol

**Example output**

```json
{
  "content_type": "image/png",
  "document_ref": "doc_6f1d3c1e58a14c879a4b2f5e",
  "documents": [
    {
      "content_type": "image/png",
      "document_ref": "doc_6f1d3c1e58a14c879a4b2f5e",
      "filename": "spring-sale-qr-code.png",
      "size_bytes": 1234,
      "url": "/actions/core/serve-document/doc_6f1d3c1e58a14c879a4b2f5e?teamId=0"
    }
  ],
  "filename": "spring-sale-qr-code.png",
  "short_code": "spring-sale",
  "short_url": "https://s.example.com/spring-sale",
  "size_bytes": 1234,
  "url": "/actions/core/serve-document/doc_6f1d3c1e58a14c879a4b2f5e?teamId=0"
}
```

### Get short URL

Get a short URL's details: where it goes, its title, tags and limits, and how many visits it has had.

**Inputs**

- Short URL (`short_url`, text, required): The short link, such as https://s.example.com/spring-sale, or its short code (spring-sale) from another Shlink step or the trigger. Capitals matter.
- Domain (`domain`, text): The short URL's domain, when it isn't on the server's default domain and is named by its short code alone. Leave blank otherwise.

**Outputs**

- `bot_visits` (number): Visits Shlink thinks came from bots or link previews
- `created_at` (text): When it was made (ISO 8601)
- `domain` (text): The domain it's on, such as s.example.com
- `human_visits` (number): Visits Shlink doesn't think came from bots
- `long_url` (text): The address it opens
- `max_visits` (number): The most visits it takes before it stops; 0 for no limit
- `short_code` (text): The short code at the end of the short link, such as spring-sale
- `short_url` (text): The short link, such as https://s.example.com/spring-sale
- `tags` (list): Its tags, in lower case
- `title` (text): Its title; empty when it has none
- `valid_since` (text): When it starts working (ISO 8601); empty when it always has
- `valid_until` (text): When it stops working (ISO 8601); empty when it never does
- `visits` (number): How many times it has been visited

**Example output**

```json
{
  "bot_visits": 3,
  "created_at": "2026-11-06T10:00:00+00:00",
  "domain": "s.example.com",
  "human_visits": 39,
  "long_url": "https://example.com/spring-sale?utm_source=newsletter",
  "max_visits": 0,
  "short_code": "spring-sale",
  "short_url": "https://s.example.com/spring-sale",
  "tags": [
    "campaign",
    "newsletter"
  ],
  "title": "Spring sale",
  "valid_since": "",
  "valid_until": "2026-12-31T23:59:59+00:00",
  "visits": 42
}
```

### Get visits

Count and list the visits to a short URL, a tag's short URLs or every short URL, in a period you choose, with visits per day and the referrers and countries they came from most.

**Inputs**

- Short URL (`short_url`, text): The short link or its short code. Leave blank for a tag's or every short URL's visits.
- Domain (`domain`, text): The domain of a short URL named by its code, or, with no short URL, only visits to this domain's short URLs.
- Tag (`tag`, text): Only visits to short URLs with this tag, when no short URL is given.
- Since (`since`, date and time): Only visits from this time. Leave blank for all.
- Until (`until`, date and time): Only visits up to this time; a date alone means the end of that day (UTC). Leave blank for now.
- Skip bots (`skip_bots`, true/false): Leave out visits Shlink thinks came from bots, such as link previews in chat apps and search engines. Default: `false`.
- How many to list (`limit`, number): The most visits to list, newest first. Defaults to 25; the counts cover every visit. From 1 to 100.

**Outputs**

- `bots` (number): How many of the visits read look like bots
- `by_day` (list): Visits per day, oldest first
- `count` (number): How many visits are listed
- `counted` (number): How many visits were read for the counts by day, referrer and country (the newest 5,000 at most)
- `countries` (list): The countries visits came from most; empty unless the server looks up locations
- `referrers` (list): The sites visitors came from most, with direct for none
- `total` (number): How many visits there were in the period
- `visits` (list): The newest visits, newest first

**Example output**

```json
{
  "bots": 3,
  "by_day": [
    {
      "date": "2026-11-06",
      "visits": 42
    }
  ],
  "count": 1,
  "counted": 42,
  "countries": [
    {
      "country": "United Kingdom",
      "visits": 25
    }
  ],
  "referrers": [
    {
      "referrer": "news.example.net",
      "visits": 30
    }
  ],
  "total": 42,
  "visits": [
    {
      "bot": false,
      "city": "London",
      "country": "United Kingdom",
      "country_code": "GB",
      "date": "2026-11-06T10:15:00+00:00",
      "redirected_to": "https://example.com/spring-sale?utm_source=newsletter",
      "referrer": "https://news.example.net/article",
      "referrer_site": "news.example.net",
      "region": "England",
      "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X)",
      "visited_url": "https://s.example.com/spring-sale"
    }
  ]
}
```

### List domains

List the domains short links can be made on, the default one first.

**Inputs**: None.

**Outputs**

- `count` (number): How many are listed
- `domains` (list): The domains

**Example output**

```json
{
  "count": 1,
  "domains": [
    {
      "domain": "s.example.com",
      "is_default": true
    }
  ]
}
```

### List tags

List every tag, A to Z, with how many short URLs and visits each has.

**Inputs**: None.

**Outputs**

- `count` (number): How many are listed
- `tags` (list): The tags

**Example output**

```json
{
  "count": 1,
  "tags": [
    {
      "human_visits": 401,
      "short_urls": 12,
      "tag": "campaign",
      "visits": 420
    }
  ]
}
```

### Shorten a link

Make a short link for a long address, such as a campaign link or a shared document, with your own ending, a title and tags, on the domain you choose, and limits on when and how often it works.

**Inputs**

- Long URL (`long_url`, text, required): The address the short link opens. https:// is added when it has none.
- Custom slug (`custom_slug`, text): What the short link ends with, such as spring-sale for s.example.com/spring-sale. Spaces become hyphens. Leave blank for a random code.
- Title (`title`, text): A name for the short URL, shown in Shlink.
- Tags (`tags`, list): Tags to group it by, such as campaign.
- Domain (`domain`, text): The domain the short link is on, for a server with more than one. Leave blank for the default domain.
- Valid since (`valid_since`, date and time): When the short link starts working. Leave blank for now.
- Valid until (`valid_until`, date and time): When it stops working. A date alone means the end of that day (UTC). Leave blank for never.
- Most visits (`max_visits`, number): How many visits it takes before it stops working. Leave blank for no limit. At least 1.
- Reuse an existing one (`find_if_exists`, true/false): Give back the short URL already made for this link with the same slug, tags and limits instead of making another, so a workflow that runs again doesn't pile up short links. Default: `false`.

**Outputs**

- `bot_visits` (number): Visits Shlink thinks came from bots or link previews
- `created_at` (text): When it was made (ISO 8601)
- `domain` (text): The domain it's on, such as s.example.com
- `human_visits` (number): Visits Shlink doesn't think came from bots
- `long_url` (text): The address it opens
- `max_visits` (number): The most visits it takes before it stops; 0 for no limit
- `short_code` (text): The short code at the end of the short link, such as spring-sale
- `short_url` (text): The short link, such as https://s.example.com/spring-sale
- `tags` (list): Its tags, in lower case
- `title` (text): Its title; empty when it has none
- `valid_since` (text): When it starts working (ISO 8601); empty when it always has
- `valid_until` (text): When it stops working (ISO 8601); empty when it never does
- `visits` (number): How many times it has been visited

**Example output**

```json
{
  "bot_visits": 3,
  "created_at": "2026-11-06T10:00:00+00:00",
  "domain": "s.example.com",
  "human_visits": 39,
  "long_url": "https://example.com/spring-sale?utm_source=newsletter",
  "max_visits": 0,
  "short_code": "spring-sale",
  "short_url": "https://s.example.com/spring-sale",
  "tags": [
    "campaign",
    "newsletter"
  ],
  "title": "Spring sale",
  "valid_since": "",
  "valid_until": "2026-12-31T23:59:59+00:00",
  "visits": 42
}
```

### Update short URL

Change where a short URL goes, its title or tags, or when and how often it works. Fields left blank keep what it has.

**Inputs**

- Short URL (`short_url`, text, required): The short link, such as https://s.example.com/spring-sale, or its short code (spring-sale) from another Shlink step or the trigger. Capitals matter.
- Domain (`domain`, text): The short URL's domain, when it isn't on the server's default domain and is named by its short code alone. Leave blank otherwise.
- Long URL (`long_url`, text): A new address for it to open. Leave blank to keep it.
- Title (`title`, text): A new title. Leave blank to keep it.
- Tags (`tags`, list): Tags that replace its tags. Leave blank to keep them.
- Add tags (`add_tags`, list): Tags to add, keeping the ones it has, such as shared.
- Valid since (`valid_since`, date and time): A new time for it to start working. Leave blank to keep it.
- Valid until (`valid_until`, date and time): A new time for it to stop working; a date alone means the end of that day (UTC). Leave blank to keep it.
- Most visits (`max_visits`, number): A new most visits before it stops working. Leave blank to keep it. At least 1.
- Remove limits (`remove_limits`, true/false): Clear its Valid since, Valid until and Most visits, so it works again for good. Limits given in this step still apply. Default: `false`.

**Outputs**

- `bot_visits` (number): Visits Shlink thinks came from bots or link previews
- `created_at` (text): When it was made (ISO 8601)
- `domain` (text): The domain it's on, such as s.example.com
- `human_visits` (number): Visits Shlink doesn't think came from bots
- `long_url` (text): The address it opens
- `max_visits` (number): The most visits it takes before it stops; 0 for no limit
- `short_code` (text): The short code at the end of the short link, such as spring-sale
- `short_url` (text): The short link, such as https://s.example.com/spring-sale
- `tags` (list): Its tags, in lower case
- `title` (text): Its title; empty when it has none
- `valid_since` (text): When it starts working (ISO 8601); empty when it always has
- `valid_until` (text): When it stops working (ISO 8601); empty when it never does
- `visits` (number): How many times it has been visited

**Example output**

```json
{
  "bot_visits": 3,
  "created_at": "2026-11-06T10:00:00+00:00",
  "domain": "s.example.com",
  "human_visits": 39,
  "long_url": "https://example.com/spring-sale?utm_source=newsletter",
  "max_visits": 0,
  "short_code": "spring-sale",
  "short_url": "https://s.example.com/spring-sale",
  "tags": [
    "campaign",
    "newsletter"
  ],
  "title": "Spring sale",
  "valid_since": "",
  "valid_until": "2026-12-31T23:59:59+00:00",
  "visits": 42
}
```
