---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://yandex.com/dev/direct/doc/dg-v4/en/live/GetRetargetingGoals.md
  - https://yandex.com/dev/direct/doc/dg-v4/ru/live/GetRetargetingGoals.md
  - href: en/live/GetRetargetingGoals.md
    type: text/markdown
    title: Markdown version
  - href: ../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/direct/doc/dg-v4/en/llms.txt

# GetRetargetingGoals (Live)
Returns IDs of available goals and segments.
A direct advertiser can get the goals and segments that are available to delegates.

An advertising agency can get the goals and segments that are available to its clients.

## New in the Live 4 version

Added the Type output parameter.

## Related information

- [Retargeting](https://yandex.com/dev/direct/doc/dg-v4/en/concepts/retargeting.md)


## Input data {#input}

The input data structure in JSON is shown below.

```javascript
{
   "method": "GetRetargetingGoals",
   "param": {
      /* GetRetargetingGoalsRequest */
      "Logins": [
         (string)
         ...
      ]
   }
}
```


#|
||
**<sup >Parameter</sup>**
|
**<sup >Description</sup>**
|
**<sup >Required</sup>**
||

||
**<sub >GetRetargetingGoalsRequest object</sub>**
||
||
`Logins`
|
The parameter is used only when making the request on behalf of an advertising agency. Use this parameter to specify an array of client usernames (no more than 100) that you need to get a list of goals and segments for. If the parameter is omitted, the error message [71](https://yandex.com/dev/direct/doc/dg-v4/en/reference/ErrorCodes.md#ErrorCode71) is returned. If you specify a non-existing username or a username that does not belong to one of the agency's clients, the error message [54](https://yandex.com/dev/direct/doc/dg-v4/en/reference/ErrorCodes.md#ErrorCode54) is returned.

For direct advertisers, this parameter is ignored when attempting to set it, and the method returns the goals and segments that are available to at least one of the advertiser's delegates.
|
For advertising agencies
||
|#


## Output data {#output}

The output data structure in JSON is shown below.

```javascript
{
   "data": [
      {  /* RetargetingGoal */
         "GoalID": (long),
         "Name": (string),
         "GoalDomain": (string),
         "Type": (string),
         "Login": (string)
      }
      ...
   ]
}
```

Parameters are described below.


#|
||
**<sup >Parameter</sup>**
|
**<sup >Description</sup>**
||

||
**<sub >RetargetingGoal object</sub>**
||
||
`GoalID`
|
ID of the goal or segment.
||
||
`Name`
|
Name of the goal or segment.
||
||
`GoalDomain`
|
The domain that the Yandex Metrica tag is installed on.
||
||
`Type`
|
Type of object:

- goal — Yandex Metrica goal.
- segment — Yandex Metrica segment.
- audience_segment — Yandex Audience segment.
||
||
`Login`
|
The username of the client this goal or segment belongs to.
||
|#


## Examples of input data {#example}

## Python

```python
{
   'Logins': ['agrom','larry']
}
```

## PHP

```php
array(
   'Logins' => array('agrom','larry')
)
```

## Perl

```perl
{
   'Logins' => ['agrom','larry']
}
```


