---
metadata:
  - name: generator
    content: Diplodoc Platform v5.55.3
alternate:
  - https://yandex.com/dev/audience/en/management/formats.md
  - https://yandex.com/dev/audience/ru/management/formats.md
  - href: https://yandex.com/dev/audience/en/management/formats.md
    type: text/markdown
    title: Markdown version
  - href: https://yandex.com/dev/audience/en/llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/audience/en/llms.txt

# Formats for input and output data

## Input data format {#input}

Input data structures for POST and PUT methods are passed in the request body. The input structures match the output structures of GET methods for the corresponding resources.

{% note tip %}

To form input structures correctly for POST and PUT methods, call the GET method for an existing resource. Copy the structure you receive and set the field values as needed.

{% endnote %}

POST and PUT methods in the API accept data in JSON format.

The input data format is specified in the HTTP `Content-Type` header.

Acceptable header values:
- `application/json` — JSON format.
- `multipart/form-data` — Used for uploading files (refer to the [multipart/form-data format](http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.2)).

## Output data format {#result}

The API returns responses in UTF-8 encoding. Responses are in JSON format.

For example, the following request will return a list of available segments:

```no-highlight translate=no
GET https://api-audience.yandex.com/v1/management/segments
```

Example:

```no-highlight translate=no
GET /v1/management/segments HTTP/1.1
Host: https://api-audience.yandex.com
Authorization: OAuth <access_token>
Content-Type: application/json
Content-Length: 127

{
     "segments" : [{
           "id" : 1111,
           "name" : "numbers",
           ...
        },
        {
           "id" : 1122,
           "name" : "e-mail",
           ...
        }
     ]
}
```

For debugging, results can be formatted. To get a formatted response, pass the `pretty` parameter set to `1` in any type of request.

```httpget translate=no
GET https://api-audience.yandex.com/v1/management/segments?pretty=1
PUT https://api-audience.yandex.com/v1/management/segments?pretty=1
```

When DELETE methods are completed successfully, the API returns the HTTP status with the code `200`. If the HTTP status code is different, the delete operation was unsuccessful.

