--- name: syndicate-generate-tracking-link description: Generate a Syndicate Links tracking link for a publisher/program/product combination. Returns a short code and full click URL that attribute clicks and conversions to the publisher. version: 0.1.0 --- # syndicate-generate-tracking-link ## When to use When an affiliate/publisher wants to promote a specific product or program and needs a trackable URL. ## Inputs - `program_id` (required) — the program to attribute against - `product_id` (optional) — narrow the link to a specific product; omit for whole-program links - `destination_url` (optional) — override the default destination (the product or program URL) - `utm_overrides` (optional) — object with `utm_source`, `utm_medium`, `utm_campaign` ## Output ```json { "code": "GY7i_Nc6", "clickUrl": "https://api.syndicatelinks.co/click/GY7i_Nc6", "vanityUrl": "https://syndicate.link/GY7i_Nc6", "destination": "https://merchant.example/product-slug" } ``` ## Procedure As an affiliate/publisher: 1. `POST /affiliate/links` with `Authorization: Bearer ak_live_...` 2. Use the returned `clickUrl` in outbound channels (social posts, emails, agent recommendations). As a merchant creating test links (for E2E verification before recruiting real publishers): 1. `POST /merchant/test-links` with `Authorization: Bearer mk_live_...` 2. The merchant's built-in internal test affiliate is used automatically. ## Auth - Affiliate path: requires `ak_live_*` or `aff_agent_*` key. - Merchant test-link path: requires `programs:read` + `products:read` scopes (or wildcard). ## Error handling - `404 program not found` → verify `program_id` and that the publisher has an approved partnership with this program. - `403 partnership not approved` → apply via `POST /affiliate/partnerships` and wait for merchant approval before generating links. ## Docs Full API: https://syndicatelinks.co/docs/agent-integration