Data Export API
Create a Sales Attribution export
POST
Create a Sales Attribution export (attributed performance metrics)
Headers
Body
Send one of the following 3 shapes.Export to Northbeam documents
| Field | Type | Description |
|---|---|---|
export_file_name | string | Name of the exported file, if not provided, default one will be used. Minimum string length: 3Pattern: ^[A-Za-z0-9_-]+$ |
level | string | Level of metrics to export. Available options: “platform”, “campaign”, “adset”, “ad”Default: “platform” |
time_granularity | string | Data time granularity. Available options: “MONTHLY”, “WEEKLY”, “DAILY”, “HOURLY”Default: “DAILY” |
period_type | string | Time period to be exported. It can be either a relative window or a fixed window. If you choose to export a fixed window, the period_options property must be set.Available options: “FIXED”, “TODAY”, “YESTERDAY”, “YESTERDAY_AND_TODAY”, “LAST_3_DAYS”, “LAST_7_DAYS”, “LAST_14_DAYS”, “LAST_28_DAYS”, “LAST_30_DAYS”, “LAST_60_DAYS”, “LAST_90_DAYS”, “LAST_180_DAYS”, “MONTH_TO_DATE”, “LAST_MONTH”, “THIS_WEEK”, “LAST_WEEK”, “THIS_WEEK_AND_LAST_WEEK”, “LAST_3_WEEKS”, “LAST_4_WEEKS”, “LAST_7_WEEKS”, “LAST_12_WEEKS”, “LAST_14_WEEKS”, “LAST_26_WEEKS”, “LAST_28_WEEKS”, “LAST_52_WEEKS”, “THIS_MONTH”, “THIS_MONTH_AND_LAST_MONTH”, “LAST_3_MONTHS”, “LAST_6_MONTHS”, “LAST_9_MONTHS”, “LAST_12_MONTHS”, “YEAR_TO_DATE”, “LAST_YEAR”, “LAST_3_YEARS”, “LAST_5_YEARS”Default: “LAST_7_DAYS” |
period_options | object | Time frame to be exported if period_type is set to “FIXED”. The time period cannot be greater than 2 years. |
Field Type Description period_starting_atstring (date-time) period_ending_atstring (date-time) | ||
breakdowns | object[] | Labels used to breakdown the data. If you are unsure which breakdowns to use, you can fetch them using the /breakdowns endpoint. |
Field Type Description keystring valuesstring[] | ||
options | object | |
Field Type Description export_aggregationstring Aggregation type. Available options: “BREAKDOWN”, “DATE”Default: “BREAKDOWN”remove_zero_spendboolean Remove rows with zero spend. Default: falseaggregate_databoolean Aggregate data, ignoring campaign, adset and ad levels. Default: falseinclude_idsboolean Include campaign, adset and ad ids in exported data. Default: falseinclude_kind_and_platformboolean Include campaign, adset and ad kind and platform in exported data. Default: false | ||
attribution_options required | object | |
Field Type Description attribution_modelsstring[] Attribution models to use. Check in /attribution-models for available models.Required range: x >= 1attribution_windowsstring[] Required range: x >= 1accounting_modesstring[] Required range: x >= 1 | ||
metrics required | object[] | Metrics to export. Check in /metrics for available metrics.Required range: x >= 1 |
Field Type Description id requiredstring Metric ID labelstring Metric label to be used as file header. If not provided, a default label will be used. Pattern: ^[a-zA-Z][a-zA-Z0-9_]+[a-zA-Z0-9]$ |
Export to GCS bucket
| Field | Type | Description |
|---|---|---|
bucket_name required | string | Name of the external bucket where to export your file. |
export_file_name | string | Name of the exported file, if not provided, default one will be used. Can include subdirectory paths (e.g., folder/subfolder/file).Minimum string length: 3Pattern: ^(?!/)(?!.*//)[A-Za-z0-9_/-]+(?<!/)$ |
level | string | Level of metrics to export. Available options: “platform”, “campaign”, “adset”, “ad”Default: “platform” |
time_granularity | string | Data time granularity. Available options: “MONTHLY”, “WEEKLY”, “DAILY”, “HOURLY”Default: “DAILY” |
period_type | string | Time period to be exported. It can be either a relative window or a fixed window. If you choose to export a fixed window, the period_options property must be set.Available options: “FIXED”, “TODAY”, “YESTERDAY”, “YESTERDAY_AND_TODAY”, “LAST_3_DAYS”, “LAST_7_DAYS”, “LAST_14_DAYS”, “LAST_28_DAYS”, “LAST_30_DAYS”, “LAST_60_DAYS”, “LAST_90_DAYS”, “LAST_180_DAYS”, “MONTH_TO_DATE”, “LAST_MONTH”, “THIS_WEEK”, “LAST_WEEK”, “THIS_WEEK_AND_LAST_WEEK”, “LAST_3_WEEKS”, “LAST_4_WEEKS”, “LAST_7_WEEKS”, “LAST_12_WEEKS”, “LAST_14_WEEKS”, “LAST_26_WEEKS”, “LAST_28_WEEKS”, “LAST_52_WEEKS”, “THIS_MONTH”, “THIS_MONTH_AND_LAST_MONTH”, “LAST_3_MONTHS”, “LAST_6_MONTHS”, “LAST_9_MONTHS”, “LAST_12_MONTHS”, “YEAR_TO_DATE”, “LAST_YEAR”, “LAST_3_YEARS”, “LAST_5_YEARS”Default: “LAST_7_DAYS” |
period_options | object | Time frame to be exported if period_type is set to “FIXED”. The time period cannot be greater than 2 years. |
Field Type Description period_starting_atstring (date-time) period_ending_atstring (date-time) | ||
breakdowns | object[] | Labels used to breakdown the data. If you are unsure which breakdowns to use, you can fetch them using the /breakdowns endpoint. |
Field Type Description keystring valuesstring[] | ||
options | object | |
Field Type Description export_aggregationstring Aggregation type. Available options: “BREAKDOWN”, “DATE”Default: “BREAKDOWN”remove_zero_spendboolean Remove rows with zero spend. Default: falseaggregate_databoolean Aggregate data, ignoring campaign, adset and ad levels. Default: falseinclude_idsboolean Include campaign, adset and ad ids in exported data. Default: falseinclude_kind_and_platformboolean Include campaign, adset and ad kind and platform in exported data. Default: false | ||
attribution_options required | object | |
Field Type Description attribution_modelsstring[] Attribution models to use. Check in /attribution-models for available models.Required range: x >= 1attribution_windowsstring[] Required range: x >= 1accounting_modesstring[] Required range: x >= 1 | ||
metrics required | object[] | Metrics to export. Check in /metrics for available metrics.Required range: x >= 1 |
Field Type Description id requiredstring Metric ID labelstring Metric label to be used as file header. If not provided, a default label will be used. Pattern: ^[a-zA-Z][a-zA-Z0-9_]+[a-zA-Z0-9]$ |
Export to S3 bucket
| Field | Type | Description |
|---|---|---|
aws_role required | string | AWS role ARN with access to the S3 bucket. |
region required | string | Region of the S3 bucket. |
export_file_name | string | Name of the exported file, if not provided, default one will be used. Can include subdirectory paths (e.g., folder/subfolder/file).Minimum string length: 3Pattern: ^(?!/)(?!.*//)[A-Za-z0-9_/-]+(?<!/)$ |
level | string | Level of metrics to export. Available options: “platform”, “campaign”, “adset”, “ad”Default: “platform” |
time_granularity | string | Data time granularity. Available options: “MONTHLY”, “WEEKLY”, “DAILY”, “HOURLY”Default: “DAILY” |
period_type | string | Time period to be exported. It can be either a relative window or a fixed window. If you choose to export a fixed window, the period_options property must be set.Available options: “FIXED”, “TODAY”, “YESTERDAY”, “YESTERDAY_AND_TODAY”, “LAST_3_DAYS”, “LAST_7_DAYS”, “LAST_14_DAYS”, “LAST_28_DAYS”, “LAST_30_DAYS”, “LAST_60_DAYS”, “LAST_90_DAYS”, “LAST_180_DAYS”, “MONTH_TO_DATE”, “LAST_MONTH”, “THIS_WEEK”, “LAST_WEEK”, “THIS_WEEK_AND_LAST_WEEK”, “LAST_3_WEEKS”, “LAST_4_WEEKS”, “LAST_7_WEEKS”, “LAST_12_WEEKS”, “LAST_14_WEEKS”, “LAST_26_WEEKS”, “LAST_28_WEEKS”, “LAST_52_WEEKS”, “THIS_MONTH”, “THIS_MONTH_AND_LAST_MONTH”, “LAST_3_MONTHS”, “LAST_6_MONTHS”, “LAST_9_MONTHS”, “LAST_12_MONTHS”, “YEAR_TO_DATE”, “LAST_YEAR”, “LAST_3_YEARS”, “LAST_5_YEARS”Default: “LAST_7_DAYS” |
period_options | object | Time frame to be exported if period_type is set to “FIXED”. The time period cannot be greater than 2 years. |
Field Type Description period_starting_atstring (date-time) period_ending_atstring (date-time) | ||
breakdowns | object[] | Labels used to breakdown the data. If you are unsure which breakdowns to use, you can fetch them using the /breakdowns endpoint. |
Field Type Description keystring valuesstring[] | ||
options | object | |
Field Type Description export_aggregationstring Aggregation type. Available options: “BREAKDOWN”, “DATE”Default: “BREAKDOWN”remove_zero_spendboolean Remove rows with zero spend. Default: falseaggregate_databoolean Aggregate data, ignoring campaign, adset and ad levels. Default: falseinclude_idsboolean Include campaign, adset and ad ids in exported data. Default: falseinclude_kind_and_platformboolean Include campaign, adset and ad kind and platform in exported data. Default: false | ||
attribution_options required | object | |
Field Type Description attribution_modelsstring[] Attribution models to use. Check in /attribution-models for available models.Required range: x >= 1attribution_windowsstring[] Required range: x >= 1accounting_modesstring[] Required range: x >= 1 | ||
metrics required | object[] | Metrics to export. Check in /metrics for available metrics.Required range: x >= 1 |
Field Type Description id requiredstring Metric ID labelstring Metric label to be used as file header. If not provided, a default label will be used. Pattern: ^[a-zA-Z][a-zA-Z0-9_]+[a-zA-Z0-9]$ |
Responses
201 response body
| Field | Type | Description |
|---|---|---|
id required | string (uuid) |
Body
application/json
- Option 1
- Option 2
- Option 3
Metrics to export. Check in /metrics for available metrics.
Name of the exported file, if not provided, default one will be used.
Minimum string length:
3Pattern:
^[A-Za-z0-9_-]+$Level of metrics to export.
Available options:
platform, campaign, adset, ad Data time granularity.
Available options:
MONTHLY, WEEKLY, DAILY, HOURLY Time period to be exported. It can be either a relative window or a fixed window. If you choose to export a fixed window, the period_options property must be set.
Available options:
FIXED, TODAY, YESTERDAY, YESTERDAY_AND_TODAY, LAST_3_DAYS, LAST_7_DAYS, LAST_14_DAYS, LAST_28_DAYS, LAST_30_DAYS, LAST_60_DAYS, LAST_90_DAYS, LAST_180_DAYS, MONTH_TO_DATE, LAST_MONTH, THIS_WEEK, LAST_WEEK, THIS_WEEK_AND_LAST_WEEK, LAST_3_WEEKS, LAST_4_WEEKS, LAST_7_WEEKS, LAST_12_WEEKS, LAST_14_WEEKS, LAST_26_WEEKS, LAST_28_WEEKS, LAST_52_WEEKS, THIS_MONTH, THIS_MONTH_AND_LAST_MONTH, LAST_3_MONTHS, LAST_6_MONTHS, LAST_9_MONTHS, LAST_12_MONTHS, YEAR_TO_DATE, LAST_YEAR, LAST_3_YEARS, LAST_5_YEARS Time frame to be exported if period_type is set to "FIXED". The time period cannot be greater than 2 years.
Labels used to breakdown the data. If you are unsure which breakdowns to use, you can fetch them using the /breakdowns endpoint.
Response
Data Export created successfully