> ## Documentation Index
> Fetch the complete documentation index at: https://developers.heymarket.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Links API overview and object

> Create and manage tracked short links and understand the Link object returned by the Heymarket API.

The Links API lets you create Heymarket short URLs, attribute them to messaging activity, update their destinations, and inspect their latest click activity.

<Info>
  Link tracking must be enabled for your team. Requests from teams without the feature return `403` with the message `link_tracking_not_available`.
</Info>

Every link belongs to the team identified by your API credentials. You cannot retrieve, update, or delete another team's links. Cross-team lookups return `404`.

## The Link object

| Field              | Type    | Description                                                                              |
| ------------------ | ------- | ---------------------------------------------------------------------------------------- |
| `id`               | integer | Unique identifier for the link.                                                          |
| `short_code`       | string  | Code segment of the short URL.                                                           |
| `short_url`        | string  | Full short URL to include in messages.                                                   |
| `original_url`     | string  | Destination URL the short link redirects to.                                             |
| `team_id`          | integer | Identifier of the team that owns the link.                                               |
| `target`           | string  | Target the link is attributed to, when present.                                          |
| `conversation_id`  | integer | Conversation the link is attributed to, when present.                                    |
| `broadcast_id`     | integer | Broadcast the link is attributed to, when present.                                       |
| `campaign_step_id` | integer | Campaign step the link is attributed to, when present.                                   |
| `template_id`      | integer | Template the link is attributed to, when present.                                        |
| `last_visited_at`  | string  | ISO 8601 timestamp of the most recent click. Omitted when the link has not been clicked. |
| `created_at`       | string  | ISO 8601 timestamp when the link was created.                                            |

## Endpoints

| Method   | Endpoint                                                         | Description                            |
| -------- | ---------------------------------------------------------------- | -------------------------------------- |
| `POST`   | [`/v1/link`](/api-reference/links/create)                        | Create a tracked short link.           |
| `POST`   | [`/v1/batch/links`](/api-reference/links/bulk-create)            | Create up to five tracked short links. |
| `GET`    | [`/v1/link/{id}`](/api-reference/links/get)                      | Get a link by ID.                      |
| `GET`    | [`/v1/link/code/{code}`](/api-reference/links/get-by-short-code) | Get a link by short code.              |
| `PUT`    | [`/v1/link/{id}`](/api-reference/links/update)                   | Update a link's destination URL.       |
| `DELETE` | [`/v1/link/{id}`](/api-reference/links/delete)                   | Delete a link.                         |
| `POST`   | [`/v1/links`](/api-reference/links/list)                         | Paginate your team's links.            |
