Browse the help center

Automate reports — daily e-mails and pulling data over the API

Get yesterday's numbers without opening the console — schedule a saved report by e-mail, or pull it over the analytics REST API from a script and forward it to a chat or a spreadsheet, with the quota, time-zone and month-end caveats.

How-to network manager Account → Analytics → Saved reports → schedule

What it is and why

Two ways to get numbers out of Epom on a schedule without opening the console: let Epom e-mail a saved report, or have your own script pull it over the analytics API and send it wherever you need — a chat, a spreadsheet, a billing system. E-mail is for people; the API is for scripts.

Example. A network manager saves a General report grouped by site with the Yesterday range and schedules it every weekday at 08:00 network time as XLSX to three publisher managers. Each morning they open one file with yesterday’s impressions, revenue and eCPM per site; a cron job on the finance server pulls the same report as CSV at 00:10 and appends it to a spreadsheet, so nobody downloads anything by hand.

Typical scenarios

You wantSetWhere
Yesterday’s revenue per site, every weekday morningSaved report, range Yesterday, days Mon–Fri, hour 08:00, format XLSX, recipients addedSaved reports → clock icon
A month-end report that arrives every monthRange Last month, day 1 of the month, hour 06:00, PDFsame dialog — never day 29–31 (skipped in short months)
Last week’s campaign numbers on MondayRange Last 7 days, day Monday, 09:00, CSVsame dialog
Yesterday by campaign and day into a spreadsheet, no humanGET …/rest-api/analytics/JSON.do?range=YESTERDAY&groupBy=CAMPAIGN&groupRange=DAY&jsonKeys=id with an API key from a cron job at 00:10 network timeyour scheduler
A daily message in a chatThe same call, turned into text by your script and posted with the messenger’s own APIyour scheduler

Step by step

Option 1 — a daily e-mail (no code)

  1. Account → Analytics, build the report: type, Yesterday as the date range, group-by and columns (Run a report).

  2. Save it as a template.

  3. In Saved reports, click the clock icon. Pick Days of the week or Days of the month (leave the month list at No restrictions for a weekly schedule), an Hour on the network’s clock — the field label names the zone, default 8:00 — and a File format (CSV, XLSX, PDF, HTML or JSON; default PDF), then click Add. The right side shows the resulting schedule.

    Scheduling dialog with a weekday 8:00 XLSX slot added

  4. Add recipients under Report recipients — type an address, click Add. Add your own address if you want a copy; the owner is not added automatically.

The schedule is checked once an hour; the report runs with its saved range relative to the run day, so Yesterday always means the day before the e-mail. Every option: Save, reuse and schedule reports.

Option 2 — pull yesterday’s data from a script

The analytics API runs the same reports as the console.

  1. Check your quota once: GET /rest-api/network/settings.do returns analyticsApi with dailyRequestLimit, requestsUsedToday and recordsPerRequestLimit.

  2. Build the report in the console first, so you know which groupBy, range and statisticType give the rows you want — or save it and read its params from GET /rest-api/saved-reports/{id}.do; they use exactly the API’s parameter names.

  3. Put one of the calls below in a scheduled job (cron, a CI scheduler, a cloud function), timed after midnight in the network’s time zone. The daily request quota starts over at that midnight too.

    Signed URL, CSV, yesterday grouped by site and country:

    TS=$(date +%s000)                                   # Unix time in milliseconds
    HASH=$(printf '%s%s' "$(printf '%s' "$PASSWORD" | md5sum | cut -d' ' -f1)" "$TS" | md5sum | cut -d' ' -f1)
    curl -o yesterday.csv \
      "https://<your-network-domain>/rest-api/analytics/CSV/$LOGIN/$HASH/$TS.do?range=YESTERDAY&groupBy=SITE&groupBy=COUNTRY"

    API key, JSON, yesterday by campaign with one row per day:

    curl -H "X-Api-Key: $APIKEY" "https://<your-network-domain>/rest-api/analytics/JSON.do?range=YESTERDAY&groupBy=CAMPAIGN&groupRange=DAY&jsonKeys=id"

    jsonKeys=id names each JSON field by its column id (impressions, sumGross) instead of the column’s display name in your interface language, so the script reads the same keys whoever runs it and no two columns share one — see JSON output.

  4. Check the HTTP status before using the body: 200 is a report; 400, 401, 403 and 429 keep a JSON body with success:false and the reason.

Useful parameters (full list in Analytics reports via API):

ParameterFor
range=YESTERDAY, LAST_7_DAYS, LAST_MONTH … or CUSTOM with customFrom / customToThe period
groupBy (repeatable)Rows per site, campaign, country …
groupRange=DAY / HOUROne row per day / hour
statisticTypeLeave out for the General report; HADOOP for Advanced
limit, offsetPaging; without limit you get up to your network’s records-per-request limit

Forward it to a chat, a sheet or a bot

Epom does not post to messengers itself. Turn the JSON or CSV into a message and send it with the destination’s own API — Telegram’s sendMessage / sendDocument, a Slack incoming webhook, a Google Sheets append. The analytics call is the only Epom part.

Caveats and exceptions

Who can do this. Anyone who can run reports. For e-mail you need at least one recipient on the saved report and outbound mail configured by Epom for your network. For the API you need your login and password (for the signed URL) or an API key; calling with an API key needs the API Key Access permission on your role — no stock role has it, so ask your network administrator. Both schemes are in the API overview.

“Yesterday” is the network’s yesterday. For General it is the day before in the network’s time zone — UTC unless your network has been set to another zone; for Advanced it is the report’s own time zone. A script run at 00:05 network time gets a complete yesterday from General; late-arriving data can still move it slightly for a few hours. See Which time zone do reports use?.

Quota. Each user has a daily number of report requests; once used up, calls answer 429 until the next day. GET /rest-api/network/settings.do shows dailyRequestLimit and requestsUsedToday under analyticsApi. A limit above the records-per-request limit is a 400 — page with offset instead. Pull one report grouped by the dimension you need, not one call per campaign.

Advanced reports have a short memory. They only cover the window of days the event logs are kept for; daily jobs over long periods belong on the General report.

No recipients, no mail. A scheduled report with no recipients is rendered on time and sent to nobody. The owner is not added automatically.

Day 29, 30 or 31 is skipped in short months. To get a month-end report every month, schedule day 1 with a Last month range instead.

Inactive accounts pause the schedule. Nothing is sent while the account that owns the saved report — or its parent account — is inactive. The schedule stays in place and resumes when the account is re-activated.

The e-mailed file is cut at the row limit. Each format (CSV, XLSX, PDF, HTML, JSON) has its own limit on your network. If the file looks truncated, group more coarsely or pull it over the API with limit and offset.

The e-mail runs as the owner. With the owner’s permissions, in the owner’s interface language and with the columns saved in the report — whoever the recipients are.

Deactivated logins stop scripts. A signed (login / hash / timestamp) call from a deactivated account is refused with 401, like every other REST call — a script under a departed colleague’s login stops working the day the account is switched off. Use a dedicated reporting user.

Roles. Network manager, publisher and advertiser are identical: both the e-mail and the API return only the entities and columns your role may see in the console; shared inventory and campaigns show the names your share allows. Saved reports are private to each login — a colleague cannot schedule yours; add them as a recipient instead. On a custom role an API key needs API Key Access, and a report type or column the role lacks answers 403 naming the missing reporting permission.

Not working?

SymptomCheckWhere
The e-mail never arrivesRecipients on the saved report (none = sent to nobody); the owner account and its parent are active; spam folderSaved reports → clock icon → Report recipients; Admin → Users
It arrived yesterday but not todayScheduled on day 29–31 and this month is shorter; or the account was deactivatedthe schedule summary in the dialog
It arrives at the wrong hourThe hour is on the network’s clock, named in the Hour (…) label, not yoursthe dialog’s Hour field
The file stops mid-wayThe format’s row limit on your networkgroup more coarsely, or page over the API
The file has columns or entities you did not expectIt runs as the owner of the saved reportthe owner’s role and shares
401 from a scriptWrong hash or timestamp, API key not accepted, or the login is deactivatedthe API overview; Admin → Users
403 naming a permissionThe role lacks that report type / column / rangeUser roles
429Daily request quota used up, or as many reports already running as the network allowsGET /rest-api/network/settings.do → analyticsApi
400 “Limit value can’t be more than max limit”limit above recordsPerRequestLimituse offset paging
Yesterday’s numbers are incomplete at 00:05Late-arriving data; the network’s zone is not yoursrun later, check the zone (time zones)
JSON keys change with the user’s languageMissing jsonKeys=idthe request URL
The script worked for a colleague who leftTheir login was switched offa dedicated reporting user

Reference

ItemValue
Schedule checkonce an hour; the run uses the saved range relative to the run day
Daysdays of the week, or days of the month 1–31 (No restrictions = every day of the month)
Hour0:00–23:00 on the network’s clock, default 8:00
FormatsCSV, XLSX, PDF, HTML, JSON (default PDF)
Signed callGET /rest-api/analytics/{CSV|JSON|…}/{login}/{hash}/{timestamp}.do
API-key callGET /rest-api/analytics/{format}.do with X-Api-Key, Authorization: Bearer, or apiKey=
Saved report definitionGET /rest-api/saved-reports/{id}.do → params
QuotaGET /rest-api/network/settings.do → analyticsApi.dailyRequestLimit, requestsUsedToday, recordsPerRequestLimit
Statuses200 report; 400 validation; 401 authentication; 403 missing reporting permission; 429 daily limit or too many concurrent reports

Related pages

Please disable Adblock
Are you using adblock? Disable it and reload the page to proceed to the destination page.

A registration has already been submitted from this page. Please try again in 10 minutes.