---
title: "Get a List of Attachments"
method: GET
path: "/attachments"
tags: ["Targeting Attachments"]
---

# Get a List of Attachments

`GET /attachments`

## Request

- Base URL: `https://api.mediamath.com/api/v3.0`
- URL: `https://api.mediamath.com/api/v3.0/attachments`
- Auth: OAuth 2
  - Authorization code: `https://auth.mediamath.com/authorize`
  - Token URL: `https://auth.mediamath.com/oauth/token` scopes: `offline_access`, `manage:services`
- TypeScript: <https://skmtc.dev/mediamath/apis/campaigns-api/docs/attachments/get.ts> (a function with typed inputs; its response is checked against the schema)

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`.

## Query parameters

- `page_limit` integer
- `page_offset` integer
- `sort_by` string
- `q` string
- `strategy_id` integer
- `dimension` string

## Response `200`

Attachments list response

- object
  - `data` AttachmentBase[]
    - `id` integer, required
    - `entity_type` string, required
    - `target_id` number, required
    - `strategy_id` number, required
    - `restriction` 'INCLUDE' | 'EXCLUDE', required
    - `operator` 'OR' | 'AND', required
    - `created_on` string, required
    - `updated_on` string, required
    - `version` number, required
    - `or_better` boolean
  - `meta` ListMetadata
    - `status` string, required: The status of the response, indicating success or failure.
    - `count` integer, required: The number of items returned in the current response.
    - `total_count` integer: The total number of items available in the dataset.
    - `offset` integer: The offset from the start of the dataset, used for pagination.
    - `next_page` string: The URL to fetch the next page of results.
    - `prev_page` string: The URL to fetch the previous page of results.

## Other responses

- `400`: Error response
- `401`: Error response
- `403`: Error response

---

[API](https://skmtc.dev/mediamath/apis/campaigns-api.md) - [All operations](https://skmtc.dev/mediamath/apis/campaigns-api/llms.txt) - [OpenAPI document](https://skmtc.dev/mediamath/apis/campaigns-api/revisions/408743891def?raw)
