# Dry-run Taxonomy Upload

Validates a CSV taxonomy file for the given targeting vendor and returns
an impact report (segment counts before/after, diff, affected strategies).
**Nothing is written to the database** — this is a dry-run only.

Endpoint: POST /targeting_segments/taxonomy_upload
Version: 3.0.1807
Security: Auth0

## Security:

  - `Auth0` (unknown)
    oauth2 scopes: offline_access, manage:services

## Request fields (multipart/form-data):

  - `targeting_vendor` (string, required)
    Two-character alphanumeric namespace code identifying the targeting vendor (e.g. `mm`). Must match an existing record in `targeting_vendors`.
    Example: mm

  - `file` (string, 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:

  - `200` (unknown)
    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.

## Response 200 headers (text/csv):

  - `Content-Disposition` (string)
    Attachment filename in the form `attachment; filename=<VendorName>_taxonomy_update_report.csv`.

  - `X-Num-Targeting-Segments-Before` (integer)
    Number of active targeting segments before this upload.

  - `X-Num-Targeting-Segments-After` (integer)
    Number of active targeting segments after this upload.

  - `X-Num-Retired-Targeting-Segments-Before` (integer)
    Number of retired targeting segments before this upload.

  - `X-Num-Retired-Targeting-Segments-After` (integer)
    Number of retired targeting segments after this upload.

  - `X-Num-Strategy-Targeting-Segments-Before` (integer)
    Number of strategy-targeting-segment links before this upload.

  - `X-Num-Strategy-Targeting-Segments-After` (integer)
    Number of strategy-targeting-segment links after this upload.

  - `X-Num-Retired-Strategy-Targeting-Segments-Before` (integer)
    Number of retired strategy-targeting-segment links before this upload.

  - `X-Num-Retired-Strategy-Targeting-Segments-After` (integer)
    Number of retired strategy-targeting-segment links after this upload.

  - `X-Num-Segments-Updated` (integer)
    Number of existing segments whose fields would be/were updated.

  - `X-Num-Segments-Added` (integer)
    Number of new segments that would be/were inserted.

  - `X-Num-Segments-Removed` (integer)
    Number of segments that would be/were retired.

  - `X-Num-Strategies-Migrated` (integer)
    Number of distinct strategies that target at least one segment present in the uploaded taxonomy (i.e. segments being kept or updated).

  - `X-Num-Strategies-Targeting-Retired-Segments` (integer)
    Number of distinct strategies that were targeting at least one segment being retired.

## Response 400:

  - `400` (unknown)
    Error response

## Response 400 fields (application/json):

  - `errors` (array, required)

  - `errors.code` (string)

  - `errors.sub_code` (string)
    Optional identifier that refines the generic `code` category (e.g. `html5-noscript-tag`). Present on HTML5 upload/preview validation errors; absent otherwise.

  - `errors.field` (string)
    Optional when it is a schema error

  - `errors.message` (string)

  - `meta` (object, required)

  - `meta.status` (string, required)

## Response 401:

  - `401` (unknown)
    Error response

## Response 401 fields (application/json):

  - `errors` (array, required)

  - `errors.code` (string)

  - `errors.sub_code` (string)
    Optional identifier that refines the generic `code` category (e.g. `html5-noscript-tag`). Present on HTML5 upload/preview validation errors; absent otherwise.

  - `errors.field` (string)
    Optional when it is a schema error

  - `errors.message` (string)

  - `meta` (object, required)

  - `meta.status` (string, required)

## Response 403:

  - `403` (unknown)
    Error response

## Response 403 fields (application/json):

  - `errors` (array, required)

  - `errors.code` (string)

  - `errors.sub_code` (string)
    Optional identifier that refines the generic `code` category (e.g. `html5-noscript-tag`). Present on HTML5 upload/preview validation errors; absent otherwise.

  - `errors.field` (string)
    Optional when it is a schema error

  - `errors.message` (string)

  - `meta` (object, required)

  - `meta.status` (string, required)

