Skip to main content

API

Level's HTTP API — pull your reports, campaigns, ad accounts and segments into a warehouse, a spreadsheet or a BI tool, and keep segments, targets and reports in step with your own systems.

Every number Level shows on screen can also be fetched over HTTP, and the things you maintain by hand — segments, targets, report definitions — can be kept in step from your own systems. The public API is versioned under /v1 and meant for what runs without a person in front of it: a nightly warehouse job, a Data Studio (formerly Looker Studio) or Power BI connector, a spreadsheet that refreshes itself, the script that mirrors your naming convention into segments.

curl -H "Authorization: Bearer $TOKEN" \
  "https://api.marketing-bar.com/v1/reports/$REPORT_ID/data?dateFrom=2026-08-01&dateTo=2026-08-31"

What it is, in five lines

  • Base URL — https://api.marketing-bar.com, every path under /v1.
  • Reads by default, writes on purpose. Twenty GETs, and thirteen writes behind their own scopes (segments:write, segments:assign, budgets:write, reports:write, ad-accounts:write). A client asks for what it needs; one issued without a write scope cannot change anything, whatever it sends.
  • Server-to-server. Credentials are an OAuth2 client secret, and browsers are deliberately shut out (there are no CORS headers on /v1). Call it from your backend, your scheduler or your BI tool — never from a web page.
  • One organization per credential. A client reads exactly the organization it was issued in, and only the reports and ad accounts you listed for it.
  • Business plan and above. See Plans & limits.

Four steps to the first response

Issue a client

On the API clients screen of your organization, create a client, pick what it may read, and copy the secret — it is shown once. See API clients.

Exchange the secret for a token

POST /api/connect/token with grant_type=client_credentials returns a token that lives one hour. See Authentication.

Ask who you are

GET /v1/me costs no quota and answers with the client's scopes, plan state, remaining requests and allow-list sizes. It is the first call to make when something looks wrong.

Read the data

GET /v1/reports/{id}/data for the numbers, plus endpoints for campaigns, ad accounts, segments, organizations and the metric catalogues. See Endpoints.

The rest of the section

  • API clients — issuing credentials, scopes, allow-lists, rotating and revoking secrets.
  • Authentication — the token request, what the token carries, how long revocation takes.
  • Endpoints — every operation, read and write, with parameters, paging, caching and what a write is allowed to do.
  • Quotas & rate limits — the hourly budget, what each call costs, and the headers that tell you where you stand.
  • Errors — the thirteen problem types and what to do about each one.

The machine-readable reference

The OpenAPI document is served by the API itself and is the contract of record:

GET /v1/openapi.jsonThe OpenAPI 3.1 document — import it into Postman, Insomnia or a code generator.
GET /v1/docsThe same document rendered as a browsable reference.

Neither path needs a token and neither costs quota.