Skip to content

Generate a campaign report

POST
/reporting/campaigns/{id}/export
curl --request POST \
--url https://portal.staging.arago-tech.com/reporting/campaigns/example/export \
--header 'Authorization: <Authorization>' \
--header 'Content-Type: application/json' \
--data '{ "date_range": { "from": "2024-01-01T00:00:00Z", "to": "2025-01-01T00:00:00Z" } }'

Starts the asynchronous generation of a CSV report covering a campaign, optionally over a date range, and returns the identifier of the report being generated. The report is generated in the background: it cannot be downloaded until the generation completes.

id
required
string

The unique identifier of the campaign in hexadecimal format

Media typeapplication/json
Generate a campaign report

Starts the asynchronous generation of a campaign CSV report

object
date_range
Date range

The event date range covered by the report, narrowed to the campaign’s own start and end dates. Optional: omitted, the report covers the campaign’s whole history.

object
from
From Date

Filter items with date on or after this timestamp

string format: date-time
Example
2024-01-01T00:00:00Z
to
To Date

Filter items with date strictly before this timestamp. Must be after ‘from’ when both are provided.

string format: date-time
Example
2025-01-01T00:00:00Z

A successful response.

Media typeapplication/json
Generate a campaign report

The identifier of the report being generated

object
id
Report ID

The unique identifier of the report in hexadecimal format, to download it once the generation completes

string
Example
{
"id": "63e2d42a27ad5f2b345ca789"
}

Bad request

Media typeapplication/json
object
Example
{
"error": {
"code": "BAD_REQUEST",
"details": [
{
"code": "MAX_ITEMS",
"field": "line_items",
"message": "value must contain no more than 3000 item(s)",
"params": {
"max": "3000"
}
}
],
"message": "Bad request"
}
}

Unauthorized

Media typeapplication/json
object
Example
{
"error": {
"code": "UNAUTHORIZED",
"message": "Unauthorized"
}
}

Internal server error

Media typeapplication/json
object
Example
{
"error": {
"code": "INTERNAL_ERROR",
"message": "Internal server error"
}
}

An unexpected error response.

Media typeapplication/json
object
code
integer format: int32
message
string
details
Array<object>
object
@type
string
key
additional properties
any
Examplegenerated
{
"code": 1,
"message": "example",
"details": [
{
"@type": "example"
}
]
}