---
title: "Apply Taxonomy Upload"
method: POST
path: "/targeting_segments/taxonomy_upload/apply"
tags: ["Targeting Segments"]
---

# Apply Taxonomy Upload

`POST /targeting_segments/taxonomy_upload/apply`

## Request

- Base URL: `https://api.mediamath.com/api/v3.0`
- URL: `https://api.mediamath.com/api/v3.0/targeting_segments/taxonomy_upload/apply`
- 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/targeting_segments/taxonomy_upload/apply/post.ts> (a function with typed inputs; its response is checked against the schema)

Validates a CSV taxonomy file for the given targeting vendor and, if valid,
commits all changes to the database (inserts, updates, retirements).
Returns the same impact report as the dry-run endpoint, with the header
message `THE FOLLOWING CHANGES HAVE BEEN APPLIED!`.

## Request body `multipart/form-data`

- TaxonomyUpload
  - `targeting_vendor` string, required: Two-character alphanumeric namespace code identifying the targeting vendor (e.g. `mm`). Must match an existing record in `targeting_vendors`.
  - `file` string, binary, required: CSV taxonomy file. Expected columns (header row required): `full_path`, `code`, `uniques`, `wholesale_cpm`, `retail_cpm`, `buyable`, `objective`. Lines beginning with `#` are ignored.

## Response `200`

CSV impact report. The same format is returned by both the dry-run and apply
endpoints. Response headers carry the numeric counts; the body is a CSV
attachment with two summary blocks followed by an optional affected-strategies
table.

## Other responses

- `400`: Error response
- `401`: Error response
- `403`: Error response
- `409`: 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)
