MASK

Links API

Create, read, update, and delete short links. The Links API supports custom slugs, UTM parameters, device targeting, password protection, expiration, and tags.

# The link object

Fields

FieldTypeDescription
idstringUnique link identifier (e.g. lnk_abc123)
urlstringThe destination URL
short_urlstringThe full short URL including domain
slugstringThe slug portion of the short URL
domainstringThe domain used for the short link
titlestring | nullOptional title for the link
tagsstring[]Array of tag strings
clicksnumberTotal click count
utm_sourcestring | nullUTM source parameter
utm_mediumstring | nullUTM medium parameter
utm_campaignstring | nullUTM campaign parameter
utm_termstring | nullUTM term parameter
utm_contentstring | nullUTM content parameter
expires_atstring | nullISO 8601 expiration timestamp
passwordstring | nullPassword protection (write-only)
ios_targetstring | nulliOS-specific redirect URL
android_targetstring | nullAndroid-specific redirect URL
created_atstringISO 8601 creation timestamp
updated_atstringISO 8601 last update timestamp

# Query parameters

Filtering and pagination

The following query parameters are available on the GET /v1/links endpoint.

ParameterTypeDefaultDescription
pagenumber1Page number for pagination
per_pagenumber50Items per page (max 100)
searchstring-Search links by URL, slug, or title
tagstring-Filter by tag name
domainstring-Filter by domain
sortstringcreated_atSort field: created_at, clicks, updated_at
orderstringdescSort order: asc or desc
created_afterstring-ISO 8601 date filter
created_beforestring-ISO 8601 date filter
POST/v1/links

Create a link

Create a new short link. If no slug is provided, a random one is generated. If no domain is specified, the workspace default domain is used.

Request body

{
  "url": "https://example.com/my-page",
  "slug": "my-link",
  "domain": "go.yourbrand.com",
  "title": "My Campaign Link",
  "tags": ["campaign-q1", "social"],
  "utm_source": "twitter",
  "utm_medium": "social",
  "expires_at": "2026-12-31T23:59:59Z"
}

Response

{
  "id": "lnk_abc123",
  "url": "https://example.com/my-page",
  "short_url": "https://go.yourbrand.com/my-link",
  "slug": "my-link",
  "domain": "go.yourbrand.com",
  "title": "My Campaign Link",
  "tags": ["campaign-q1", "social"],
  "clicks": 0,
  "created_at": "2026-03-13T10:00:00Z",
  "updated_at": "2026-03-13T10:00:00Z"
}
GET/v1/links

List links

Retrieve a paginated list of links in the workspace. Supports filtering by tag, domain, search query, and date range.

Response

{
  "data": [
    {
      "id": "lnk_abc123",
      "url": "https://example.com/my-page",
      "short_url": "https://go.yourbrand.com/my-link",
      "slug": "my-link",
      "clicks": 142,
      "created_at": "2026-03-13T10:00:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "per_page": 50,
    "total": 234,
    "total_pages": 5
  }
}
GET/v1/links/:id

Get a link

Retrieve a single link by its ID. Returns all link fields including UTM parameters and device targets.

Response

{
  "id": "lnk_abc123",
  "url": "https://example.com/my-page",
  "short_url": "https://go.yourbrand.com/my-link",
  "slug": "my-link",
  "domain": "go.yourbrand.com",
  "tags": ["campaign-q1"],
  "clicks": 142,
  "created_at": "2026-03-13T10:00:00Z",
  "updated_at": "2026-03-13T10:00:00Z"
}
PATCH/v1/links/:id

Update a link

Update one or more fields on an existing link. Only the fields you include in the request body are updated. The slug and domain cannot be changed after creation.

Request body

{
  "url": "https://example.com/updated-page",
  "tags": ["campaign-q2", "email"],
  "expires_at": "2027-06-30T23:59:59Z"
}

Response

{
  "id": "lnk_abc123",
  "url": "https://example.com/updated-page",
  "short_url": "https://go.yourbrand.com/my-link",
  "slug": "my-link",
  "tags": ["campaign-q2", "email"],
  "expires_at": "2027-06-30T23:59:59Z",
  "updated_at": "2026-03-13T12:00:00Z"
}
DELETE/v1/links/:id

Delete a link

Permanently delete a link. The short URL will stop redirecting immediately. This action cannot be undone.

Response

{
  "deleted": true,
  "id": "lnk_abc123"
}

Start creating links via the API.

Generate your API key and create your first short link in seconds.

Get Started

Ready to get started?

Start building with a free account.
Speak to an expert for your Pro or Enterprise needs.

Explore MASK Enterprise

with an interactive product tour,
trial, or a personalized demo.