Linkly Clicks API
Click analytics: time series and breakdowns by country, referrer, device and more.
Click analytics: time series and breakdowns by country, referrer, device and more.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/linklyhq-com:linklyhq-com-clicks-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Linkly URL Shortener Clicks API
version: '1.3'
description: 'The Linkly URL shortener API (also known as a link shortener API) lets you create and manage short links, track clicks, configure custom domains, and subscribe to webhooks — all programmatically.
> **You don''t need to read this documentation to use the API.** The Linkly interface shows the exact API request inline whenever you create a link or pull analytics — just copy and paste it directly into your code or terminal.
Looking for step-by-step guides, tutorials, and FAQs? The Linkly API documentation covers a broader range of topics. This page is the complete endpoint reference.
## Authentication
All API requests require an API key. You can find your API key in your Linkly workspace settings.
The recommended way is to pass it as a Bearer token in the `Authorization` header:
```
Authorization: Bearer YOUR_API_KEY
```
You can also use HTTP Basic Auth, with your API key as the username and an empty password:
```
Authorization: Basic base64(YOUR_API_KEY:)
```
Or, for quick testing, pass it as the `api_key` query parameter. Prefer the header in production — query-string keys can leak into server logs, browser history, and `Referer` headers:
```
GET https://api.linklyhq.com/api/v1/workspaces?api_key=YOUR_API_KEY
```
A request with a missing or invalid API key returns `401`; a request for a workspace your key cannot access returns `404` (workspaces you don''t belong to are not distinguished from ones that don''t exist); plan- or permission-related failures return `403`. All errors share the JSON shape documented under **Errors** below.
## Base URL
```
https://api.linklyhq.com/api/v1
```
## Workspaces
Most endpoints are scoped to a **workspace**. Use `GET /workspaces` to list your available workspaces and retrieve their IDs.
## Rate Limits
API requests are rate-limited per API key. When you exceed the limit, the API returns `429 Too Many Requests`. Check the response body for your current usage and limit.
## Errors
Errors return the appropriate HTTP status code and a JSON body with a human-readable `error` message and a stable, machine-readable `code` you can branch on:
```json
{ "error": "Not authorized", "code": "unauthorized" }
```
| Status | `code` | Meaning |
| --- | --- | --- |
| `400` | `bad_request` | Missing or malformed parameters. |
| `401` | `unauthorized` | Missing or invalid API key. |
| `403` | `forbidden` | Your plan or permissions don''t allow this action. |
| `404` | `not_found` | The resource doesn''t exist, or your key can''t access it. |
| `429` | `rate_limit_exceeded` | You''ve exceeded a rate or usage limit. |
| `500` | `internal_error` | Something went wrong on our side. |
Validation failures return `400` and may include field-level details (e.g. `{ "slug": ["is invalid"] }`) in place of the envelope above.'
termsOfService: https://linklyhq.com/support/terms
contact:
name: Linkly Ltd
email: support@linklyhq.com
url: https://linklyhq.com/support
license:
name: Proprietary (Linkly Ltd)
url: https://linklyhq.com/support/terms
x-logo:
url: https://linklyhq.com/brand/linkly-logo.svg
altText: Linkly
backgroundColor: '#FFFFFF'
servers:
- url: https://api.linklyhq.com
description: Production
security:
- bearerAuth: []
- basicAuth: []
- apiKey: []
tags:
- name: Clicks
description: 'Click analytics: time series and breakdowns by country, referrer, device and more.'
paths:
/api/v1/workspace/{workspace_id}/clicks:
get:
callbacks: {}
deprecated: false
description: Retrieve click analytics for a workspace. Filter by link, date range, country, and more. Returns time-series data suitable for charting.
operationId: getClicks
parameters:
- description: The id of the Workspace
example: '42'
in: path
name: workspace_id
required: true
schema:
type: string
- description: The id of a single Link
example: '24'
in: query
name: link_id
required: false
schema:
type: string
- description: Filter clicks by multiple links. Provide a hyphen-separated list of link IDs.
example: 24-25-26
in: query
name: link_ids
required: false
schema:
type: string
- description: 'The start date for the date range (format: YYYY-MM-DD or YYYY-MM-DDTHH:MM:SSZ)'
in: query
name: start
required: false
schema:
type: string
- description: 'The end date for the date range (format: YYYY-MM-DD or YYYY-MM-DDTHH:MM:SSZ)'
in: query
name: end
required: false
schema:
type: string
- description: Filter clicks by country using ISO 3166-1 alpha-2 country code e.g US
in: query
name: country
required: false
schema:
type: string
- description: Filter clicks by browser name e.g Chrome, Firefox, Safari
in: query
name: browser
required: false
schema:
type: string
- description: Filter clicks by platform/operating system e.g Windows, Mac, iOS, Android
in: query
name: platform
required: false
schema:
type: string
- description: Filter clicks by referrer domain
in: query
name: referer
required: false
schema:
type: string
- description: Filter clicks by Internet Service Provider name
in: query
name: isp
required: false
schema:
type: string
- description: Set to false to exclude bot clicks from the results
example: 'false'
in: query
name: bots
required: false
schema:
type: boolean
- description: Set to true to only include unique clicks in the results
example: 'false'
in: query
name: unique
required: false
schema:
type: boolean
- description: Specify the format of the response. Available options are 'json' (default), 'csv', or 'tsv'.
example: json
in: query
name: format
required: false
schema:
default: json
enum:
- json
- csv
- tsv
type: string
- description: Return data as a matrix. When pivot=link_id, returns dates as rows and links as columns. CSV/TSV includes header rows for name, full_url, and id.
example: link_id
in: query
name: pivot
required: false
schema:
enum:
- link_id
type: string
- description: The timezone to use for date/time calculations
example: America/New_York
in: query
name: timezone
required: false
schema:
type: string
- description: The frequency of data points in the response. Available options are 'day' (default) or 'hour'.
in: query
name: frequency
required: false
schema:
default: day
enum:
- day
- hour
type: string
responses:
'200':
content:
application/json:
schema:
description: Response schema for Clicks
example:
traffic:
- t: '2026-06-01'
y: 12
- t: '2026-06-02'
y: 8
- t: '2026-06-03'
y: 21
properties:
traffic:
items:
description: Response schema for Click
properties:
t:
format: date
type:
- string
- 'null'
y:
type:
- integer
- 'null'
title: ClickResponse
type: object
type: array
title: ClicksResponse
type: object
example:
traffic:
- t: '2026-09-01'
y: 12
- t: '2026-09-02'
y: 8
- t: '2026-09-03'
y: 21
description: Click
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
description: Bad Request
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
description: Forbidden
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
description: Error
security:
- apiKey: []
summary: Get click time series
tags:
- Clicks
x-linkly-docs: https://linklyhq.com/support/short-link-creation-api
/api/v1/workspace/{workspace_id}/clicks/counters/{counter}:
get:
callbacks: {}
deprecated: false
description: 'Retrieve click analytics grouped by a specific dimension (counter). Returns aggregated counts for each unique value of the selected dimension, ordered by count descending.
**A maximum of 10,000 values are returned.** High-cardinality dimensions (`destination`, `referer`, `remote_ip`, `isp`) can have far more distinct values than this on a busy workspace, in which case `values` contains only the top 10,000 by click count.
`total` is always the total clicks across *every* group, not just the returned ones — so when the result is truncated, the sum of `count` in `values` will be less than `total`. Percentages calculated as `count / total` remain accurate.'
operationId: getClickCounters
parameters:
- description: The id of the Workspace
example: '42'
in: path
name: workspace_id
required: true
schema:
type: string
- description: 'The dimension to group clicks by. Options: country, city, region, platform, destination, referer, bot_name, isp, link_id, remote_ip, top_params, ad_network, and the UTM dimensions utm_source, utm_medium, utm_campaign, utm_content, utm_term. Any other value returns 400.'
in: path
name: counter
required: true
schema:
enum:
- country
- city
- region
- platform
- destination
- referer
- bot_name
- isp
- link_id
- remote_ip
- top_params
- ad_network
- utm_source
- utm_medium
- utm_campaign
- utm_content
- utm_term
type: string
- description: The id of a single Link
example: '24'
in: query
name: link_id
required: false
schema:
type: string
- description: Hyphen-separated list of Link IDs
example: 24-25-26
in: query
name: link_ids
required: false
schema:
type: string
- description: 'The start date for the date range (format: YYYY-MM-DD)'
in: query
name: start
required: false
schema:
type: string
- description: 'The end date for the date range (format: YYYY-MM-DD)'
in: query
name: end
required: false
schema:
type: string
- description: Filter by country using ISO 3166-1 alpha-2 country code
in: query
name: country
required: false
schema:
type: string
- description: Set to false to exclude bot clicks from the results
example: 'false'
in: query
name: bots
required: false
schema:
type: boolean
- description: Set to true to only count unique clicks
example: 'false'
in: query
name: unique
required: false
schema:
type: boolean
- description: Specify the format of the response. Available options are 'json' (default), 'csv', or 'tsv'.
example: json
in: query
name: format
required: false
schema:
default: json
enum:
- json
- csv
- tsv
type: string
responses:
'200':
content:
application/json:
schema:
description: Response schema for Counters
example:
total: 215
values:
- count: 120
value: US
- count: 64
value: GB
- count: 31
value: DE
properties:
total:
description: Total clicks across all groups, including any not returned in `values`. When the result is truncated this is greater than the sum of `count` in `values`, so `count / total` still gives an accurate percentage.
type: integer
values:
description: Grouped counts, ordered by count descending. Truncated to the top 10,000 values; if the dimension has more distinct values than that, the rest are not returned.
items:
properties:
count:
type: integer
value:
type:
- string
- 'null'
type: object
maxItems: 10000
type: array
title: CountersResponse
type: object
example:
total: 215
values:
- value: US
count: 120
- value: GB
count: 64
- value: DE
count: 31
description: CounterResponse
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
description: Bad Request
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
description: Forbidden
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
description: Error
'429':
content:
application/json:
schema:
description: Rate limit exceeded error
properties:
current_usage:
type: integer
error:
type: string
limit:
type: integer
message:
type: string
title: RateLimitError
type: object
description: Rate Limit Exceeded
security:
- apiKey: []
summary: Get click breakdown by dimension
tags:
- Clicks
x-linkly-docs: https://linklyhq.com/support/short-link-creation-api
components:
schemas:
ApiError:
description: Response schema for API error
example:
error: Something went wrong
properties:
error:
type: string
title: ApiError
type: object
securitySchemes:
bearerAuth:
type: http
scheme: bearer
description: 'Authorization: Bearer <API key>. Find the key under Workspace settings > API in app.linklyhq.com.'
x-linkly-preferred: true
basicAuth:
type: http
scheme: basic
description: API key as the username, empty password.
apiKey:
type: apiKey
in: query
name: api_key
description: Query-string fallback for quick tests only.
externalDocs:
description: Linkly API guides and tutorials
url: https://linklyhq.com/support/short-link-creation-api
x-tagGroups:
- name: Links & Domains
tags:
- Links
- Domains
- Workspaces
- name: Webhooks
tags:
- Webhooks
- name: Reports
tags:
- Clicks
x-ipaas:
vendor: Linkly Ltd
website: https://linklyhq.com
support: support@linklyhq.com
brandColor: '#009EFF'
logoSvg: https://linklyhq.com/brand/linkly-logo.svg
iconSvg: https://linklyhq.com/brand/linkly-icon.svg
iconPng512: https://linklyhq.com/brand/linkly-icon.png
authTest: GET /api/v1/workspaces (200 with a JSON array proves the key)
existingIntegrations:
- Zapier
- Make
- Pipedream
- n8n
- Microsoft Power Automate (independent publisher, in review)
- MCP server
- Claude and ChatGPT connectors
suggestedTriggers:
- name: New Click
type: webhook
subscribe: POST /api/v1/workspace/{workspace_id}/webhooks
unsubscribe: DELETE /api/v1/workspace/{workspace_id}/webhooks/{hook_id}
filter: event == "click"
- name: New Click on Link
type: webhook
subscribe: POST /api/v1/link/{link_id}/webhooks
unsubscribe: DELETE /api/v1/link/{link_id}/webhooks/{hook_id}
filter: event == "click"
- name: New Link
type: webhook
subscribe: POST /api/v1/workspace/{workspace_id}/webhooks
filter: event == "link.created"
- name: New Link (polling)
type: polling
endpoint: GET /api/v1/workspace/{workspace_id}/list_links?sort_by=id&sort_dir=desc&page_size=50
dedupe: links[].id
suggestedActions:
- createOrUpdateLink
- getWorkspaceLink
- listLinks
- deleteLink
- getClicks
- getClickCounters
- listDomains
- createConversion
- listWorkspaces