---
title: "Clicks on a post's short links"
method: GET
path: "/posts/{id}/link-clicks"
tags: ["Posts"]
---

# Clicks on a post's short links

`GET /posts/{id}/link-clicks`

## Request

- Base URL: `https://www.sociahive.com/api/v1`
- URL: `https://www.sociahive.com/api/v1/posts/{id}/link-clicks`
- Auth: one of:
  - API key in header `X-API-Key`
  - OAuth 2 (authorization code, authorization URL `/api/oauth/authorize`, token URL `/api/oauth/token`, scopes: `posts:read`)

Links in a post are shortened to https://www.sociahive.com/l/<code> when it is published (per the account's short link setting). Each link counts its clicks per day; this returns every short link of the post with its total and the last 30 days. A post with no short links returns an empty `links` array.

## Path parameters

- `id` string, required: MongoDB ObjectId (24-character hex string)

## Response `200`

Link clicks

- object
  - `success` true, required
  - `data` LinkClicks, required
    - `post_id` string, required: MongoDB ObjectId (24-character hex string)
    - `links` object[], required
      - `post_link_id` string, required: MongoDB ObjectId (24-character hex string)
      - `code` string, required: The `/l/<code>` path segment.
      - `target_key` string, required: `<platform>:<account_id>` of the target the link was made for.
      - `destination_url` string, uri, required
      - `total` integer, required: Clicks since the link was made. Link previews and crawlers are not counted.
      - `daily` object[], required: The last 30 days, oldest first.
        - `day` string, required: UTC day, YYYY-MM-DD.
        - `clicks` integer, required

## Other responses

- `400`: Bad request — invalid parameters
- `401`: Authentication required — provide X-API-Key or Bearer token
- `403`: Insufficient scope for this operation
- `404`: Post not found
- `429`: Rate limit exceeded
- `500`: Internal server error

---

[API](https://skmtc.dev/sociahive/apis/sociahive-api.md) · [All operations](https://skmtc.dev/sociahive/apis/sociahive-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sociahive/apis/sociahive-api/revisions/791b8548d288?raw)
