---
title: "Import historical click records"
method: POST
path: "/v2/history/clicks"
tags: ["history-v2"]
---

# Import historical click records

`POST /v2/history/clicks`

## Request

- Base URL: `https://api.tracklysms.com/api`
- URL: `https://api.tracklysms.com/api/v2/history/clicks`
- Auth: API key in header `X-Api-Key`

Only one click per message_id (MessageClick uses message_id as PK).
Duplicate message_ids are skipped.

## Request body

- ClicksImportRequest
  - `records` ClickImportRecord[], required: Array of click records
    - `message_id` string, required: Message ID
    - `offer_id` string, required: Offer ID
    - `phone_number` string, required: Contact phone number
    - `send_timestamp` string, date-time: Original send timestamp
    - `timestamp` string, date-time, required: Click timestamp

## Response `201`

Clicks imported

- ClicksImportResponse
  - `duplicates_skipped` integer: Duplicate clicks skipped
  - `error_count` integer: Records that failed
  - `errors` object[]: Error details
  - `success_count` integer: Records successfully imported

## Other responses

- `400`: Validation error
- `401`: Authentication error
- `413`: Too many records

---

[API](https://skmtc.dev/tracklysms/apis/trackly-sms-api.md) · [All operations](https://skmtc.dev/tracklysms/apis/trackly-sms-api/llms.txt) · [OpenAPI document](https://skmtc.dev/tracklysms/apis/trackly-sms-api/revisions/ac1ad22cb2a9?raw)
