跳转到主要内容
POST
Create custom audience

请求规范

  • 方法与路径: POST /apis/v1/ads/audiences
  • 可用状态: enabled
  • 请求 URL 模板: https://api.aisa.one/apis/v1/ads/audiences
  • connectionId: query; 必填
  • Runtime 事实版本: fe60122939c67dc98a3a6ac6b97bd5c326b526105150c8959304dd2160d4dd09
完整 OpenAPI 定义 有效请求与价格声明(包括认证和引用的 schema):

费用与请求规则

当前未提供请求参考价格;请使用接口支持的报价功能确认费用。 最终费用以账户适用价格及实际结算为准。 公开参考值不是你的账户报价或最终扣费。对于支持 X-AISA-Cost-Mode: quote 的接口,执行前请针对完整请求获取免费报价;执行后通过响应费用元数据和 Usage Logs 核对结算费用。1 USD 等于 1,000,000 个整数 micro-USD。

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

查询参数

connectionId
string
必填

The ads connection (adc_...) the request runs on: one of yours, from GET /apis/v1/ads/connections. On a request with a JSON body it may be sent as a top-level body member instead.

Pattern: ^adc_[0-9A-Za-z]+$

请求体

application/json

customer_list, website, lookalike or engagement audience (uploaded or derived from a source).

adAccountId
string
必填

Platform ad account ID. Must start with act_ for Meta; bare platform id for others (Google customer id, X/TikTok/LinkedIn/Pinterest account id).

name
string
必填
Maximum string length: 255
type
enum<string>
必填
可用选项:
customer_list,
company_list,
engagement,
meta_engagement,
tiktok_engagement,
pinterest_engagement,
website,
website_retargeting,
lookalike
adIds
string[]

pinterest_engagement: people who engaged with these ads. Must be yours: it is checked through the connection before the request is sent, and an id that is not yours answers not_found.

Pattern: ^\d+$
campaignIds
string[]

pinterest_engagement: people who engaged with these campaigns' ads. Must be yours: it is checked through the connection before the request is sent, and an id that is not yours answers not_found.

Pattern: ^\d+$
companies
object[]

Required for company_list audiences (LinkedIn only). Plain-text company rows for account targeting; each row needs at least one identifier. Not hashed: LinkedIn matches these against its own company graph.

Required array length: 1 - 300000 elements
country
string

2-letter code, required for lookalike audiences

customerFileSource
string

Data source declaration for GDPR compliance (customer_list only)

description
string
engagementDomains
string[]

pinterest_engagement: people who engaged with Pins from these domains. The domain must be claimed on the Pinterest account or Pinterest rejects it.

engagementSource
enum<string>

Required for meta_engagement audiences (Meta only): what people engaged with. page = a Facebook Page, instagram = an IG professional account, video = a video.

可用选项:
page,
instagram,
video
engagementSources
string[]

Required for engagement audiences. Campaign URNs for the ad source types, organization URNs for pages and events. LinkedIn creates one rule per source, all sharing the same trigger and lookbackDays.

Required array length: 1 - 50 elements
engagementType
enum<string>

pinterest_engagement: limit to one engagement action.

可用选项:
click,
save,
closeup,
comment,
like
engagerType
enum<integer>

pinterest_engagement: Pinterest's engager_type, passed through when set.

可用选项:
1,
2
event
string

The event to match. Its meaning depends on the type: meta_engagement: the engagement event. Defaults per source (page → page_engaged, instagram → ig_business_profile_all, video → video_watched). Ignored when rule is provided.

Maximum string length: 100
identityAuthorizedBcId
string

tiktok_engagement: required when identityType is BC_AUTH_TT.

identityId
string

tiktok_engagement: the TikTok identity that owns the videos or business account. Required for organic_video, live_video and business_account.

identityType
enum<string>

tiktok_engagement: type of identityId.

可用选项:
TT_USER,
BC_AUTH_TT
lookbackDays
enum<integer>

Required for engagement audiences. Rolling window.

可用选项:
30,
60,
90,
180,
365
matchRules
object[]

Required for website_retargeting audiences (LinkedIn only). Each rule is a URL pattern; a member who visits any matching page enters the segment.

Required array length: 1 - 50 elements
pinIds
string[]

pinterest_engagement: people who engaged with these Pins. At least one of engagementDomains, campaignIds, adIds or pinIds is required.

Pattern: ^\d+$
pixelId
string

website: the Meta pixel, TikTok pixel, Pinterest tag or Reddit pixel id. Required on those four, rejected on Google.

ratio
number

lookalike on Meta (0.01-0.20) and Pinterest (0.01-0.10, whole percents). Rejected on TikTok and Google.

必填范围: 0.01 <= x <= 0.2
retentionDays
integer

Required for website (Meta max 180, TikTok 7/14/30/60/90/180, Reddit max 90, Pinterest and Google max 540), meta_engagement (max 365) and tiktok_engagement (7/14/30/60/90/180; organic and live video and most business-account events only…

必填范围: 1 <= x <= 540
rule
object

Meta only (a 400 elsewhere). Optional raw Meta rule, replacing the one we build. Omit it for all visitors of pixelId, or use urlContains for the common page-match case.

size
enum<string>

lookalike on TikTok and Google: audience breadth. Rejected on Meta and Pinterest.

可用选项:
narrow,
balanced,
broad
source
enum<string>

Required for tiktok_engagement: what people engaged with.

可用选项:
ads,
organic_video,
live_video,
business_account
sourceAudienceId
string

Required for lookalike audiences Must be yours: it is checked through the connection before the request is sent, and an id that is not yours answers not_found.

sourceId
string

Required for meta_engagement: the Page / IG account / video id.

sourceIds
string[]

tiktok_engagement: ad group / campaign ids for ads, video ids for organic_video and live_video (max 10). Required except for business_account.

Required array length: 1 - 50 elements
sourceType
enum<string>

Required for engagement audiences (LinkedIn only): what members engaged with: a video/leadgen/single-image ad campaign, a Company Page or an Event page.

可用选项:
VIDEO_ADS,
LEAD_GEN_FORMS,
ORGANIZATION_PAGES,
EVENT_PAGES,
SINGLE_IMAGE_ADS
trigger
string

Required for engagement audiences. The action, validated by LinkedIn against sourceType.

urlContains
string

website on Meta, TikTok and Google. Narrows the audience from all visitors to visitors of URLs containing this substring. Ignored when rule is supplied. A 400 on Pinterest, which only matches exact URLs.

connectionId
string

The ads connection (adc_...), when not sent as the connectionId query parameter.

Pattern: ^adc_[0-9A-Za-z]+$
spec
object

The targeting spec to store.

响应

Audience created

audience
object
message
string