PATCH
/
audiences
/
{id}
curl --request PATCH \
  --url https://wt.ls/api/v4/audiences/{id} \
  --header 'Content-Type: application/json' \
  --header 'apiKey: <api-key>' \
  --data '{
  "name": "<string>",
  "filters": "{\"points\": {\"gte\": 100}, \"AND\": [{\"email\": {\"contains\": \"@gmail.com\"}}]}",
  "mode": "smart"
}'
{
  "data": {
    "audience": {
      "id": "<string>",
      "name": "<string>",
      "filters": "<string>",
      "mode": "smart",
      "listId": "<string>",
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z",
      "subs": [
        {
          "id": "<string>",
          "email": "<string>",
          "firstName": "<string>",
          "lastName": "<string>",
          "phoneNumber": "<string>",
          "createdAt": "2023-11-07T05:31:56Z",
          "points": 123,
          "referrals": 123,
          "listId": "<string>",
          "isVerified": true,
          "unsubscribed": true,
          "customData": {},
          "address": "<string>",
          "isGDPR": true,
          "name": "<string>",
          "instagram": "<string>",
          "twitter": "<string>",
          "website": "<string>",
          "company": "<string>",
          "country": "<string>",
          "city": "<string>",
          "list": {},
          "audiences": [
            "<any>"
          ],
          "referralLink": "<string>",
          "privateLink": "<string>"
        }
      ]
    }
  }
}

Authorizations

apiKey
string
header
required

API key to authorize requests

Path Parameters

id
string
required

ID of the audience to update

Body

application/json
name
string

Name of the audience

filters
string

JSON string containing Prisma where clause for Sub model. Required if mode is 'smart'

mode
enum<string>

Audience mode

Available options:
smart,
manual

Response

200
application/json
Audience updated successfully
data
object