Skip to main content
POST
Stats-job create

Authorizations

Authorization
string
header
required

A personal API key (adside_pat_…) or a token from adside login. Either carries the permissions of the person it belongs to.

Path Parameters

workspaceId
string
required
Minimum string length: 1

Body

application/json
entity_ids
string[]
required

Up to 20 ids of that entity.

Required array length: 1 - 20 elements
Minimum string length: 1
account_id
string

X ads account id (e.g. 18ce55xcrlv). Omit it: it defaults to the ads account this workspace is connected to, and any other account is refused.

entity
enum<string>
default:CAMPAIGN
Available options:
ACCOUNT,
FUNDING_INSTRUMENT,
CAMPAIGN,
LINE_ITEM,
PROMOTED_TWEET,
PROMOTED_ACCOUNT,
MEDIA_CREATIVE
preset
enum<string>

Shortcut for a date range. Default last_7d when no start_date/end_date given.

Available options:
today,
yesterday,
last_7d,
last_14d,
last_30d,
this_month,
last_month
start_date
string

First day, YYYY-MM-DD, in the account's time zone.

Pattern: ^\d{4}-\d{2}-\d{2}$
end_date
string

Last day (inclusive), YYYY-MM-DD, in the account's time zone. The exclusive end X wants is computed for you.

Pattern: ^\d{4}-\d{2}-\d{2}$
granularity
enum<string>
default:DAY

DAY buckets are midnight-to-midnight in the account's time zone; HOUR is hourly; TOTAL is one bucket.

Available options:
DAY,
HOUR,
TOTAL
placement
enum<string>
default:ALL_ON_TWITTER

One placement per stats request (X accepts a single value). Default ALL_ON_TWITTER; other placements are separate calls.

Available options:
ALL_ON_TWITTER,
PUBLISHER_NETWORK,
SPOTLIGHT,
TREND
metric_groups
enum<string>[]

X metric groups to request. MOBILE_CONVERSION must be requested alone.

Available options:
ENGAGEMENT,
BILLING,
VIDEO,
WEB_CONVERSION,
MOBILE_CONVERSION,
LIFE_TIME_VALUE_MOBILE_CONVERSION
segmentation_type
enum<string>

One segmentation per job (AGE, GENDER, METROS + country, PLATFORMS, CONVERSION_TAGS). Caps the window at 45 days. CAUTION: since April 2026 segmented jobs often return null metrics or 500s on X's side.

Available options:
AGE,
GENDER,
METROS,
PLATFORMS,
CONVERSION_TAGS
country
string

Required with segmentation_type METROS.

Required string length: 2

Response

200 - application/json

Success