Create a new audience

This API allows you to create a new audience

Note:

parentId, categoryId, or categoryName are only supported for tenants where ABAC is enabled

Example 1: Segment with IS_NOT operator

  "name": "date type auidence",
  "type": "mixed",
  "rule": {
    "AND": [
      {
        "AND": [
          {
            "values": [
              {
                "label": "date",
                "value": "2025-11-21"
              }
            ],
            "attribute": "start_date",
            "operator": "ON",
            "fieldType": "regular"
          },
          {
            "values": [
              {
                "label": "date",
                "value": "2025-11-21"
              }
            ],
            "attribute": "start_date",
            "operator": "ON_OR_BEFORE",
            "fieldType": "regular"
          },
          {
            "values": [
              {
                "label": "date",
                "value": "2025-11-21"
              }
            ],
            "attribute": "start_date",
            "operator": "ON_OR_AFTER",
            "fieldType": "regular"
          },
          {
            "values": [
              {
                "label": "date",
                "value": "2025-11-21"
              }
            ],
            "attribute": "start_date",
            "operator": "BEFORE",
            "fieldType": "regular"
          },
          {
            "values": [
              {
                "label": "date",
                "value": "2025-11-21"
              }
            ],
            "attribute": "start_date",
            "operator": "AFTER",
            "fieldType": "regular"
          }
        ]
      },
      {
        "AND": [
          {
            "values": [
              {
                "label": "startDate",
                "value": "2025-11-21"
              },
              {
                "label": "endDate",
                "value": "2025-11-21"
              }
            ],
            "attribute": "start_date",
            "operator": "BETWEEN",
            "fieldType": "regular"
          }
        ]
      }
    ]
  },
  "sourceType": "app_managed",
  "categoryId": "57cc74a4-c059-428d-914c-caa4eba702a2"
} ```

**Example 2: User ID with IS operator and First Name/Last Name with CONTAINS/STARTS_WITH**
``` {
  "name": "Audience with user ID and name filters",
  "type": "mixed",
  "rule": {
    "AND": [
      {
        "AND": [
          {
            "values": [
              {
                "value": "85dcc783-6afd-4871-9ad6-637abb29841b"
              },
              {
                "value": "0c6fa051-c4f8-4a1d-9636-7da661e11c97"
              }
            ],
            "attribute": "userId",
            "operator": "IS",
            "fieldType": "regular"
          }
        ]
      },
      {
        "AND": [
          {
            "values": [
              {
                "value": "abc"
              }
            ],
            "attribute": "firstName",
            "operator": "CONTAINS",
            "fieldType": "regular"
          },
          {
            "values": [
              {
                "value": "Cena"
              }
            ],
            "attribute": "lastName",
            "operator": "STARTS_WITH",
            "fieldType": "regular"
          }
        ]
      }
    ]
  },
  "sourceType": "app_managed",
  "parentId": "39437d92-9be0-4a25-8543-55bdab74df4e"
} ```

**Example 3: Start Date with BEFORE/ON_OR_BEFORE and Is Manager with IS (with OR condition)**
``` {
  "name": "Audience with date and manager filters",
  "type": "mixed",
  "rule": {
    "AND": [
      {
        "AND": [
          {
            "values": [
              {
                "value": "2025-11-07"
              }
            ],
            "attribute": "startDate",
            "operator": "BEFORE",
            "fieldType": "regular"
          }
        ]
      },
      {
        "OR": [
          {
            "values": [
              {
                "value": "True"
              }
            ],
            "attribute": "isManager",
            "operator": "IS",
            "fieldType": "regular"
          },
          {
            "values": [
              {
                "value": "2026-11-19"
              }
            ],
            "attribute": "startDate",
            "operator": "ON_OR_BEFORE",
            "fieldType": "regular"
          }
        ]
      }
    ]
  },
  "sourceType": "app_managed",
  "categoryId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
} ```

**Example 4: City and Country Name with various operators**
``` {
  "name": "Audience with location filters",
  "type": "mixed",
  "rule": {
    "AND": [
      {
        "AND": [
          {
            "values": [
              {
                "value": "Cha"
              }
            ],
            "attribute": "city",
            "operator": "STARTS_WITH",
            "fieldType": "regular"
          },
          {
            "values": [
              {
                "value": "Chandigarh"
              }
            ],
            "attribute": "city",
            "operator": "IS_NOT",
            "fieldType": "regular"
          },
          {
            "values": [
              {
                "value": "India"
              }
            ],
            "attribute": "country",
            "operator": "IS",
            "fieldType": "regular"
          }
        ]
      }
    ]
  },
  "sourceType": "app_managed",
  "categoryName": "Marketing Team"
} ```

**Example 5: Custom Field with CONTAINS operator**
``` {
  "name": "Audience with custom field filter",
  "type": "mixed",
  "rule": {
    "AND": [
      {
        "AND": [
          {
            "values": [
              {
                "value": "udaipur"
              }
            ],
            "attribute": "city__c",
            "operator": "CONTAINS",
            "fieldType": "regular"
          }
        ]
      }
    ]
  },
  "sourceType": "app_managed",
  "parentId": "39437d92-9be0-4a25-8543-55bdab74df4e"
} ```
**Example 6: Multiple attribute with multiple operator**
``` {
  "name": "Testing audience",
  "type": "mixed",
  "rule": {
    "AND": [
      {
        "OR": [
          {
            "values": [
              {
                "value": "84c542ac-6fdf-4d37-8788-b0c4546eb9fa"
              }
            ],
            "attribute": "userId",
            "operator": "IS",
            "fieldType": "regular"
          },
          {
            "values": [
              {
                "value": "sim"
              }
            ],
            "attribute": "firstName",
            "operator": "CONTAINS",
            "fieldType": "regular"
          },
          {
            "values": [
              {
                "value": "CDX Tech"
              }
            ],
            "attribute": "businessUnit",
            "operator": "IS_NOT",
            "fieldType": "regular"
          }
        ]
      },
      {
        "AND": [
          {
            "values": [
              {
                "value": "True"
              }
            ],
            "attribute": "isManager",
            "operator": "IS",
            "fieldType": "regular"
          }
        ]
      },
      {
        "AND": [
          {
            "values": [
              {
                "value": "add on name"
              }
            ],
            "attribute": "office_loc__c",
            "operator": "IS",
            "fieldType": "regular"
          }
        ]
      }
    ]
  },
  "sourceType": "app_managed",
  "parentId": "39437d92-9be0-4a25-8543-55bdab74df4e"
} ``` 
**Example 7: Business Unit, Company Name, State, Custom Field, and Title with various operators**
``` {
  "name": "Audience with business unit, company, location and custom field filters",
  "type": "mixed",
  "rule": {
    "AND": [
      {
        "AND": [
          {
            "values": [
              {
                "value": "CDX Tech"
              },
              {
                "value": "bus-unit-1"
              }
            ],
            "attribute": "businessUnit",
            "operator": "IS",
            "fieldType": "regular"
          },
          {
            "values": [
              {
                "value": "Simpplr Company"
              }
            ],
            "attribute": "companyName",
            "operator": "IS_NOT",
            "fieldType": "regular"
          }
        ]
      },
      {
        "AND": [
          {
            "values": [
              {
                "value": "abc"
              }
            ],
            "attribute": "state",
            "operator": "CONTAINS",
            "fieldType": "regular"
          },
          {
            "values": [
              {
                "value": "test"
              }
            ],
            "attribute": "department__c",
            "operator": "STARTS_WITH",
            "fieldType": "regular"
          },
          {
            "values": [
              {
                "value": "analyst"
              }
            ],
            "attribute": "title",
            "operator": "ENDS_WITH",
            "fieldType": "regular"
          }
        ]
      }
    ]
  },
  "sourceType": "app_managed",
  "categoryId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
} ```
Body Params
string
required
length between 1 and 100

Name of the audience

string
enum
required

Type of audience

Allowed:
string | null

Description of the audience

rule
object
required

Audience rule configuration with flexible AND/OR structure

string | null

Parent audience ID.

This is valid for only ABAC enabled tenants. For non-ABAC tenants, if you pass anything here it will throw error.

when you pass parentId in request, audience is created as a child audience of the given parent audience

string | null

Audience category name.

This is valid for only ABAC enabled tenants. For non-ABAC tenants, if you pass anything here it will throw error.

When you pass categoryName in the request, audience created is shown under the given category folder in the UI

If audience category with the same name does not exist, we will create one with the name

uuid | null

Audience category ID.

This is valid for only ABAC enabled tenants. For non-ABAC tenants, if you pass anything here it will throw error.

When you pass categoryId in the request, audience created is shown under the given category folder in the UI

string | null
enum

Source type of the audience

if nothing is passed it is considered as app_managed and app_managed is the only allowed while creating audience via the API

Allowed:
Responses

Language
Credentials
OAuth2
URL
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json