# Tracked links API reference

Base URL `https://api.beplan.io/v1`. Every operation is listed with its scope, permission, inputs, answers, errors and an example. Conventions: https://beplan.io/docs/api.md. OpenAPI document: https://beplan.io/docs/api/openapi.json.

## List a post's tracked links with their clicks

`GET /organizations/{organizationId}/workspaces/{workspaceId}/insights/posts/{postId}/tracked-links` · operationId `trackedLinks.forPost.list`

- Scope: `links:write`
- Role permission: Any member who can see it
- Effect (`read`): Changes nothing.
- Stability: Beta (May still change before it is marked stable.) Since 2026-11-20.

Returns the stats of every tracked link a post went out with, newest link first, each across every post using it: the post's own publications are the `placements` with its `postId`. `platforms` adds every publication up per platform, most clicked first; `placements` lists each publication (post × account) carrying the link with its own short URL and clicks, most clicked first; `days` covers the last 30 UTC days, oldest first, with empty days at 0. Clicks are counts only (a bot's first hit on a code may count); nothing about visitors is stored. An empty list when the post carried none, and also for an unknown post or one of another workspace (no 404). Any member who sees the workspace can read it.

**Parameters**

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `organizationId` | path | string | yes | 1–128 characters |
| `workspaceId` | path | string (uuid) | yes |  |
| `postId` | path | string (uuid) | yes |  |

**200 OK**

- `data` (array of object, required)
  - `link` (object, required, TrackedLink)
    - `id` (string, required): The tracked link's id (a UUID). Write `{{link:<id>}}` in a caption to share it.
    - `url` (string, required): The destination the short links redirect to, as created.
    - `createdAt` (string (date-time), required): When the tracked link was created, ISO 8601 UTC.
    - `clicks` (number, required): Clicks so far, every publication added up. A count only: nothing about the visitors is stored (no countries, devices, referrers or unique visitors).
    - `placements` (number, required): How many publications carry it: one per post and account that went out with it (each has its own short link).
  - `platforms` (array of object, required)
    - `platform` (string, required)
    - `clicks` (number, required)
  - `placements` (array of object, required)
    - `id` (string, required): The publication's placement id (a UUID).
    - `postId` (string, required): The post that went out with the link (it may have been deleted since).
    - `postTitle` (string, required): The post's title; `""` when it has none or was deleted since.
    - `socialAccountId` (string, required): The account it went out on (it may have been removed since).
    - `platform` (string, required): The account's platform (`instagram`, `x`, `tiktok`…), kept after the account is removed.
    - `username` (string, required, nullable): The account's handle; `null` when the account was removed.
    - `shortUrl` (string, required): The short link this publication carries (`https://bpln.to/<8 characters>`).
    - `clicks` (number, required): Clicks on this publication's short link so far.
    - `createdAt` (string (date-time), required): When the publication went out with the link, ISO 8601 UTC.
  - `days` (array of object, required)
    - `day` (string, required): A UTC day, `YYYY-MM-DD`.
    - `clicks` (number, required)

**Errors**

| Status | Code | Message |
|---|---|---|
| 400 | `VALIDATION_FAILED` | Some of the information sent is invalid. |
| 404 | `ORGANIZATION_NOT_FOUND` | This organization doesn't exist or you're not a member of it. |
| 404 | `WORKSPACE_NOT_FOUND` | This workspace doesn't exist or you don't have access to it. |

Also, like every operation: `APP_SUSPENDED` (401), `TOKEN_EXPIRED` (401), `TOKEN_REVOKED` (401), `UNAUTHENTICATED` (401), `INSUFFICIENT_SCOPE` (403), `INTEGRATION_BLOCKED_BY_ORGANIZATION` (403), `INTEGRATION_PENDING_APPROVAL` (403), `RATE_LIMITED` (429), `INTERNAL_ERROR` (500).

**Example: A post with one tracked link**

```bash
curl -X GET "https://api.beplan.io/v1/organizations/ORGANIZATION_ID/workspaces/WORKSPACE_ID/insights/posts/6f1c2a3b-4d5e-4f60-8a71-92b3c4d5e6f7/tracked-links" \
  -H "Authorization: Bearer beplan_pat_…"
```

Answers 200:

```json
{
  "data": [
    {
      "link": {
        "id": "5d2c8e1a-3b4f-4a6d-9e7c-1f2a3b4c5d6e",
        "url": "https://shop.example.com/drop",
        "createdAt": "2026-11-18T09:30:00.000Z",
        "clicks": 42,
        "placements": 1
      },
      "platforms": [
        {
          "platform": "instagram",
          "clicks": 42
        }
      ],
      "placements": [
        {
          "id": "7a6b5c4d-3e2f-4a1b-8c9d-0e1f2a3b4c5d",
          "postId": "6f1c2a3b-4d5e-4f60-8a71-92b3c4d5e6f7",
          "postTitle": "Spring drop teaser",
          "socialAccountId": "0b6f5c1e-2a7d-4c3b-9e8f-1a2b3c4d5e6f",
          "platform": "instagram",
          "username": "studio.example",
          "shortUrl": "https://bpln.to/k3m9x2pq",
          "clicks": 42,
          "createdAt": "2026-11-19T14:00:00.000Z"
        }
      ],
      "days": [
        {
          "day": "2026-11-19",
          "clicks": 30
        },
        {
          "day": "2026-11-20",
          "clicks": 12
        }
      ]
    }
  ]
}
```


## Find tracked links

`GET /organizations/{organizationId}/workspaces/{workspaceId}/tracked-links` · operationId `trackedLinks.list`

- Scope: `links:write`
- Role permission: Any of: Create posts (`post:create`), Edit posts (`post:update`)
- Effect (`read`): Changes nothing.
- Stability: Beta (May still change before it is marked stable.) Since 2026-11-20.

Finds the workspace's tracked links, to reuse one in a caption instead of creating another: without `ids`, the links whose destination contains `q` (all of them without `q`), newest first, at most 30 (no pagination); with `ids` (comma separated), those links (unknown ids are left out). Each comes with its clicks so far and how many publications carry it. Needs the right to create or edit posts in the workspace. Use `trackedLinks.stats.get` for where the clicks came from.

**Parameters**

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `organizationId` | path | string | yes | 1–128 characters |
| `workspaceId` | path | string (uuid) | yes |  |
| `q` | query | string | no | Text the destination address contains (case-insensitive). |
| `ids` | query | one of | no | Tracked link ids, comma separated (at most 30): answers those links instead of a search. Unknown ids and other workspaces' are left out. |

**200 OK**

- `data` (array of object, required)
  - `id` (string, required): The tracked link's id (a UUID). Write `{{link:<id>}}` in a caption to share it.
  - `url` (string, required): The destination the short links redirect to, as created.
  - `createdAt` (string (date-time), required): When the tracked link was created, ISO 8601 UTC.
  - `clicks` (number, required): Clicks so far, every publication added up. A count only: nothing about the visitors is stored (no countries, devices, referrers or unique visitors).
  - `placements` (number, required): How many publications carry it: one per post and account that went out with it (each has its own short link).

**Errors**

| Status | Code | Message |
|---|---|---|
| 400 | `VALIDATION_FAILED` | Some of the information sent is invalid. |
| 403 | `MISSING_PERMISSION` | You don't have permission to do this. |
| 404 | `ORGANIZATION_NOT_FOUND` | This organization doesn't exist or you're not a member of it. |
| 404 | `WORKSPACE_NOT_FOUND` | This workspace doesn't exist or you don't have access to it. |

Also, like every operation: `APP_SUSPENDED` (401), `TOKEN_EXPIRED` (401), `TOKEN_REVOKED` (401), `UNAUTHENTICATED` (401), `INSUFFICIENT_SCOPE` (403), `INTEGRATION_BLOCKED_BY_ORGANIZATION` (403), `INTEGRATION_PENDING_APPROVAL` (403), `RATE_LIMITED` (429), `INTERNAL_ERROR` (500).

**Example: Links to the shop**

```bash
curl -X GET "https://api.beplan.io/v1/organizations/ORGANIZATION_ID/workspaces/WORKSPACE_ID/tracked-links?q=shop.example.com" \
  -H "Authorization: Bearer beplan_pat_…"
```

Answers 200:

```json
{
  "data": [
    {
      "id": "5d2c8e1a-3b4f-4a6d-9e7c-1f2a3b4c5d6e",
      "url": "https://shop.example.com/drop",
      "createdAt": "2026-11-18T09:30:00.000Z",
      "clicks": 42,
      "placements": 1
    }
  ]
}
```


## Create a tracked link

`POST /organizations/{organizationId}/workspaces/{workspaceId}/tracked-links` · operationId `trackedLinks.create`

- Scope: `links:write`
- Role permission: Any of: Create posts (`post:create`), Edit posts (`post:update`)
- Effect (`write`): Changes data in Beplan.
- Idempotency: Send an `Idempotency-Key` to retry safely: the same key with the same body within 24 hours returns the stored response.
- Stability: Beta (May still change before it is marked stable.) Since 2026-11-20.

Creates a tracked link to a destination (`url`: a full `http://` or `https://` address, up to 2,048 characters). Put `{{link:<id>}}` in a post's caption, an account's `customCaption` or a thread post (`posts.create`, `posts.update`): when each publication goes out, the token becomes its own short link (`https://bpln.to/<code>`), and clicks are counted per publication. Nothing is published by this call. The same address twice makes two separate links; a link can't be edited or deleted. Answers `201` with the link. Needs the right to create or edit posts in the workspace.

**Parameters**

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `organizationId` | path | string | yes | 1–128 characters |
| `workspaceId` | path | string (uuid) | yes |  |

**Request body** (JSON, required)

- `url` (string, required): The destination: a full `http://` or `https://` address with a host name (spaces around it are trimmed). Anything else answers `422 TRACKED_LINK_INVALID_URL`. at most 2048 characters.

**201 Created**

- `data` (object, required, TrackedLink)
  - `id` (string, required): The tracked link's id (a UUID). Write `{{link:<id>}}` in a caption to share it.
  - `url` (string, required): The destination the short links redirect to, as created.
  - `createdAt` (string (date-time), required): When the tracked link was created, ISO 8601 UTC.
  - `clicks` (number, required): Clicks so far, every publication added up. A count only: nothing about the visitors is stored (no countries, devices, referrers or unique visitors).
  - `placements` (number, required): How many publications carry it: one per post and account that went out with it (each has its own short link).

**Errors**

| Status | Code | Message |
|---|---|---|
| 400 | `VALIDATION_FAILED` | Some of the information sent is invalid. |
| 403 | `MISSING_PERMISSION` | You don't have permission to do this. |
| 404 | `ORGANIZATION_NOT_FOUND` | This organization doesn't exist or you're not a member of it. |
| 404 | `WORKSPACE_NOT_FOUND` | This workspace doesn't exist or you don't have access to it. |
| 422 | `TRACKED_LINK_INVALID_URL` | Enter a full web address, starting with https://. |

Also, like every operation: `APP_SUSPENDED` (401), `TOKEN_EXPIRED` (401), `TOKEN_REVOKED` (401), `UNAUTHENTICATED` (401), `INSUFFICIENT_SCOPE` (403), `INTEGRATION_BLOCKED_BY_ORGANIZATION` (403), `INTEGRATION_PENDING_APPROVAL` (403), `CONFLICT` (409), `IDEMPOTENCY_KEY_REUSED` (409), `PAYLOAD_TOO_LARGE` (413), `UNSUPPORTED_MEDIA_TYPE` (415), `RATE_LIMITED` (429), `INTERNAL_ERROR` (500).

**Example: A link to a product page**

```bash
curl -X POST "https://api.beplan.io/v1/organizations/ORGANIZATION_ID/workspaces/WORKSPACE_ID/tracked-links" \
  -H "Authorization: Bearer beplan_pat_…" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "https://shop.example.com/drop"
}'
```

Answers 201:

```json
{
  "data": {
    "id": "5d2c8e1a-3b4f-4a6d-9e7c-1f2a3b4c5d6e",
    "url": "https://shop.example.com/drop",
    "createdAt": "2026-11-18T09:30:00.000Z",
    "clicks": 0,
    "placements": 0
  }
}
```


## Get a tracked link's clicks

`GET /organizations/{organizationId}/workspaces/{workspaceId}/tracked-links/{trackedLinkId}/stats` · operationId `trackedLinks.stats.get`

- Scope: `links:write`
- Role permission: Any member who can see it
- Effect (`read`): Changes nothing.
- Stability: Beta (May still change before it is marked stable.) Since 2026-11-20.

Returns where a tracked link's clicks came from, across every post using it. `platforms` adds every publication up per platform, most clicked first; `placements` lists each publication (post × account) carrying the link with its own short URL and clicks, most clicked first; `days` covers the last 30 UTC days, oldest first, with empty days at 0. Clicks are counts only (a bot's first hit on a code may count); nothing about visitors is stored. Any member who sees the workspace can read it. Find ids with `trackedLinks.list`, or from a post with `trackedLinks.forPost.list`.

**Parameters**

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `organizationId` | path | string | yes | 1–128 characters |
| `workspaceId` | path | string (uuid) | yes |  |
| `trackedLinkId` | path | string (uuid) | yes |  |

**200 OK**

- `data` (object, required, TrackedLinkStats)
  - `link` (object, required, TrackedLink)
    - `id` (string, required): The tracked link's id (a UUID). Write `{{link:<id>}}` in a caption to share it.
    - `url` (string, required): The destination the short links redirect to, as created.
    - `createdAt` (string (date-time), required): When the tracked link was created, ISO 8601 UTC.
    - `clicks` (number, required): Clicks so far, every publication added up. A count only: nothing about the visitors is stored (no countries, devices, referrers or unique visitors).
    - `placements` (number, required): How many publications carry it: one per post and account that went out with it (each has its own short link).
  - `platforms` (array of object, required)
    - `platform` (string, required)
    - `clicks` (number, required)
  - `placements` (array of object, required)
    - `id` (string, required): The publication's placement id (a UUID).
    - `postId` (string, required): The post that went out with the link (it may have been deleted since).
    - `postTitle` (string, required): The post's title; `""` when it has none or was deleted since.
    - `socialAccountId` (string, required): The account it went out on (it may have been removed since).
    - `platform` (string, required): The account's platform (`instagram`, `x`, `tiktok`…), kept after the account is removed.
    - `username` (string, required, nullable): The account's handle; `null` when the account was removed.
    - `shortUrl` (string, required): The short link this publication carries (`https://bpln.to/<8 characters>`).
    - `clicks` (number, required): Clicks on this publication's short link so far.
    - `createdAt` (string (date-time), required): When the publication went out with the link, ISO 8601 UTC.
  - `days` (array of object, required)
    - `day` (string, required): A UTC day, `YYYY-MM-DD`.
    - `clicks` (number, required)

**Errors**

| Status | Code | Message |
|---|---|---|
| 400 | `VALIDATION_FAILED` | Some of the information sent is invalid. |
| 404 | `ORGANIZATION_NOT_FOUND` | This organization doesn't exist or you're not a member of it. |
| 404 | `TRACKED_LINK_NOT_FOUND` | This tracked link doesn't exist in this workspace. |
| 404 | `WORKSPACE_NOT_FOUND` | This workspace doesn't exist or you don't have access to it. |

Also, like every operation: `APP_SUSPENDED` (401), `TOKEN_EXPIRED` (401), `TOKEN_REVOKED` (401), `UNAUTHENTICATED` (401), `INSUFFICIENT_SCOPE` (403), `INTEGRATION_BLOCKED_BY_ORGANIZATION` (403), `INTEGRATION_PENDING_APPROVAL` (403), `RATE_LIMITED` (429), `INTERNAL_ERROR` (500).

**Example: One Instagram post's clicks**

```bash
curl -X GET "https://api.beplan.io/v1/organizations/ORGANIZATION_ID/workspaces/WORKSPACE_ID/tracked-links/5d2c8e1a-3b4f-4a6d-9e7c-1f2a3b4c5d6e/stats" \
  -H "Authorization: Bearer beplan_pat_…"
```

Answers 200:

```json
{
  "data": {
    "link": {
      "id": "5d2c8e1a-3b4f-4a6d-9e7c-1f2a3b4c5d6e",
      "url": "https://shop.example.com/drop",
      "createdAt": "2026-11-18T09:30:00.000Z",
      "clicks": 42,
      "placements": 1
    },
    "platforms": [
      {
        "platform": "instagram",
        "clicks": 42
      }
    ],
    "placements": [
      {
        "id": "7a6b5c4d-3e2f-4a1b-8c9d-0e1f2a3b4c5d",
        "postId": "6f1c2a3b-4d5e-4f60-8a71-92b3c4d5e6f7",
        "postTitle": "Spring drop teaser",
        "socialAccountId": "0b6f5c1e-2a7d-4c3b-9e8f-1a2b3c4d5e6f",
        "platform": "instagram",
        "username": "studio.example",
        "shortUrl": "https://bpln.to/k3m9x2pq",
        "clicks": 42,
        "createdAt": "2026-11-19T14:00:00.000Z"
      }
    ],
    "days": [
      {
        "day": "2026-11-19",
        "clicks": 30
      },
      {
        "day": "2026-11-20",
        "clicks": 12
      }
    ]
  }
}
```


---
HTML version: https://beplan.io/docs/api/tracked-links/
