openapi: 3.1.0
info:
  title: Brand Tracking Links API
  version: v11
  description: "Generate tracking links for your partners within a specified program. \nThis endpoint allows for the creation of standard tracking links, \ndeep links, and customized vanity links.\n"
servers:
- url: https://api.impact.com
security:
- basicAuth: []
paths:
  /Advertisers/{AccountSID}/Programs/{ProgramId}/TrackingLinks:
    post:
      operationId: createTrackingLink
      tags:
      - Tracking Links
      summary: Create a tracking link
      description: "Creates a new tracking link for a specified media partner. \nLinks can be standard, vanity, or deep links depending on the parameters provided.\n"
      parameters:
      - name: AccountSID
        in: path
        required: true
        description: The unique identifier for the account.
        schema:
          type: string
      - name: ProgramId
        in: path
        required: true
        description: Unique identifier for the program.
        schema:
          type: integer
      - name: MediaPartnerId
        in: query
        required: true
        description: Unique identifier for the media partner assigned to the link.
        schema:
          type: integer
      - name: Type
        in: query
        required: false
        description: Specifies the type of tracking link.
        schema:
          type: string
          enum:
          - Regular
          - Vanity
      - name: CustomPath
        in: query
        required: false
        description: Defines the custom path for vanity links.
        schema:
          type: string
      - name: AdId
        in: query
        required: false
        description: Unique ad identifier. If omitted, redirects to the program landing page.
        schema:
          type: integer
      - name: DeepLink
        in: query
        required: false
        description: The specific URL the tracking link should redirect to.
        schema:
          type: string
          format: uri
      - name: MediaPartnerPropertyId
        in: query
        required: false
        description: Unique identifier of the partner media property where the link will be used.
        schema:
          type: integer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrackingLinkResponse'
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -L \
            --request POST \
            --url 'https://api.impact.com/Advertisers/{AccountSID}/Programs/{ProgramId}/TrackingLinks' \
            --user '{AccountSID}:{AuthToken}' \
            --header 'Accept: */*'
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
  schemas:
    TrackingLinkResponse:
      type: object
      properties:
        TrackingURL:
          type: string
          format: uri
          description: The generated tracking link URL.
          example: https://example.sjv.io/c/123456/98765/101010
x-default-client: cURL
