# TrackingLinks

## Create a tracking link

> Generates a new tracking link for the specified program. Up to \*\*5,000 vanity links\*\* can exist on an account — exceeding that limit returns a 403 Forbidden response.<br>

```json
{"openapi":"3.1.0","info":{"title":"Partner Tracking Links API","version":"14"},"tags":[{"name":"Tracking Links","description":"Endpoint for generating partner tracking links for a brand's program."}],"servers":[{"url":"https://api.impact.com"}],"security":[{"basicAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic","description":"Use your AccountSID as the username and AuthToken as the password."}},"parameters":{"AccountSID":{"name":"AccountSID","in":"path","required":true,"schema":{"type":"string"},"description":"Unique identifier for the partner account."},"ProgramId":{"name":"ProgramId","in":"path","required":true,"schema":{"type":"string"},"description":"Unique identifier for the brand program the tracking link is for."}}},"paths":{"/Mediapartners/{AccountSID}/Programs/{ProgramId}/TrackingLinks":{"post":{"operationId":"createTrackingLink","tags":["Tracking Links"],"summary":"Create a tracking link","description":"Generates a new tracking link for the specified program. Up to **5,000 vanity links** can exist on an account — exceeding that limit returns a 403 Forbidden response.\n","parameters":[{"$ref":"#/components/parameters/AccountSID"},{"$ref":"#/components/parameters/ProgramId"},{"name":"Type","in":"query","required":false,"schema":{"type":"string","enum":["Regular","Vanity"],"default":"Regular"},"description":"The type of tracking link to generate.\n\n- `Regular`: System-generated short link.\n- `Vanity`: Branded link with a custom path (requires `CustomPath`).\n"},{"name":"CustomPath","in":"query","required":false,"schema":{"type":"string"},"description":"Custom path that follows the tracking domain (e.g., `SummerSale` produces `https://example.sjv.io/SummerSale`). Required when `Type=Vanity`. If omitted on a vanity link, a random path is generated."},{"name":"AdId","in":"query","required":false,"schema":{"type":"string"},"description":"Unique identifier of an ad to deep-link into (see the Partner Ads API). If omitted, the tracking link redirects to the brand's default landing page."},{"name":"DeepLink","in":"query","required":false,"schema":{"type":"string","format":"uri"},"description":"The exact destination URL the tracking link should redirect to after attribution. Use this to send clicks to a specific product page instead of the brand's default landing page."},{"name":"MediaPartnerPropertyId","in":"query","required":false,"schema":{"type":"string"},"description":"Unique identifier of the media property (website, social profile, or app) where the link will be used. See the Partner Media Properties API."},{"name":"subId1","in":"query","required":false,"schema":{"type":"string"},"description":"Sub-affiliate identifier surfaced as a column in partner performance reports. Use to segment traffic by your own categories."},{"name":"subId2","in":"query","required":false,"schema":{"type":"string"},"description":"Additional sub-affiliate identifier surfaced as a column in partner performance reports."},{"name":"subId3","in":"query","required":false,"schema":{"type":"string"},"description":"Additional sub-affiliate identifier surfaced as a column in partner performance reports."},{"name":"sharedId","in":"query","required":false,"schema":{"type":"string"},"description":"Shared identifier surfaced as a column in partner performance reports."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"TrackingURL":{"type":"string","format":"uri","description":"The generated tracking link. The path format is `/c/{partner-id}/{ad-id}/{program-id}` for regular links, or `/{CustomPath}` for vanity links."}}}}}},"403":{"description":"Forbidden — returned when the 5,000 vanity link limit is reached or when a referenced resource (e.g., `MediaPartnerPropertyId`) does not exist.","content":{"application/json":{"schema":{"type":"object","properties":{"timestamp":{"type":"integer","description":"Unix epoch time in milliseconds when the error was returned."},"status":{"type":"string","description":"HTTP status name."},"error":{"type":"string","description":"Short error label."},"message":{"type":"string","description":"Human-readable explanation of the error."}}}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://integrations.impact.com/partner-api-reference/partner-v14/reference/tracking-links/trackinglinks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
