POST
/
v2
/
saved
/
audiences
curl --request POST \
  --url https://api.globalwebindex.com/v2/saved/audiences \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "Male with credit card and short-term loan",
  "expression": {
    "and": [
      {
        "question": "q2",
        "datapoints": [
          "q2_1"
        ]
      },
      {
        "question": "gwi-ext.q1014a",
        "datapoints": [
          "q1014a",
          "q1014b"
        ],
        "suffixes": [
          "1"
        ]
      }
    ]
  },
  "folder_id": "b140035b-3adc-43bf-a39d-8e8005c8af2a",
  "position": 128,
  "datasets": [
    "ds-core",
    "ds-96c906f1"
  ]
}'
{
  "data": {
    "id": "8f568af7-a225-40fd-992f-839d8f0ed499",
    "name": "Male with credit card and short-term load",
    "expression": {
      "and": [
        {
          "question": "q2",
          "datapoints": [
            "q2_1"
          ]
        },
        {
          "question": "gwi-ext.q1014a",
          "datapoints": [
            "q1014a",
            "q1014b"
          ],
          "suffixes": [
            "1"
          ]
        }
      ]
    },
    "flags": [
      "authored",
      "curated",
      "isP2"
    ],
    "folder_id": "b140035b-3adc-43bf-a39d-8e8005c8af2a",
    "position": 128.1,
    "permissions": {
      "audience_overall": "containsUnknownData"
    },
    "datasets": [
      "ds-core",
      "ds-96c906f1"
    ]
  }
}

Authorizations

Authorization
string
header
required

Body

application/json
audience to store
name
string
required

Human readable name

expression
object
required

Flexible expression of audience scope.

folder_id
string
required

null/nil uuid or folder uuid

position
number
required

Position to give to be able to sort.

flags
enum<string>[]

additional flags about audience

Available options:
authored,
curated,
isP2
datasets
string[]

dataset codes

Response

200
application/json
Saved audience
id
string
required

Unique ID of saved audience

v1_id
integer
required

v1 ID of an audience if applicable or null

name
string
required

Human readable name

expression
object
required

Flexible expression of audience scope.

created_at
string
required

when item was created

updated_at
string
required

when item was updated

folder_id
string
required

null/nil uuid or folder uuid

position
number
required

items are sorted by numeric position

permissions
object
required
datasets
string[]
required

dataset codes

flags
enum<string>[]

additional flags about audience

Available options:
authored,
curated,
isP2