# Structured Data Files

[Structured Data Files](https://developers.google.com/display-video/api/structured-data-file/format) (SDFs) are specially-formatted CSV files. They
allow bulk resource retrieval, creation, and editing in Display \& Video 360. Make
updates to resources in bulk by downloading, editing, and then re-uploading
SDFs.

The Display \& Video 360 UI supports [SDF downloads and uploads](https://support.google.com/displayvideo/answer/6301070). The
Display \& Video 360 API supports [SDF downloads](https://developers.google.com/display-video/api/guides/tasks/download-sdf/overview).

## Formats

An SDF uses one of two base formats, *Standard* and *QA*:

- You can download and upload *Standard* format files. The data in these files may use numeric IDs to ensure accuracy upon upload. Reference information may be required to interpret the data.
- You can download *QA* format files. These files provide the same data as Standard format files, but use more human-readable values. For example, some columns may use display names in the place of IDs. Columns specific to this format use the suffix "Qa".

## File types

SDF supports seven resource types. Each resource type has its own file type with
its own column structure. Supported resource types are:

- Campaign
- Insertion Order
- Line Item
- Ad Group
- Ad
- Inventory Source
- Media Product

Only *Line Item* and *Ad Group* file types support the *QA* format.

New SDF versions are [released regularly](https://developers.google.com/display-video/api/structured-data-file/rel-notes) and [earlier versions
are deprecated](https://developers.google.com/display-video/api/structured-data-file/deprecation). New versions update the file type column
structure. If necessary, a new SDF version will include a [migration
guide](https://developers.google.com/display-video/api/structured-data-file/migration-guide) at launch.

## Download errors

SDF downloads can result in two types of errors: *File generation* errors and
*Skipped* resources.

### File generation errors

SDF generation can terminate in error. If generation fails when using the
[Display \& Video 360 API](https://developers.google.com/display-video/api/guides/tasks/download-sdf/overview), the finished task will set its
[`error`](https://developers.google.com/display-video/api/reference/rest/current/sdfdownloadtasks.operations#Operation.FIELDS.error) field with [`Status`](https://developers.google.com/display-video/api/reference/rest/current/sdfdownloadtasks.operations#Operation.Status) object. The
[`Status`](https://developers.google.com/display-video/api/reference/rest/current/sdfdownloadtasks.operations#Operation.Status) object will contain a message detailing the cause of
the error.

Read more about these errors on our [Errors and warnings guide
page](https://developers.google.com/display-video/api/guides/concepts/general/errors-warnings).

### Skipped errors

SDFs don't support all resource subtypes. If a resource can't be included in an
SDF, a "Skipped" file (example: `SDF-LineItems-Skipped.csv`) will be included in
the download. This file has a two-column structure. The first column identifies
the skipped resource. The second column explains their exclusion.

## File upload

[Upload SDFs using the Display \& Video 360 UI](https://support.google.com/displayvideo/answer/6301070) to create new or update
existing resources.

Follow these steps to minimize errors when updating or creating resources with
SDFs:

1. Download SDFs using the [Display \& Video 360 API](https://developers.google.com/display-video/api/guides/tasks/download-sdf/overview) or UI.
2. Modify existing file entries to make updates to existing resources.
3. Add file entries to create new resources.
4. Remove any entries that are not new or updated. This reduces file size and removes the chance of unintentional updates.
5. Upload the file in the Display \& Video 360 UI.

After an SDF is uploaded and processed, a `SDF-ResultFile.zip` file is available
to download. This `ZIP` file can contain two possible files:

- `SDF-{ResourceType}-Updated-ResultFile.csv`, which lists the successfully updated or created resources.
- `SDF-{ResourceType}-Failed-ResultFile.csv`, which lists failed operations and relevant error messages.

The `ZIP` file may contain one or both files.