# Create an audience

You can create a new audience by providing a name and optional predicates.

Endpoint: POST /audiences
Version: Preview
Security: bearerAuth

## Header parameters:

  - `Intercom-Version` (string)

## Request fields (application/json):

  - `name` (string, required)
    The name of the audience.
    Example: VIP Customers

  - `predicates` (array)
    The predicates that define the audience matching rules.
    Example: [{"attribute":"company.name","type":"string","comparison":"eq","value":"Intercom"}]

  - `predicates.attribute` (string)
    The attribute to evaluate.
    Example: company.name

  - `predicates.type` (string)
    The data type of the attribute.
    Example: string

  - `predicates.comparison` (string)
    The comparison operator.
    Example: eq

  - `predicates.value` (string)
    The value to compare against.
    Example: Intercom

  - `role_predicates` (array)
    The role predicates that define audience role-based matching rules.
    Example: [{"attribute":"role","type":"role","comparison":"eq","value":"user"}]

## Response 201 fields (application/json):

  - `type` (string)
    The type of object.
    Enum: "audience"

  - `id` (string)
    The unique identifier representing the audience.
    Example: 123

  - `name` (string)
    The name of the audience.
    Example: VIP Customers

  - `predicates` (array)
    The predicates that define the audience matching rules.
    Example: [{"attribute":"company.name","type":"string","comparison":"eq","value":"Intercom"}]

  - `predicates.attribute` (string)
    The attribute to evaluate.
    Example: company.name

  - `predicates.type` (string)
    The data type of the attribute.
    Example: string

  - `predicates.comparison` (string)
    The comparison operator.
    Example: eq

  - `predicates.value` (string)
    The value to compare against.
    Example: Intercom

  - `role_predicates` (array)
    The role predicates that define audience role-based matching rules.
    Example: [{"attribute":"role","type":"role","comparison":"eq","value":"user"}]

  - `created_at` (integer)
    The time the audience was created as a Unix timestamp.
    Example: 1717200000

  - `updated_at` (integer)
    The time the audience was last updated as a Unix timestamp.
    Example: 1717200000

## Response 401 fields (application/json):

  - `type` (string, required)
    The type is error.list
    Example: error.list

  - `request_id` (string)
    Example: f93ecfa8-d08a-4325-8694-89aeb89c8f85

  - `errors` (array, required)
    An array of one or more error objects

  - `errors.code` (string, required)
    A string indicating the kind of error, used to further qualify the HTTP response code
    Example: unauthorized

  - `errors.message` (string)
    Optional. Human readable description of the error.
    Example: Access Token Invalid

  - `errors.field` (string)
    Optional. Used to identify a particular field or query parameter that was in error.
    Example: email

## Response 403 fields (application/json):

  - `type` (string, required)
    The type is error.list
    Example: error.list

  - `request_id` (string)
    Example: f93ecfa8-d08a-4325-8694-89aeb89c8f85

  - `errors` (array, required)
    An array of one or more error objects

  - `errors.code` (string, required)
    A string indicating the kind of error, used to further qualify the HTTP response code
    Example: unauthorized

  - `errors.message` (string)
    Optional. Human readable description of the error.
    Example: Access Token Invalid

  - `errors.field` (string)
    Optional. Used to identify a particular field or query parameter that was in error.
    Example: email

## Response 422 fields (application/json):

  - `type` (string, required)
    The type is error.list
    Example: error.list

  - `request_id` (string)
    Example: f93ecfa8-d08a-4325-8694-89aeb89c8f85

  - `errors` (array, required)
    An array of one or more error objects

  - `errors.code` (string, required)
    A string indicating the kind of error, used to further qualify the HTTP response code
    Example: unauthorized

  - `errors.message` (string)
    Optional. Human readable description of the error.
    Example: Access Token Invalid

  - `errors.field` (string)
    Optional. Used to identify a particular field or query parameter that was in error.
    Example: email

