GET
/
v1
/
teams
/
{teamId}
/
shortlinks
/
{id}
/
clicks
TypeScript client
import { OctosparkClient } from '@octospark/sdk'

const client = new OctosparkClient({
  token: process.env.OCTOSPARK_TOKEN
})

const response = await client.shortlinks.getClicksByDimension({
  teamId: process.env.OCTOSPARK_TEAM_ID ?? "teamId",
  id: process.env.OCTOSPARK_ID ?? "id",
  query: {
    "groupBy": process.env.OCTOSPARK_GROUP_BY ?? "groupBy",
  },
})
{
  "buckets": [
    {
      "key": "<string>",
      "humanClicks": 123
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

teamId
string
required

Team (workspace) id (UUID). Discover ids via the list teams endpoint or the agent context.

id
string
required

Shortlink id (UUID), as returned by the list shortlinks endpoint.

Query Parameters

groupBy
enum<string>
required

Dimension to bucket the shortlink's clicks by, e.g. referrer, country, or device.

Available options:
platform,
placement,
display_mode,
content_type,
target_domain,
referrer,
device,
country
from
string

Start of the click window, ISO 8601 timestamp (inclusive); omit for all time.

Example:

"2026-06-01T00:00:00Z"

to
string

End of the click window, ISO 8601 timestamp (inclusive); omit for all time.

Example:

"2026-06-30T23:59:59Z"

Response

Success

dimension
enum<string>
required
Available options:
platform,
placement,
display_mode,
content_type,
target_domain,
referrer,
device,
country
buckets
object[]
required