openapi: 3.1.0
info:
  title: Brand API - Exception Lists
  description: API for managing Exception Lists, which are used to apply different payout rates based on the category or SKU of a converted item.
  version: "v12"
servers:
- url: https://api.impact.com
security:
- basicAuth: []
paths:
  /Advertisers/{AccountSID}/ExceptionLists:
    get:
      summary: List All Exception Lists
      description: Returns a list of your exception lists, with options for filtering.
      operationId: listExceptionLists
      tags:
      - Exception Lists
      parameters:
      - name: AccountSID
        in: path
        required: true
        schema:
          type: string
        description: Your unique Account SID.
      - name: CampaignId
        in: query
        schema:
          type: integer
        description: Filter by a specific program (campaign) ID.
      - name: State
        in: query
        schema:
          $ref: '#/components/schemas/ExceptionListState'
        description: Filter lists by their current state.
      - name: Type
        in: query
        schema:
          $ref: '#/components/schemas/ExceptionListType'
        description: Filter lists by their type.
      responses:
        "200":
          description: A list of exception list objects.
          content:
            application/json:
              schema:
                type: object
                properties:
                  ExceptionLists:
                    type: array
                    description: The list of exception list objects.
                    items:
                      $ref: '#/components/schemas/ExceptionList'
    post:
      summary: Create an Exception List
      description: Creates a new exception list.
      operationId: createExceptionList
      tags:
      - Exception Lists
      parameters:
      - name: AccountSID
        in: path
        required: true
        schema:
          type: string
        description: Your unique Account SID.
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
              - ActionTrackerId
              - CampaignId
              - Name
              - Type
              properties:
                ActionTrackerId:
                  type: string
                  description: Comma-separated list of event type IDs.
                  example: '18500'
                CampaignId:
                  type: integer
                  description: The program ID the list applies to.
                  example: 1000
                Name:
                  type: string
                  description: The name of the exception list.
                  example: USA-State-CA-Exclusions
                Type:
                  $ref: '#/components/schemas/ExceptionListType'
                  description: Whether this list applies to CATEGORY or SKU.
      responses:
        "200":
          description: The exception list was created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessUriResponse'
  /Advertisers/{AccountSID}/ExceptionLists/{ExceptionListId}:
    get:
      summary: Retrieve an Exception List
      description: Retrieves the details of a single, existing exception list by its ID.
      operationId: getExceptionListById
      tags:
      - Exception Lists
      parameters:
      - name: AccountSID
        in: path
        required: true
        schema:
          type: string
        description: Your unique Account SID.
      - name: ExceptionListId
        in: path
        required: true
        schema:
          type: integer
        description: The unique identifier for the exception list.
      responses:
        "200":
          description: A single exception list object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExceptionList'
    put:
      summary: Update an Exception List
      description: Updates the specified exception list.
      operationId: updateExceptionList
      tags:
      - Exception Lists
      parameters:
      - name: AccountSID
        in: path
        required: true
        schema:
          type: string
        description: Your unique Account SID.
      - name: ExceptionListId
        in: path
        required: true
        schema:
          type: integer
        description: The unique identifier for the exception list to update.
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                ActionTrackerId:
                  type: string
                  description: Comma-separated list of event type IDs.
                  example: '18500'
                Name:
                  type: string
                  description: The display name for the exception list.
                  example: USA-State-CA-Exclusions
                Type:
                  $ref: '#/components/schemas/ExceptionListType'
                  description: Whether this list applies to CATEGORY or SKU.
      responses:
        "200":
          description: The exception list was updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessUriResponse'
  /Advertisers/{AccountSID}/ExceptionLists/{ExceptionListId}/Items:
    get:
      summary: List All Items in an Exception List
      description: Returns a list of all items within a specific exception list.
      operationId: listExceptionListItems
      tags:
      - Exception List Items
      parameters:
      - name: AccountSID
        in: path
        required: true
        schema:
          type: string
        description: Your unique Account SID.
      - name: ExceptionListId
        in: path
        required: true
        schema:
          type: integer
        description: The unique identifier for the exception list.
      - name: Value
        in: query
        schema:
          type: string
        description: Filter items by their 'Value' (the SKU or Category).
      responses:
        "200":
          description: A list of exception list item objects.
          content:
            application/json:
              schema:
                type: object
                properties:
                  ExceptionListItems:
                    type: array
                    description: The list of items in this exception list.
                    items:
                      $ref: "#/components/schemas/ExceptionListItem"
    post:
      summary: Create Item(s) for an Exception List
      description: Creates one or more new items for an exception list, either via form parameters or by file upload.
      operationId: createExceptionListItems
      tags:
      - Exception List Items
      parameters:
      - name: AccountSID
        in: path
        required: true
        schema:
          type: string
        description: Your unique Account SID.
      - name: ExceptionListId
        in: path
        required: true
        schema:
          type: integer
        description: The unique identifier for the exception list.
      requestBody:
        description: "Provide either form parameters for a single item or a file for bulk creation.\n\nTo create a single item, send `Value` (and optionally `Name`) as `application/x-www-form-urlencoded`.\n\nTo bulk-upload items from a `.csv` or `.xlsx` file, switch the content type to `multipart/form-data` and send the `File` parameter."
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
              - Value
              properties:
                Value:
                  type: string
                  description: The CATEGORY or SKU value.
                  example: CA
                Name:
                  type: string
                  description: Display name for the item.
                  example: California
                Upsert:
                  type: boolean
                  default: false
                  description: If true, updates an existing item with the same 'Value'.
                  example: true
          multipart/form-data:
            schema:
              type: object
              properties:
                File:
                  type: string
                  format: binary
                  description: .CSV or .XLSX file with item data.
                Upsert:
                  type: boolean
                  default: false
                  description: If true, updates existing items where 'Value' matches.
                  example: true
      responses:
        "200":
          description: The item(s) were created or queued successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessUriResponse'
    patch:
      summary: Replace All Items in an Exception List
      description: Replaces all items within an existing exception list by uploading a file.
      operationId: replaceExceptionListItems
      tags:
      - Exception List Items
      parameters:
      - name: AccountSID
        in: path
        required: true
        schema:
          type: string
        description: Your unique Account SID.
      - name: ExceptionListId
        in: path
        required: true
        schema:
          type: integer
        description: The unique identifier for the exception list.
      requestBody:
        description: A file containing the new set of items for the list.
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
              - File
              properties:
                File:
                  type: string
                  format: binary
                  description: .CSV or .XLSX file with the complete new list of items.
      responses:
        "200":
          description: The items were replaced successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessUriResponse'
    delete:
      summary: Delete All Items in an Exception List
      description: Permanently deletes all items from a specified exception list. This cannot be undone.
      operationId: deleteAllExceptionListItems
      tags:
      - Exception List Items
      parameters:
      - name: AccountSID
        in: path
        required: true
        schema:
          type: string
        description: Your unique Account SID.
      - name: ExceptionListId
        in: path
        required: true
        schema:
          type: integer
        description: The unique identifier for the exception list.
      responses:
        "200":
          $ref: '#/components/responses/SuccessDeleteResponse'
  /Advertisers/{AccountSID}/ExceptionLists/{ExceptionListId}/Items/{ItemId}:
    get:
      summary: Retrieve an Exception List Item
      description: Retrieves the details of a single item from an exception list.
      operationId: getExceptionListItemById
      tags:
      - Exception List Items
      parameters:
      - name: AccountSID
        in: path
        required: true
        schema:
          type: string
        description: Your unique Account SID.
      - name: ExceptionListId
        in: path
        required: true
        schema:
          type: integer
        description: The unique identifier for the exception list.
      - name: ItemId
        in: path
        required: true
        schema:
          type: integer
        description: The unique identifier for the exception list item.
      responses:
        "200":
          description: A single exception list item object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExceptionListItem'
    delete:
      summary: Delete an Exception List Item
      description: Permanently deletes a single item from an exception list. This cannot be undone.
      operationId: deleteExceptionListItem
      tags:
      - Exception List Items
      parameters:
      - name: AccountSID
        in: path
        required: true
        schema:
          type: string
        description: Your unique Account SID.
      - name: ExceptionListId
        in: path
        required: true
        schema:
          type: integer
        description: The unique identifier for the exception list.
      - name: ItemId
        in: path
        required: true
        schema:
          type: integer
        description: The unique identifier for the exception list item.
      responses:
        "200":
          $ref: '#/components/responses/SuccessDeleteResponse'
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: Use your AccountSID as the username and AuthToken as the password.
  schemas:
    ExceptionList:
      type: object
      properties:
        Id:
          type: integer
          description: The unique identifier for the exception list.
          example: 99999
        Name:
          type: string
          description: The display name for the exception list.
          example: USA-State-CA-Exclusions
        State:
          $ref: '#/components/schemas/ExceptionListState'
          description: The current state of the exception list.
        CampaignId:
          type: integer
          description: The program ID the list applies to.
          example: 1000
        Type:
          $ref: '#/components/schemas/ExceptionListType'
          description: Whether this list applies to CATEGORY or SKU.
        CreatedDate:
          type: string
          format: date-time
          description: The date and time the list was created.
          example: '2026-01-15T10:00:00-08:00'
        DeactivationDate:
          type: string
          format: date-time
          nullable: true
          description: The date and time the list was deactivated, if applicable.
          example: '2026-12-31T23:59:59-08:00'
        ActionTrackers:
          type: array
          description: The action trackers (event types) this list applies to.
          items:
            type: object
            properties:
              Id:
                type: integer
                description: The unique identifier for the action tracker.
                example: 18500
              Name:
                type: string
                description: The display name of the action tracker.
                example: Online Sale
        NumberOfItems:
          type: integer
          description: The total number of items in the list.
          example: 50
        ItemsUri:
          type: string
          format: uri-reference
          description: The unique reference to the items collection for this list.
          example: /Advertisers/<AccountSID>/ExceptionLists/99999/Items
        Uri:
          type: string
          format: uri-reference
          description: The unique reference to this exception list in the impact.com API.
          example: /Advertisers/<AccountSID>/ExceptionLists/99999
    ExceptionListItem:
      type: object
      properties:
        Id:
          type: integer
          description: The unique identifier for the exception list item.
          example: 1001
        Value:
          type: string
          description: The CATEGORY or SKU value.
          example: CA
        Name:
          type: string
          description: Display name for the item.
          example: California
        MatchMode:
          type: string
          description: How the value is matched against incoming actions.
          enum: [EQ, REGEX]
        ListId:
          type: integer
          description: The unique identifier of the parent exception list.
          example: 99999
        CreatedDate:
          type: string
          format: date-time
          description: The date and time the item was created.
          example: '2026-01-15T10:00:00-08:00'
        Uri:
          type: string
          format: uri-reference
          description: The unique reference to this item in the impact.com API.
    ExceptionListState:
      type: string
      enum: [ACTIVE, CLOSED, DEACTIVATED]
    ExceptionListType:
      type: string
      enum: [CATEGORY, SKU]
    SuccessUriResponse:
      type: object
      properties:
        Status:
          type: string
          description: Indicates whether the operation was successful.
          example: OK
        Uri:
          type: string
          format: uri-reference
          description: The unique reference to the affected resource.
  responses:
    SuccessDeleteResponse:
      description: The resource was successfully deleted.
      content:
        application/json:
          schema:
            type: object
            properties:
              Status:
                type: string
                description: Indicates that the resource was deleted.
                example: DELETED
