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

# Import historical revenue records

`POST /v2/history/revenue`

## Request

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

## Request body

- RevenueImportRequest
  - `records` RevenueImportRecord[], required: Array of new revenue records; repeated imports append records
    - `attribution_type` string: Attribution type (default: migration)
    - `message_id` string, required: Message ID
    - `offer_id` string, required: Offer ID
    - `payout` number: Payout amount
    - `revenue` number, required: Finite signed revenue amount
    - `timestamp` string, date-time: Asserted conversion time; missing or invalid values retain only observation time

## Response `201`

Revenue imported

- RevenueImportResponse
  - `error_count` integer: Records that failed
  - `errors` object[]: Error details
  - `success_count` integer: Records successfully imported
  - `total_revenue` number: Total revenue 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)
