Update ad product matches
update_ad_relationUpdate Ad Relation
When to use: 광고 소재↔상품 연결(relation)을 직접 고쳐 저장할 때. 규칙으로 잡히지 않는 건을 사람이 수동 지정하거나 오귀속을 바로잡는 용도.
When NOT to use: 연결을 끊는 것은 delete_ad_relation 이다. 규칙 자체를 고쳐 여러 건을 한꺼번에 바꾸려면 광고 매칭 규칙 도구(create_ad_mapping_rule·update_ad_rule_mapping)를 쓴다. 현재 연결 상태 조회는 search_ad_relations.
Limitations: body 는 AdRelationSchema 리스트다 — 소재 식별 필드(ad_channel_name·ad_account_id·ad_account_name·campaign_id·campaign_name·adset_id·adset_name·ad_id·ad_name·landing_url)에 더해 연결 대상을 mapped_product 중첩 리스트로 넘긴다(평면 product_id 필드가 아니다). 소재 단위 overwrite — 위 식별 필드 전체가 일치하는 기존 행을 지우고 body 내용으로 다시 넣는다(부분 필드 병합이 아니다). 그래서 대상 행은 search_ad_relations 로 먼저 조회해 식별 필드를 그대로 복사해 넘겨야 한다 — 하나라도 다르면 기존 행이 지워지지 않고 새 행이 생긴다. mapped_product 를 빈 리스트로 주면 그 소재의 연결이 해제된다. body 가 빈 리스트면 400. data_management:write 권한 + AD_MAPPING 스코프 필요. ad_relation 스코프 감사 이벤트로 기록되므로 사후 복원이 가능하다.
Examples:
Q: 이 광고 소재를 '수분크림 50ml' 상품에 직접 연결해줘 params: {'body': [{'ad_channel_name': 'GOOGLE', 'ad_account_id': 'acc-1', 'ad_account_name': '메인 광고계정', 'campaign_id': 'c-1', 'campaign_name': '여름세일', 'adset_id': 'as-1', 'adset_name': '관심사타겟', 'ad_id': 'ad-1', 'ad_name': '여름세일_배너A', 'landing_url': 'https://shop.example.com/p/1001', 'mapped_product': [{'product_id': '1001', 'product_name': '수분크림 50ml', 'brand_name': '브랜드A', 'channel_name': '스마트스토어', 'shop_id': 1, 'shop_name': '브랜드A 스토어'}]}]}
Output shape: no content (성공 시 body 없음)
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"body": "<body>"
},
"name": "update_ad_relation"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | ||
| project-id | No | ||
| auth_method | No | jwt |