Skip to main content
POST
/
db-mgmt
/
api
/
query-attribution
Run an attribution query
curl --request POST \
  --url https://api2.upstackified.com/db-mgmt/api/query-attribution \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --header 'x-pixel-id: <api-key>' \
  --data '
{
  "pixelId": "5f1e6a4f-...",
  "dimension": "utm_source",
  "dateRange": {
    "start": "2026-04-01",
    "end": "2026-04-30"
  },
  "attributionModel": "first_click",
  "attributionWindow": 30
}
'
{
  "results": [
    {
      "dateRange": {
        "start": "2026-04-01",
        "end": "2026-04-30"
      },
      "dimension": "<string>",
      "dimensionFilters": [
        [
          {
            "dimension": "<string>",
            "value": "<string>"
          }
        ]
      ],
      "data": {
        "primary": [
          {
            "dt": "<string>",
            "start": "<string>",
            "end": "<string>"
          }
        ],
        "compare": [
          {
            "dt": "<string>",
            "start": "<string>",
            "end": "<string>"
          }
        ]
      },
      "measureDetails": [
        {
          "measure": "<string>",
          "isAverage": true,
          "isPercentage": true,
          "calculatedAverage": true,
          "success": true,
          "primaryAvg": 123,
          "compareAvg": 123,
          "primarySum": 123,
          "compareSum": 123,
          "percentDiff": 123,
          "hasPacing": true,
          "preferredTrendDirection": "up"
        }
      ]
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.upstackdata.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

x-api-key
string
header
required

Your Upstack API key. Starts with upstack_.

x-pixel-id
string
header
required

The pixel id the request targets.

Body

application/json
pixelId
string
required

Must match the x-pixel-id header.

dimension
string
required

Dimension to attribute by (e.g. utm_source).

dateRange
object
required
attributionModel
enum<string>
required
Available options:
first_click,
last_click,
any_click
attributionWindow
enum<integer>
required

Attribution window in days. -1 means unlimited.

Available options:
1,
7,
14,
30,
60,
90,
-1
dimensionFilters
object[][]

Outer array is an OR of inner arrays; each inner array is an AND of single-dimension filters.

timezone
string
valueSource
enum<string>
default:orders

Source of truth for conversion data.

Available options:
orders,
events
conversionEvent
string
default:purchase

Required when valueSource = events. Defaults to purchase when valueSource = orders.

orderSettings
object

Order-level query settings — exclusion filters, pending/voided handling.

viewFilters
object[]

Response

Attribution results.

results
object[]
required