openapi: 3.1.0
info:
  title: Brand API - Programs
  description: API for retrieving information about your programs (campaigns), which are the cornerstone of tracking efforts and partner relationships on impact.com.
  version: "v12"
servers:
- url: https://api.impact.com
security:
- basicAuth: []
paths:
  /Advertisers/{AccountSID}/Campaigns:
    get:
      summary: List All Programs
      description: Returns a list of all programs for your account, sorted by Program ID.
      operationId: listPrograms
      tags:
      - Programs
      parameters:
      - name: AccountSID
        in: path
        required: true
        schema:
          type: string
        description: Your unique Account SID.
      - name: Name
        in: query
        schema:
          type: string
        description: Filter programs by name.
      - name: State
        in: query
        schema:
          $ref: '#/components/schemas/ProgramState'
        description: Filter programs by their current state.
      responses:
        "200":
          description: A list of program objects.
          content:
            application/json:
              schema:
                type: object
                properties:
                  Campaigns:
                    type: array
                    description: The list of program objects.
                    items:
                      $ref: '#/components/schemas/Program'
  /Advertisers/{AccountSID}/Campaigns/{CampaignId}:
    get:
      summary: Retrieve a Program
      description: Retrieves the details of a single, existing program by its unique ID.
      operationId: getProgramById
      tags:
      - Programs
      parameters:
      - name: AccountSID
        in: path
        required: true
        schema:
          type: string
        description: Your unique Account SID.
      - name: CampaignId
        in: path
        required: true
        schema:
          type: integer
        description: The unique identifier for the program (campaign).
      responses:
        "200":
          description: A single program object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Program'
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
  schemas:
    Program:
      type: object
      properties:
        Id:
          type: integer
          description: The unique identifier for the program.
          example: 1000
        Name:
          type: string
          description: The display name of the program.
          example: Acme Affiliate Program
        State:
          $ref: '#/components/schemas/ProgramState'
          description: The current state of the program.
        Categories:
          $ref: '#/components/schemas/ProgramCategories'
          description: The program's category classifications.
        ShortDescription:
          type: string
          description: A short description of the program.
          example: Affiliate program for Acme.
        LongDescription:
          type: string
          description: A long description of the program.
          example: Earn commissions promoting Acme tennis gear.
        ListInMarketplace:
          type: boolean
          description: Whether the program is listed in the impact.com partner marketplace.
          example: true
        DisplayServicingAgency:
          type: boolean
          description: Whether the servicing agency is displayed publicly.
          example: false
        Rating:
          type: integer
          description: The program's rating.
          example: 5
        SearchKeywords:
          type: string
          description: Keywords used to surface the program in marketplace search.
          example: tennis,sports,outdoor
        ShippingRegions:
          type: array
          description: Regions where the brand ships.
          items:
            type: string
            example: US
        Resources:
          $ref: '#/components/schemas/ProgramResources'
          description: Links to brand-provided resources.
        CompanyContacts:
          type: array
          description: Company contacts for the program.
          items:
            $ref: '#/components/schemas/CompanyContact'
        GiftCardPayouts:
          type: boolean
          description: Whether gift card payouts are enabled.
          example: true
        TrademarkBidding:
          type: boolean
          description: Whether partners are allowed to bid on the brand's trademark terms.
          example: false
        ThirdPartyImpressionPixel:
          type: string
          description: A third-party impression tracking pixel.
          example: <script>/* pixel */</script>
        MobileReadyAds:
          type: boolean
          description: Whether the program supports mobile-ready ads.
          example: true
        DisplayFutureAds:
          type: boolean
          description: Whether to display ads that aren't yet active.
          example: true
        PromoCodeTracking:
          type: boolean
          description: Whether promo code tracking is enabled.
          example: true
        TrackingDomain:
          type: string
          description: The tracking domain used for this program.
          example: acme.go2cloud.org
        SiteDefinition:
          type: string
          description: The site definition for the program.
          example: ENTIRE_DOMAIN
        ImpressionTracking:
          type: boolean
          description: Whether impression tracking is enabled.
          example: true
        ViewThroughCrediting:
          type: boolean
          description: Whether view-through crediting is enabled.
          example: false
        IdentityMatching:
          type: string
          description: The identity matching strategy.
          enum: [NONE, ACCOUNT, IR_CONSORTIUM]
        GatewayTrackingSettings:
          $ref: '#/components/schemas/GatewayTrackingSettings'
          description: Settings for gateway tracking.
        DirectTrackingSettings:
          $ref: '#/components/schemas/DirectTrackingSettings'
          description: Settings for direct tracking.
        Uri:
          type: string
          format: uri-reference
          description: The unique reference to this program in the impact.com API.
          example: /Advertisers/<AccountSID>/Campaigns/1000
    ProgramState:
      type: string
      enum: [ACTIVE, AWAITING_REVIEW, CANCELLED, CLOSED, DEACTIVATED, DELINQUENT, REJECTED, SETUP, SETUP_COMPLETE]
    ProgramCategories:
      type: object
      properties:
        PrimaryCategory:
          type: string
          description: The program's primary category.
          example: Sports
        PrimarySubCategories:
          type: array
          description: Subcategories under the primary category.
          items:
            type: string
            example: Tennis
        AdditionalCategory:
          type: string
          nullable: true
          description: An additional category for the program, if any.
          example: Apparel
        AdditionalSubCategories:
          type: array
          description: Subcategories under the additional category.
          items:
            type: string
            example: Activewear
    ProgramResources:
      type: object
      properties:
        CompanyHomepage:
          type: string
          format: uri
          description: The company homepage URL.
          example: https://www.acme.com
        ExampleLandingPage:
          type: string
          format: uri
          description: An example landing page URL.
          example: https://www.acme.com/tennis
        InformationPage:
          type: string
          format: uri
          description: An information page URL.
          example: https://partners.acme.com
        AdditionalRelatedLinks:
          type: array
          description: Additional links related to the program.
          items:
            type: object
            properties:
              LinkType:
                type: string
                description: The type of link.
                enum: [URL, PDF]
              LinkDisplayName:
                type: string
                description: Display name for the link.
                example: Partner FAQ
              LinkUrl:
                type: string
                format: uri
                description: The URL of the link.
                example: https://partners.acme.com/faq
    CompanyContact:
      type: object
      properties:
        FirstName:
          type: string
          description: The contact's first name.
          example: Account
        LastName:
          type: string
          description: The contact's last name.
          example: Manager
        EmailAddress:
          type: string
          format: email
          description: The contact's email address.
          example: manager@acme.com
        PhoneNumber:
          type: string
          description: The contact's phone number.
          example: +1 805 123 4567
    GatewayTrackingSettings:
      type: object
      properties:
        DefaultLandingPage:
          type: string
          format: uri
          description: The default landing page URL.
        MediaPartnerTrackingTemplate:
          type: string
          description: Tracking template applied to media partner links.
        CampaignTrackingTemplate:
          type: string
          description: Tracking template applied to campaign links.
        SSLSupport:
          type: boolean
          description: Whether SSL is supported for tracking links.
        DeepLinking:
          type: boolean
          description: Whether deep linking is enabled.
        DeepLinkDomains:
          type: string
          description: Comma-separated list of domains for deep linking.
        ThirdPartyGatewayUrl:
          type: string
          format: uri
          description: A third-party gateway URL for tracking.
        ThirdPartyGatewayQueryStringParameters:
          type: string
          description: Query string parameters for the third-party gateway.
        UniqueClickWindowLength:
          type: string
          description: The length of the unique click window.
          enum: ["1m", "5m", "15m", "30m", "1h", "6h", "12h", "24h"]
        UniqueClickWindowType:
          type: string
          description: Whether the unique click window is fixed or rolling.
          enum: [FIXED, ROLLING]
    DirectTrackingSettings:
      type: object
      properties:
        UnidentifiedName:
          type: string
          description: Name used for unidentified traffic.
        SessionWindowLength:
          type: integer
          description: The session window length.
