Default Target Audiences
Base URL: https://app.neuroflash.com/api/audience-service
Get the default target audience
GET
/v1/workspaces/{workspaceId}/default-target-audiencePath Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
customerId | integer | — |
Response
FieldTypeDescription
createdAtstringTimestamp when the resource was createdcreatedByUserIdstringnot set for workspaces imported from legacy teamidstringUnique identifier for the resourcelegacyCustomerIdintegertargetAudienceIdstringupdatedAtstringTimestamp when the resource was last updatedworkspaceIdstringExample
- cURL
- Python
- Node.js
- Go
curl "https://app.neuroflash.com/api/audience-service/v1/workspaces/{workspace_id}/default-target-audience" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
import requests
response = requests.get(
f"https://app.neuroflash.com/api/audience-service/v1/workspaces/{workspace_id}/default-target-audience",
headers={"Authorization": f"Bearer {token}"},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/audience-service/v1/workspaces/${workspaceId}/default-target-audience`,
{ headers: { Authorization: `Bearer ${token}` } }
).then((r) => r.json());
req, _ := http.NewRequest("GET", "https://app.neuroflash.com/api/audience-service/v1/workspaces/"+workspaceID+"/default-target-audience", nil)
req.Header.Set("Authorization", "Bearer "+token)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Response:
{
"createdAt": "2024-01-15T10:30:00Z",
"createdByUserId": "string",
"id": "string",
"legacyCustomerId": 0,
"targetAudienceId": "string",
"updatedAt": "2024-01-15T10:30:00Z",
"workspaceId": "string"
}
Set the default target audience
PUT
/v1/workspaces/{workspaceId}/default-target-audiencePath Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
customerId | integer | — |
Request Body
FieldTypeRequiredDescription
targetAudienceIdstringYesResponse
FieldTypeDescription
createdAtstringTimestamp when the resource was createdcreatedByUserIdstringnot set for workspaces imported from legacy teamidstringUnique identifier for the resourcelegacyCustomerIdintegertargetAudienceIdstringupdatedAtstringTimestamp when the resource was last updatedworkspaceIdstringExample
- cURL
- Python
- Node.js
- Go
curl -X PUT "https://app.neuroflash.com/api/audience-service/v1/workspaces/{workspace_id}/default-target-audience" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"targetAudienceId": "string"
}'
import requests
response = requests.put(
f"https://app.neuroflash.com/api/audience-service/v1/workspaces/{workspace_id}/default-target-audience",
headers={"Authorization": f"Bearer {token}", "Content-Type": "application/json"},
json={
"targetAudienceId": "string"
},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/audience-service/v1/workspaces/${workspaceId}/default-target-audience`,
{
method: "PUT",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"targetAudienceId": "string"
}),
}
).then((r) => r.json());
body, _ := json.Marshal(map[string]any{
"targetAudienceId": "string",
})
req, _ := http.NewRequest("PUT", "https://app.neuroflash.com/api/audience-service/v1/workspaces/"+workspaceID+"/default-target-audience", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Response:
{
"createdAt": "2024-01-15T10:30:00Z",
"createdByUserId": "string",
"id": "string",
"legacyCustomerId": 0,
"targetAudienceId": "string",
"updatedAt": "2024-01-15T10:30:00Z",
"workspaceId": "string"
}
List default target audiences
GET
/v1/workspaces/{workspaceId}/default-target-audiencesPath Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
customerId | integer | — |
Example
- cURL
- Python
- Node.js
- Go
curl "https://app.neuroflash.com/api/audience-service/v1/workspaces/{workspace_id}/default-target-audiences" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
import requests
response = requests.get(
f"https://app.neuroflash.com/api/audience-service/v1/workspaces/{workspace_id}/default-target-audiences",
headers={"Authorization": f"Bearer {token}"},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/audience-service/v1/workspaces/${workspaceId}/default-target-audiences`,
{ headers: { Authorization: `Bearer ${token}` } }
).then((r) => r.json());
req, _ := http.NewRequest("GET", "https://app.neuroflash.com/api/audience-service/v1/workspaces/"+workspaceID+"/default-target-audiences", nil)
req.Header.Set("Authorization", "Bearer "+token)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Response:
[
{
"createdAt": "2024-01-15T10:30:00Z",
"createdByUserId": "string",
"id": "string",
"legacyCustomerId": 0,
"targetAudienceId": "string",
"updatedAt": "2024-01-15T10:30:00Z",
"workspaceId": "string"
}
]