Skip to Content
1MSG
ReferenceCampaigns API

Download campaign cost expenses as CSV

GET
/api/v1/campaigns/cost/expenses.csv

Exports the full filtered campaign cost expense report as a UTF-8 CSV attachment without pagination.

  • Accepts the same channelId, from, to, and campaignIds filters as GET /api/v1/campaigns/cost/expenses.
  • Columns: campaign_id,channel_id,completed_at,country_code,category,total_usd,total_brl,total_rub.

These amounts are estimates. Volume tiers, free entry points, customer-service windows, and Meta from-to price bands are not modeled, so the figures can differ from Meta's invoice.

Authorization

bearer
headerAuthorizationBearer <API key>

Key issued in Settings → Developer → API key. Inbox methods need the Inbox scope. Campaigns methods need the Campaigns scope.

Query Parameters

channelId?string

Limit to one channel. Combined with the other filters using AND.

from?string

Include snapshots whose completedAt is at or after this instant. Filters campaign_cost_snapshots.completedAt.

Formatdate-time
to?string

Include snapshots whose completedAt is at or before this instant. Filters campaign_cost_snapshots.completedAt.

Formatdate-time
campaignIds?array<string>

Campaign ids. Repeat the parameter or pass a comma-separated list. Combined with the other filters using AND.

format?string

Accepted for compatibility. GET .../cost/expenses returns JSON. GET .../cost/expenses.csv always returns CSV.

Value in"json""csv"

Response Body

CSV file with snake_case columns: campaign_id, channel_id, completed_at, country_code, category, total_usd, total_brl, and total_rub.

Example Request
curl -X GET 'https://api.1msg.io/api/v1/campaigns/cost/expenses.csv'
Example Response
Empty