MediaMath Targeting Attachments API

TargetingAttachments

Operations 10

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /attachments List targeting attachments · Get a List of Attachments #
Ask an LLM
“Which targeting attachments are on a given strategy?”
“Can I search and sort targeting attachments by target or restriction?”
Tell an agent
List targeting attachments for strategy {strategy_id}.
Show targeting attachments matching {q}.
POST /attachments Attach a target to a strategy · Create an Attachment #
Ask an LLM
“How do I attach a targeting value to a strategy?”
“Can I set whether an attached target is included or excluded?”
Tell an agent
Attach target {target_id} to strategy {strategy_id} as {restriction} with operator {operator}.
Exclude target {target_id} from strategy {strategy_id} using operator {operator} and restriction {restriction}.
GET /attachment List attachments via the legacy endpoint · (Legacy) Get a List of Attachments #
Ask an LLM
“Is there an older endpoint that still lists targeting attachments?”
“How do I list attachments using the legacy singular attachment path?”
Tell an agent
List targeting attachments using the legacy endpoint.
Get all attachments from the older /attachment listing.
POST /attachment Attach a target via the legacy endpoint · (Legacy) Create an Attachment #
Ask an LLM
“Can I still create a targeting attachment through the legacy endpoint?”
“How does creating an attachment work on the older singular path?”
Tell an agent
Using the legacy endpoint, attach target {target_id} to strategy {strategy_id} as {restriction} with {operator}.
Create a legacy attachment linking target {target_id} and strategy {strategy_id}, restriction {restriction}, operator {operator}.
GET /attachments/{attachment_id} Get a targeting attachment · Get an Attachment #
Ask an LLM
“How do I look up one targeting attachment by its ID?”
“What target and strategy is a given attachment linked to?”
Tell an agent
Get targeting attachment {attachment_id}.
Show the details of attachment {attachment_id}.
POST /attachments/{attachment_id} Update a targeting attachment · Update an Attachment #
Ask an LLM
“Can I change the restriction or operator on an existing attachment?”
“Why does updating an attachment require its version number?”
Tell an agent
Update attachment {attachment_id} at version {version} to restriction {restriction}.
Switch attachment {attachment_id} (version {version}) to operator {operator}.
DELETE /attachments/{attachment_id} Delete a targeting attachment · Delete an Attachment #
Ask an LLM
“How do I remove a targeting attachment from a strategy?”
“Can I delete an attachment by its ID?”
Tell an agent destructive · confirm first
Delete targeting attachment {attachment_id}.
Remove attachment {attachment_id} from its strategy.
GET /attachment/{attachment_id} Get an attachment via the legacy endpoint · (Legacy) Get an Attachment #
Ask an LLM
“Can I fetch a single attachment from the legacy singular path?”
“How do I read one attachment using the older endpoint?”
Tell an agent
Get attachment {attachment_id} from the legacy endpoint.
Look up attachment {attachment_id} using the older /attachment path.
PUT /attachment/{attachment_id} Update an attachment via the legacy PUT · (Legacy) Update an Attachment #
Ask an LLM
“Is there a legacy PUT endpoint for updating attachments?”
“How do I update an attachment through the older singular path?”
Tell an agent
Using the legacy PUT, update attachment {attachment_id} at version {version}.
Change legacy attachment {attachment_id} (version {version}) to target {target_id}.
DELETE /attachment/{attachment_id} Delete an attachment via the legacy endpoint · (Legacy) Delete an Attachment #
Ask an LLM
“Can I delete an attachment through the legacy singular path?”
“How do I remove an attachment using the older endpoint?”
Tell an agent destructive · confirm first
Delete attachment {attachment_id} via the legacy endpoint.
Remove attachment {attachment_id} using the older /attachment path.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/mediamath:mediamath-targeting-attachments-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

mediamath-targeting-attachments-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Campaigns Targeting Attachments API
  description: 'MediaMath Campaign Management API


    Postman Collection'
  version: 3.0.1807
  contact:
    url: https://support.infillion.com/
servers:
- url: https://api.mediamath.com/api/v3.0
  description: Live Server
security:
- Auth0:
  - offline_access
  - manage:services
tags:
- name: Targeting Attachments
  description: TargetingAttachments
paths:
  /attachments:
    get:
      operationId: list-attachments
      summary: Get a List of Attachments
      description: 'Get a list of attachments. Attachments can be queried and sorted by fields:

        - `id`,

        - `target_id`,

        - `strategy_id`,

        - `restriction`,

        - `operator`,

        - `created_on`,

        - `updated_on`,

        - `version`,

        - `or_better`.'
      tags:
      - Targeting Attachments
      parameters:
      - $ref: '#/components/parameters/page_limit'
      - $ref: '#/components/parameters/page_offset'
      - $ref: '#/components/parameters/sort_by'
      - $ref: '#/components/parameters/q'
      - in: query
        name: strategy_id
        schema:
          type: integer
          example: 123
        required: false
        description: If provided, only attachments for given strategy_id will be returned.
      - in: query
        name: dimension
        schema:
          type: string
          example: WURF,BRLG
        required: false
        description: "If provided, only attachments for given dimension will be returned. \nCan be used with one or several dimensions.\n"
      responses:
        '200':
          $ref: '#/components/responses/attachments_list'
        '400':
          $ref: '#/components/responses/error'
        '401':
          $ref: '#/components/responses/error'
        '403':
          $ref: '#/components/responses/error'
    post:
      operationId: create-attachment
      summary: Create an Attachment
      description: Create an attachment
      tags:
      - Targeting Attachments
      responses:
        '201':
          $ref: '#/components/responses/attachment'
        '400':
          $ref: '#/components/responses/error'
        '401':
          $ref: '#/components/responses/error'
        '403':
          $ref: '#/components/responses/error'
      requestBody:
        $ref: '#/components/requestBodies/attachment_create'
  /attachment:
    get:
      operationId: list-attachments-legacy
      summary: (Legacy) Get a List of Attachments
      description: Get a list of attachments
      tags:
      - Targeting Attachments
      responses:
        '200':
          $ref: '#/components/responses/collection'
        '400':
          $ref: '#/components/responses/error'
        '401':
          $ref: '#/components/responses/error'
        '403':
          $ref: '#/components/responses/error'
        '404':
          $ref: '#/components/responses/error'
    post:
      operationId: create-attachment-legacy
      summary: (Legacy) Create an Attachment
      description: Create an attachment
      tags:
      - Targeting Attachments
      responses:
        '201':
          $ref: '#/components/responses/attachment'
        '400':
          $ref: '#/components/responses/error'
        '401':
          $ref: '#/components/responses/error'
        '403':
          $ref: '#/components/responses/error'
      requestBody:
        $ref: '#/components/requestBodies/attachment_create'
  /attachments/{attachment_id}:
    get:
      operationId: get-attachment
      summary: Get an Attachment
      description: Get an attachment by ID
      tags:
      - Targeting Attachments
      responses:
        '200':
          $ref: '#/components/responses/attachment'
        '400':
          $ref: '#/components/responses/error'
        '401':
          $ref: '#/components/responses/error'
        '403':
          $ref: '#/components/responses/error'
        '404':
          $ref: '#/components/responses/error'
      parameters:
      - schema:
          type: integer
          format: int64
        name: attachment_id
        in: path
        required: true
        description: Numeric ID of the attachment to get
    post:
      operationId: update-attachment
      summary: Update an Attachment
      description: Update an attachment by ID
      tags:
      - Targeting Attachments
      responses:
        '200':
          $ref: '#/components/responses/attachment'
        '400':
          $ref: '#/components/responses/error'
        '401':
          $ref: '#/components/responses/error'
        '403':
          $ref: '#/components/responses/error'
        '404':
          $ref: '#/components/responses/error'
        '409':
          $ref: '#/components/responses/error'
      requestBody:
        $ref: '#/components/requestBodies/attachment_update'
      parameters:
      - schema:
          type: integer
          format: int64
        name: attachment_id
        in: path
        required: true
        description: Numeric ID of the attachment to update
    delete:
      operationId: delete-attachment
      summary: Delete an Attachment
      description: Delete an attachment by ID
      tags:
      - Targeting Attachments
      responses:
        '200':
          $ref: '#/components/responses/attachment_deleted'
        '400':
          $ref: '#/components/responses/error'
        '401':
          $ref: '#/components/responses/error'
        '403':
          $ref: '#/components/responses/error'
        '404':
          $ref: '#/components/responses/error'
      parameters:
      - schema:
          type: integer
          format: int64
        name: attachment_id
        in: path
        required: true
        description: Numeric ID of the attachment to delete
  /attachment/{attachment_id}:
    get:
      operationId: get-attachment-legacy
      summary: (Legacy) Get an Attachment
      description: Get an attachment by ID
      tags:
      - Targeting Attachments
      responses:
        '200':
          $ref: '#/components/responses/attachment'
        '400':
          $ref: '#/components/responses/error'
        '401':
          $ref: '#/components/responses/error'
        '403':
          $ref: '#/components/responses/error'
        '404':
          $ref: '#/components/responses/error'
      parameters:
      - schema:
          type: integer
        name: attachment_id
        in: path
        required: true
        description: Numeric ID of the attachment to get
    put:
      operationId: update-attachment-legacy
      summary: (Legacy) Update an Attachment
      description: Update an attachment by ID
      tags:
      - Targeting Attachments
      responses:
        '200':
          $ref: '#/components/responses/attachment'
        '400':
          $ref: '#/components/responses/error'
        '401':
          $ref: '#/components/responses/error'
        '403':
          $ref: '#/components/responses/error'
        '404':
          $ref: '#/components/responses/error'
        '409':
          $ref: '#/components/responses/error'
      requestBody:
        $ref: '#/components/requestBodies/attachment_update'
      parameters:
      - schema:
          type: integer
        name: attachment_id
        in: path
        required: true
        description: Numeric ID of the attachment to update
    delete:
      operationId: delete-attachment-legacy
      summary: (Legacy) Delete an Attachment
      description: Delete an attachment by ID
      tags:
      - Targeting Attachments
      responses:
        '200':
          $ref: '#/components/responses/attachment_deleted'
        '400':
          $ref: '#/components/responses/error'
        '401':
          $ref: '#/components/responses/error'
        '403':
          $ref: '#/components/responses/error'
        '404':
          $ref: '#/components/responses/error'
      parameters:
      - schema:
          type: integer
        name: attachment_id
        in: path
        required: true
        description: Numeric ID of the attachment to delete
components:
  schemas:
    error_response:
      title: error response
      type: object
      required:
      - errors
      - meta
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
              field:
                description: Optional when it is a schema error
                type: string
              message:
                type: string
        meta:
          type: object
          required:
          - status
          properties:
            status:
              type: string
    single_metadata:
      title: single_metadata
      type: object
      properties:
        status:
          type: string
          example: success
      required:
      - status
    list_metadata:
      title: pagination metadata
      type: object
      properties:
        status:
          type: string
          example: success
          description: The status of the response, indicating success or failure.
        count:
          type: integer
          example: 10
          description: The number of items returned in the current response.
        total_count:
          type: integer
          example: 100
          description: The total number of items available in the dataset.
        offset:
          type: integer
          example: 0
          description: The offset from the start of the dataset, used for pagination.
        next_page:
          type: string
          description: The URL to fetch the next page of results.
        prev_page:
          type: string
          description: The URL to fetch the previous page of results.
      required:
      - status
      - count
    attachment_update:
      type: object
      properties:
        target_id:
          type: number
          minimum: 0
          format: int32
          example: 8
        version:
          type: number
          format: int32
          example: 1
        strategy_id:
          type: number
          minimum: 1
          format: int32
          example: 332
        restriction:
          type: string
          minLength: 1
          enum:
          - INCLUDE
          - EXCLUDE
        operator:
          type: string
          minLength: 1
          enum:
          - OR
          - AND
        or_better:
          type: boolean
      required:
      - version
    attachment_create:
      type: object
      properties:
        target_id:
          type: number
          minimum: 1
          format: int32
          example: 8
        strategy_id:
          type: number
          minimum: 0
          format: int32
          example: 332
        restriction:
          type: string
          minLength: 1
          enum:
          - INCLUDE
          - EXCLUDE
        operator:
          type: string
          minLength: 1
          enum:
          - OR
          - AND
        or_better:
          type: boolean
      required:
      - target_id
      - strategy_id
      - restriction
      - operator
    attachment_base:
      type: object
      properties:
        id:
          type: integer
          format: int64
          minimum: 1
        entity_type:
          type: string
          minLength: 1
          readOnly: true
        target_id:
          type: number
          minimum: 0
        strategy_id:
          type: number
          minimum: 1
        restriction:
          type: string
          minLength: 1
          enum:
          - INCLUDE
          - EXCLUDE
        operator:
          type: string
          minLength: 1
          enum:
          - OR
          - AND
        created_on:
          type: string
          readOnly: true
        updated_on:
          type: string
          readOnly: true
        version:
          type: number
          readOnly: true
        or_better:
          type: boolean
      required:
      - id
      - entity_type
      - target_id
      - strategy_id
      - restriction
      - operator
      - created_on
      - updated_on
      - version
  responses:
    attachment:
      description: Attachment response
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                $ref: '#/components/schemas/attachment_base'
              meta:
                $ref: '#/components/schemas/single_metadata'
    attachments_list:
      description: Attachments list response
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                type: array
                items:
                  $ref: '#/components/schemas/attachment_base'
              meta:
                $ref: '#/components/schemas/list_metadata'
    attachment_deleted:
      description: Attachment deleted response
      content:
        application/json:
          schema:
            type: object
            properties:
              meta:
                $ref: '#/components/schemas/single_metadata'
    error:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error_response'
    collection:
      description: Collection response
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                type:
                - array
                - 'null'
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                    name:
                      type: string
              meta:
                $ref: '#/components/schemas/list_metadata'
  parameters:
    sort_by:
      in: query
      name: sort_by
      description: "The field to sort by. You can use any field name in ascending or descending order.\nFor ascending order, use the field name directly, e.g., `id`. \nFor descending order, prefix the field name with a hyphen (`-`), e.g., `-id`.\n"
      schema:
        type: string
        example: id, -id, name, -name
      required: false
    page_offset:
      in: query
      name: page_offset
      schema:
        type: integer
        minimum: 0
        maximum: 1000
        example: 0
      required: false
      description: Index of the first element in the collection to retrieve
    page_limit:
      in: query
      name: page_limit
      schema:
        type: integer
        minimum: 1
        maximum: 1000
        example: 100
      required: false
      description: Number of elements in the collection to retrieve
    q:
      in: query
      name: q
      schema:
        type: string
      required: false
      description: "Query search for filtering. This parameter can be used to filter results based on various fields.\nSupported operators:\n- `==` - numeric equality or case-sensitive string identity, \n- `==(1,2,3)` - IN query (only works for integers),\n- `!=` - numeric inequality or case-sensitive string non-identity,\n- `=:` - case-insensitive match, allows substring using * wildcards,\n- `<` - less than,\n- `<=` - less than or equal to,\n- `>` - greater than,\n- `>=` - greater than or equal to.\nExamples: \n- `q=name=:{search}*` to find all results with names starting with {search}.\n- `q=status==true` to find all active entities.\n- `q=id>=1000` to find all entities with id greater than or equal to 1000.\n- `q=id==(1,2,3)` to find specific entities by ID.\n- `q=created_on>1999-02-02` or `q=created_on>1999-02-02T00:00:00Z` to find entities created later than date.\n- `q=id>5&status==true` to find all active entities with id greater than 5.\n"
  requestBodies:
    attachment_create:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/attachment_create'
    attachment_update:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/attachment_update'
  securitySchemes:
    Auth0:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://auth.mediamath.com/authorize
          scopes:
            offline_access: for refresh tokens
            manage:services: normal access
          tokenUrl: https://auth.mediamath.com/oauth/token
          refreshUrl: https://auth.mediamath.com/authorize?scope=offline_access
x-tagGroups:
- name: Hierarchy
  tags:
  - Advertisers
  - Agencies
  - Campaign Plans
  - Campaigns
  - Campaigns Budget Flights
  - New Strategy Plans
  - Organizations
  - Strategies
  - Strategy Parameters
  - Strategy Templates
- name: Targeting
  tags:
  - Segment Groups
  - Targeting
  - Targeting Attachments
  - Targeting Segment Objectives
  - Targeting Segments
- name: Creatives
  tags:
  - Atomic Creatives
  - Concepts
  - Creatives
  - Pixel Bundles
  - Pixel Providers
- name: Vendors & Contracts
  tags:
  - Audience Vendors
  - Contracts
  - Marketplaces
  - Vendor Contracts
  - Vendors
- name: Users & Access
  tags:
  - Enterprise Controls
  - User Permissions
  - Users
- name: Reference Data
  tags:
  - Ad Servers
  - Currency Rates
  - General
  - Sidekick Usage Logs
  - Site Lists
  - Supply Sources
  - Timezones
  - Verticals