# POST /{environment}/targeting/audiences/requests

> Current Froomle documentation · [View canonical page](https://docs.froomle.com/froomle-doc-main/v2/api_reference/audience/operations/get_audience.html)

<a id="_description"></a>

## Description

Request an audience for a promotion.

<a id="_parameters"></a>

## Parameters

| Type | Name | Description | Schema |
| --- | --- | --- | --- |
| **Path** | **environment**<br>_required_ | The environment for which a request is made. | string |
| **Body** | **body**<br>_required_ |  | [AudienceTargetingRequest](https://docs.froomle.com/froomle-doc-main/v2/api_reference/audience/operations/get_audience.html#_audiencetargetingrequest) |

<a id="_responses"></a>

## Responses

| HTTP Code | Description | Schema |
| --- | --- | --- |
| **200** | Audience targeting request was successful. | [AudienceTargetingResponse](https://docs.froomle.com/froomle-doc-main/v2/api_reference/audience/operations/get_audience.html#_audiencetargetingresponse) |
| **400** | Audience targeting request is malformed or contains invalid values. | [ErrorBody](https://docs.froomle.com/froomle-doc-main/v2/api_reference/audience/operations/get_audience.html#_errorbody) |
| **401** | Not authorized to make an audience targeting request. | [ErrorBody](https://docs.froomle.com/froomle-doc-main/v2/api_reference/audience/operations/get_audience.html#_errorbody) |

<a id="_consumes"></a>

## Consumes

-   `application/json`
    

<a id="_produces"></a>

## Produces

-   `application/json`
    

<a id="_example_http_request"></a>

## Example HTTP request

<a id="_request_body"></a>

### Request body

```json
{
  "audience" : {
    "audience_configuration_id" : "some_configuration_id",
    "audience_id" : "dhoghesjwgotuy39",
    "audience_name" : "Don't miss this!",
    "audience_size" : 100,
    "integration_type" : "push_notification_app",
    "limit" : 3,
    "promotion" : [ {
      "id" : "item_1",
      "item_type" : "article"
    }, {
      "id" : "item_2",
      "item_type" : "article"
    } ]
  }
}
```

<a id="_example_http_response"></a>

## Example HTTP response

<a id="_response_200"></a>

### Response 200

```json
{
  "audience" : {
    "audience_configuration_id" : "some_configuration_id",
    "audience_id" : "dhoghesjwgotuy39",
    "audience_name" : "Don't miss this!",
    "audience_size" : 100,
    "integration_type" : "push_notification_app",
    "limit" : 3,
    "users" : [ {
      "id" : "user_1",
      "user_type" : "login"
    }, {
      "id" : "user_2",
      "user_type" : "login"
    }, {
      "id" : "user_3",
      "user_type" : "login"
    } ]
  }
}
```

* * *

<a id="_audiencetargetingrequest"></a>

### AudienceTargetingRequest

Request an audience for a promotion.

| Name | Description | Schema |
| --- | --- | --- |
| **audience**<br>_required_ | Audience object in request. | [audience](https://docs.froomle.com/froomle-doc-main/v2/api_reference/audience/operations/get_audience.html#_audiencetargetingrequest_audience) |

**audience**

| Name | Description | Schema |
| --- | --- | --- |
| **audience\_configuration\_id**<br>_required_ | Configuration ID to pose constraints upon audience. | string |
| **audience\_id**<br>_required_ | A unique identifier for the audience request which is to be supplied with each logged event. | string |
| **audience\_name**<br>_required_ | Name of the audience, to be passed in tracking events later. | string |
| **audience\_size**<br>_required_ | Total size of the audience requested. Use limit for pagination. | integer |
| **integration\_type**<br>_required_ | Name of the type of integration. | string |
| **limit**<br>_optional_ | Number of Users to be returned | integer |
| **partition\_audience\_by\_item**<br>_optional_ | If true, each user in the response is assigned to a particular item in the promotion.<br>**Default** : `false` | boolean |
| **promotion**<br>_required_ |  | [Promotion](https://docs.froomle.com/froomle-doc-main/v2/api_reference/audience/operations/get_audience.html#_promotion) |

<a id="_audiencetargetingresponse"></a>

### AudienceTargetingResponse

Response containing an audience for a promotion.

| Name | Description | Schema |
| --- | --- | --- |
| **audience**<br>_required_ | Audience object in response. | [audience](https://docs.froomle.com/froomle-doc-main/v2/api_reference/audience/operations/get_audience.html#_audiencetargetingresponse_audience) |

**audience**

| Name | Description | Schema |
| --- | --- | --- |
| **audience\_id**<br>_required_ | A unique identifier for the audience request which is to be supplied with each logged event. | string |
| **audience\_name**<br>_required_ | Name of the audience, to be passed in tracking events later. | string |
| **audience\_size**<br>_required_ | Total size of the audience requested. Use limit for pagination. | integer |
| **integration\_type**<br>_required_ | Name of the type of integration. | string |
| **limit**<br>_required_ | Number of Users to be returned | integer |
| **users**<br>_required_ | List containing User-objects. | < [User](https://docs.froomle.com/froomle-doc-main/v2/api_reference/audience/operations/get_audience.html#_user) > array |

<a id="_promotion"></a>

### Promotion

A collection of items we wish to promote to an audience.

_Type_ : < [Item](https://docs.froomle.com/froomle-doc-main/v2/api_reference/audience/operations/get_audience.html#_item) > array

<a id="_item"></a>

### Item

An Item object.

| Name | Description | Schema |
| --- | --- | --- |
| **id**<br>_required_ | Unique identifier of the item. | string |
| **item\_type**<br>_required_ | The type of the item. | string |

<a id="_user"></a>

### User

A User object.

| Name | Description | Schema |
| --- | --- | --- |
| **id**<br>_required_ | Unique identifier of the user. | string |
| **user\_type**<br>_required_ | Type of user identifier. Currently one of user\_id or device\_id. | string |

<a id="_errorbody"></a>

### ErrorBody

Error message.

| Name | Description | Schema |
| --- | --- | --- |
| **detail**<br>_optional_ | Detailed description of the error. | string |
| **status**<br>_optional_ | Status-code for the error. | integer |
| **title**<br>_optional_ | Name of the error. | string |
| **type**<br>_optional_ | Type of the exception thrown. | string |
