Target Audiences
Base URL: https://app.neuroflash.com/api/audience-service
Create and manage target audience profiles for your workspace.
Create a new target audience
/v1/workspaces/{workspaceId}/target-audiencesCreates a new target audience for the specified workspace
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | Workspace ID |
Request Body
countrystringNogenderDistributionobjectYes
femalenumberYesmalenumberYesnonBinarynumberYespreferNotToSaynumberYesinterestsarray<string>YesA list of strings stored in the database as JSONmaxAgeintegerYesminAgeintegerYesWe store age range as separate min/max fields in the databasenamestringYesnativeLanguagestringNoneedsarray<string>YesA list of strings stored in the database as JSONpainPointsarray<string>YesA list of strings stored in the database as JSONresidencestringYessharedbooleanYesResponse
_embeddedobject
imageobjectAn image associated with a target audience
createdAtstringcreatedByUserIdstringfileNamestringFileName is used to generate a storage key which ends with the file name on duplication as wellidstringtargetAudienceIdstringupdatedAtstringurlstringpermissionsobject
canDeletebooleancanDuplicatebooleancanUpdatebooleancanViewbooleancountrystringcreatedAtstringcreatedByUserIdstringgenderDistributionobject
femalenumbermalenumbernonBinarynumberpreferNotToSaynumberidstringinterestsarray<string>A list of strings stored in the database as JSONmaxAgeintegerminAgeintegerWe store age range as separate min/max fields in the databasenamestringnativeLanguagestringneedsarray<string>A list of strings stored in the database as JSONownerCustomerIdintegerpainPointsarray<string>A list of strings stored in the database as JSONresidencestringsharedbooleanupdatedAtstringviewedAtstringworkspaceIdstringExample
The four genderDistribution fields (female, male, nonBinary, preferNotToSay) are all
required and their values must sum to exactly 1.0. The API returns a 400 error if any field
is missing or the sum is incorrect.
- cURL
- Python
- Node.js
- Go
curl -X POST "https://app.neuroflash.com/api/audience-service/v1/workspaces/{workspace_id}/target-audiences" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"country": "string",
"genderDistribution": {
"female": 0.5,
"male": 0.4,
"nonBinary": 0.07,
"preferNotToSay": 0.03
},
"interests": [],
"maxAge": 0,
"minAge": 0,
"name": "string",
"nativeLanguage": "string",
"needs": [],
"painPoints": [],
"residence": "string",
"shared": false
}'
import requests
response = requests.post(
f"https://app.neuroflash.com/api/audience-service/v1/workspaces/{workspace_id}/target-audiences",
headers={"Authorization": f"Bearer {token}", "Content-Type": "application/json"},
json={
"country": "string",
"genderDistribution": {
"female": 0.5,
"male": 0.4,
"nonBinary": 0.07,
"preferNotToSay": 0.03
},
"interests": [],
"maxAge": 0,
"minAge": 0,
"name": "string",
"nativeLanguage": "string",
"needs": [],
"painPoints": [],
"residence": "string",
"shared": False
},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/audience-service/v1/workspaces/${workspaceId}/target-audiences`,
{
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"country": "string",
"genderDistribution": {
"female": 0.5,
"male": 0.4,
"nonBinary": 0.07,
"preferNotToSay": 0.03
},
"interests": [],
"maxAge": 0,
"minAge": 0,
"name": "string",
"nativeLanguage": "string",
"needs": [],
"painPoints": [],
"residence": "string",
"shared": false
}),
}
).then((r) => r.json());
body, _ := json.Marshal(map[string]any{
"country": "string",
"genderDistribution": map[string]any{
"female": 0.5,
"male": 0.4,
"nonBinary": 0.07,
"preferNotToSay": 0.03,
},
"interests": []any{},
"maxAge": 0,
"minAge": 0,
"name": "string",
"nativeLanguage": "string",
"needs": []any{},
"painPoints": []any{},
"residence": "string",
"shared": false,
})
req, _ := http.NewRequest("POST", "https://app.neuroflash.com/api/audience-service/v1/workspaces/"+workspaceID+"/target-audiences", 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:
{
"_embedded": {
"image": {
"createdAt": "2025-01-14T16:20:59Z",
"createdByUserId": "b0920767-2e30-48d3-80ce-268810bc433a",
"fileName": "string",
"id": "113c0b32-ed6c-4421-b7da-d1faf238eb56",
"targetAudienceId": "string",
"updatedAt": "2025-01-14T16:20:59Z",
"url": "https://storage.googleapis.com/audience-images/113c0b32-ed6c-4421-b7da-d1faf238eb56.jpg"
},
"permissions": {
"canDelete": false,
"canDuplicate": false,
"canUpdate": false,
"canView": false
}
},
"country": "US",
"createdAt": "2025-01-14T16:20:59Z",
"createdByUserId": "b0920767-2e30-48d3-80ce-268810bc433a",
"genderDistribution": {
"female": 0.5,
"male": 0.4,
"nonBinary": 0.07,
"preferNotToSay": 0.03
},
"id": "113c0b32-ed6c-4421-b7da-d1faf238eb56",
"interests": [
"string"
],
"maxAge": 65,
"minAge": 18,
"name": "Young urban professionals",
"nativeLanguage": "de",
"needs": [
"string"
],
"ownerCustomerId": 12345,
"painPoints": [
"string"
],
"residence": "Berlin",
"shared": true,
"updatedAt": "2025-01-14T16:20:59Z",
"viewedAt": "2025-01-14T16:20:59Z",
"workspaceId": "113c0b32-ed6c-4421-b7da-d1faf238eb56"
}
Create duplication
/v1/workspaces/{workspaceId}/target-audiences/{targetAudienceId}/duplicationPath Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | Workspace ID |
targetAudienceId | string | Yes | Target Audience ID |
Request Body
newNamestringNoResponse
duplicateobjectA target audience is a group of people that share common properties and content can be targeted towards them
_embeddedobject
imageobjectAn image associated with a target audience
createdAtstringcreatedByUserIdstringfileNamestringFileName is used to generate a storage key which ends with the file name on duplication as wellidstringtargetAudienceIdstringupdatedAtstringurlstringpermissionsobject
canDeletebooleancanDuplicatebooleancanUpdatebooleancanViewbooleancountrystringcreatedAtstringcreatedByUserIdstringgenderDistributionobject
femalenumbermalenumbernonBinarynumberpreferNotToSaynumberidstringinterestsarray<string>A list of strings stored in the database as JSONmaxAgeintegerminAgeintegerWe store age range as separate min/max fields in the databasenamestringnativeLanguagestringneedsarray<string>A list of strings stored in the database as JSONownerCustomerIdintegerpainPointsarray<string>A list of strings stored in the database as JSONresidencestringsharedbooleanupdatedAtstringviewedAtstringworkspaceIdstringoriginalobjectA target audience is a group of people that share common properties and content can be targeted towards them
_embeddedobject
imageobjectAn image associated with a target audience
createdAtstringcreatedByUserIdstringfileNamestringFileName is used to generate a storage key which ends with the file name on duplication as wellidstringtargetAudienceIdstringupdatedAtstringurlstringpermissionsobject
canDeletebooleancanDuplicatebooleancanUpdatebooleancanViewbooleancountrystringcreatedAtstringcreatedByUserIdstringgenderDistributionobject
femalenumbermalenumbernonBinarynumberpreferNotToSaynumberidstringinterestsarray<string>A list of strings stored in the database as JSONmaxAgeintegerminAgeintegerWe store age range as separate min/max fields in the databasenamestringnativeLanguagestringneedsarray<string>A list of strings stored in the database as JSONownerCustomerIdintegerpainPointsarray<string>A list of strings stored in the database as JSONresidencestringsharedbooleanupdatedAtstringviewedAtstringworkspaceIdstringExample
- cURL
- Python
- Node.js
- Go
curl -X POST "https://app.neuroflash.com/api/audience-service/v1/workspaces/{workspace_id}/target-audiences/{target_audience_id}/duplication" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"newName": "string"
}'
import requests
response = requests.post(
f"https://app.neuroflash.com/api/audience-service/v1/workspaces/{workspace_id}/target-audiences/{target_audience_id}/duplication",
headers={"Authorization": f"Bearer {token}", "Content-Type": "application/json"},
json={
"newName": "string"
},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/audience-service/v1/workspaces/${workspaceId}/target-audiences/${targetAudienceId}/duplication`,
{
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"newName": "string"
}),
}
).then((r) => r.json());
body, _ := json.Marshal(map[string]any{
"newName": "string",
})
req, _ := http.NewRequest("POST", "https://app.neuroflash.com/api/audience-service/v1/workspaces/"+workspaceID+"/target-audiences/"+targetAudienceID+"/duplication", 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:
{
"duplicate": {
"_embedded": {
"image": {
"createdAt": "2025-01-14T16:20:59Z",
"createdByUserId": "b0920767-2e30-48d3-80ce-268810bc433a",
"fileName": "string",
"id": "113c0b32-ed6c-4421-b7da-d1faf238eb56",
"targetAudienceId": "string",
"updatedAt": "2025-01-14T16:20:59Z",
"url": "https://storage.googleapis.com/audience-images/113c0b32-ed6c-4421-b7da-d1faf238eb56.jpg"
},
"permissions": {
"canDelete": false,
"canDuplicate": false,
"canUpdate": false,
"canView": false
}
},
"country": "US",
"createdAt": "2025-01-14T16:20:59Z",
"createdByUserId": "b0920767-2e30-48d3-80ce-268810bc433a",
"genderDistribution": {
"female": 0.5,
"male": 0.4,
"nonBinary": 0.07,
"preferNotToSay": 0.03
},
"id": "113c0b32-ed6c-4421-b7da-d1faf238eb56",
"interests": [
"string"
],
"maxAge": 65,
"minAge": 18,
"name": "Young urban professionals",
"nativeLanguage": "de",
"needs": [
"string"
],
"ownerCustomerId": 12345,
"painPoints": [
"string"
],
"residence": "Berlin",
"shared": true,
"updatedAt": "2025-01-14T16:20:59Z",
"viewedAt": "2025-01-14T16:20:59Z",
"workspaceId": "113c0b32-ed6c-4421-b7da-d1faf238eb56"
},
"original": {
"_embedded": {
"image": {
"createdAt": "2025-01-14T16:20:59Z",
"createdByUserId": "b0920767-2e30-48d3-80ce-268810bc433a",
"fileName": "string",
"id": "113c0b32-ed6c-4421-b7da-d1faf238eb56",
"targetAudienceId": "string",
"updatedAt": "2025-01-14T16:20:59Z",
"url": "https://storage.googleapis.com/audience-images/113c0b32-ed6c-4421-b7da-d1faf238eb56.jpg"
},
"permissions": {
"canDelete": false,
"canDuplicate": false,
"canUpdate": false,
"canView": false
}
},
"country": "US",
"createdAt": "2025-01-14T16:20:59Z",
"createdByUserId": "b0920767-2e30-48d3-80ce-268810bc433a",
"genderDistribution": {
"female": 0.5,
"male": 0.4,
"nonBinary": 0.07,
"preferNotToSay": 0.03
},
"id": "113c0b32-ed6c-4421-b7da-d1faf238eb56",
"interests": [
"string"
],
"maxAge": 65,
"minAge": 18,
"name": "Young urban professionals",
"nativeLanguage": "de",
"needs": [
"string"
],
"ownerCustomerId": 12345,
"painPoints": [
"string"
],
"residence": "Berlin",
"shared": true,
"updatedAt": "2025-01-14T16:20:59Z",
"viewedAt": "2025-01-14T16:20:59Z",
"workspaceId": "113c0b32-ed6c-4421-b7da-d1faf238eb56"
}
}
List target audiences
/v1/workspaces/{workspaceId}/target-audiencesList all target audiences that the user has access to
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | Workspace ID |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | — | page number |
size | integer | — | page size |
search | string | — | find audience by name |
country | string | — | filter audience by country |
nativeLanguage | string | — | filter audience by native language |
Response
dataarray<object>
_embeddedobject
imageobjectAn image associated with a target audience
createdAtstringcreatedByUserIdstringfileNamestringFileName is used to generate a storage key which ends with the file name on duplication as wellidstringtargetAudienceIdstringupdatedAtstringurlstringpermissionsobject
canDeletebooleancanDuplicatebooleancanUpdatebooleancanViewbooleancountrystringcreatedAtstringcreatedByUserIdstringgenderDistributionobject
femalenumbermalenumbernonBinarynumberpreferNotToSaynumberidstringinterestsarray<string>A list of strings stored in the database as JSONmaxAgeintegerminAgeintegerWe store age range as separate min/max fields in the databasenamestringnativeLanguagestringneedsarray<string>A list of strings stored in the database as JSONownerCustomerIdintegerpainPointsarray<string>A list of strings stored in the database as JSONresidencestringsharedbooleanupdatedAtstringviewedAtstringworkspaceIdstringpageobject
currentPageintegersizeintegertotalElementsintegertotalPagesintegerExample
- cURL
- Python
- Node.js
- Go
curl "https://app.neuroflash.com/api/audience-service/v1/workspaces/{workspace_id}/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}/target-audiences",
headers={"Authorization": f"Bearer {token}"},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/audience-service/v1/workspaces/${workspaceId}/target-audiences`,
{ headers: { Authorization: `Bearer ${token}` } }
).then((r) => r.json());
req, _ := http.NewRequest("GET", "https://app.neuroflash.com/api/audience-service/v1/workspaces/"+workspaceID+"/target-audiences", nil)
req.Header.Set("Authorization", "Bearer "+token)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Response:
{
"data": [
{
"_embedded": {
"image": {
"createdAt": "...",
"createdByUserId": "...",
"fileName": "...",
"id": "...",
"targetAudienceId": "...",
"updatedAt": "...",
"url": "..."
},
"permissions": {
"canDelete": "...",
"canDuplicate": "...",
"canUpdate": "...",
"canView": "..."
}
},
"country": "US",
"createdAt": "2025-01-14T16:20:59Z",
"createdByUserId": "b0920767-2e30-48d3-80ce-268810bc433a",
"genderDistribution": {
"female": 0.5,
"male": 0.4,
"nonBinary": 0.07,
"preferNotToSay": 0.03
},
"id": "113c0b32-ed6c-4421-b7da-d1faf238eb56",
"interests": [
"string"
],
"maxAge": 65,
"minAge": 18,
"name": "Young urban professionals",
"nativeLanguage": "de",
"needs": [
"string"
],
"ownerCustomerId": 12345,
"painPoints": [
"string"
],
"residence": "Berlin",
"shared": true,
"updatedAt": "2025-01-14T16:20:59Z",
"viewedAt": "2025-01-14T16:20:59Z",
"workspaceId": "113c0b32-ed6c-4421-b7da-d1faf238eb56"
}
],
"page": {
"currentPage": 2,
"size": 10,
"totalElements": 35,
"totalPages": 4
}
}
Get a target audience by ID
/v1/workspaces/{workspaceId}/target-audiences/{targetAudienceId}Retrieves a target audience by its ID
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | Workspace ID |
targetAudienceId | string | Yes | Target Audience ID |
Response
_embeddedobject
imageobjectAn image associated with a target audience
createdAtstringcreatedByUserIdstringfileNamestringFileName is used to generate a storage key which ends with the file name on duplication as wellidstringtargetAudienceIdstringupdatedAtstringurlstringpermissionsobject
canDeletebooleancanDuplicatebooleancanUpdatebooleancanViewbooleancountrystringcreatedAtstringcreatedByUserIdstringgenderDistributionobject
femalenumbermalenumbernonBinarynumberpreferNotToSaynumberidstringinterestsarray<string>A list of strings stored in the database as JSONmaxAgeintegerminAgeintegerWe store age range as separate min/max fields in the databasenamestringnativeLanguagestringneedsarray<string>A list of strings stored in the database as JSONownerCustomerIdintegerpainPointsarray<string>A list of strings stored in the database as JSONresidencestringsharedbooleanupdatedAtstringviewedAtstringworkspaceIdstringExample
- cURL
- Python
- Node.js
- Go
curl "https://app.neuroflash.com/api/audience-service/v1/workspaces/{workspace_id}/target-audiences/{target_audience_id}" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
import requests
response = requests.get(
f"https://app.neuroflash.com/api/audience-service/v1/workspaces/{workspace_id}/target-audiences/{target_audience_id}",
headers={"Authorization": f"Bearer {token}"},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/audience-service/v1/workspaces/${workspaceId}/target-audiences/${targetAudienceId}`,
{ headers: { Authorization: `Bearer ${token}` } }
).then((r) => r.json());
req, _ := http.NewRequest("GET", "https://app.neuroflash.com/api/audience-service/v1/workspaces/"+workspaceID+"/target-audiences/"+targetAudienceID+"", nil)
req.Header.Set("Authorization", "Bearer "+token)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Response:
{
"_embedded": {
"image": {
"createdAt": "2025-01-14T16:20:59Z",
"createdByUserId": "b0920767-2e30-48d3-80ce-268810bc433a",
"fileName": "string",
"id": "113c0b32-ed6c-4421-b7da-d1faf238eb56",
"targetAudienceId": "string",
"updatedAt": "2025-01-14T16:20:59Z",
"url": "https://storage.googleapis.com/audience-images/113c0b32-ed6c-4421-b7da-d1faf238eb56.jpg"
},
"permissions": {
"canDelete": false,
"canDuplicate": false,
"canUpdate": false,
"canView": false
}
},
"country": "US",
"createdAt": "2025-01-14T16:20:59Z",
"createdByUserId": "b0920767-2e30-48d3-80ce-268810bc433a",
"genderDistribution": {
"female": 0.5,
"male": 0.4,
"nonBinary": 0.07,
"preferNotToSay": 0.03
},
"id": "113c0b32-ed6c-4421-b7da-d1faf238eb56",
"interests": [
"string"
],
"maxAge": 65,
"minAge": 18,
"name": "Young urban professionals",
"nativeLanguage": "de",
"needs": [
"string"
],
"ownerCustomerId": 12345,
"painPoints": [
"string"
],
"residence": "Berlin",
"shared": true,
"updatedAt": "2025-01-14T16:20:59Z",
"viewedAt": "2025-01-14T16:20:59Z",
"workspaceId": "113c0b32-ed6c-4421-b7da-d1faf238eb56"
}
Get a target audience image
/v1/workspaces/{workspaceId}/target-audiences/{targetAudienceId}/imageReturns a signed URL for the target audience image
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
targetAudienceId | string | Yes | Target Audience ID |
Response
createdAtstringcreatedByUserIdstringfileNamestringFileName is used to generate a storage key which ends with the file name on duplication as wellidstringtargetAudienceIdstringupdatedAtstringurlstringExample
- cURL
- Python
- Node.js
- Go
curl "https://app.neuroflash.com/api/audience-service/v1/workspaces/{workspace_id}/target-audiences/{target_audience_id}/image" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
import requests
response = requests.get(
f"https://app.neuroflash.com/api/audience-service/v1/workspaces/{workspace_id}/target-audiences/{target_audience_id}/image",
headers={"Authorization": f"Bearer {token}"},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/audience-service/v1/workspaces/${workspaceId}/target-audiences/${targetAudienceId}/image`,
{ headers: { Authorization: `Bearer ${token}` } }
).then((r) => r.json());
req, _ := http.NewRequest("GET", "https://app.neuroflash.com/api/audience-service/v1/workspaces/"+workspaceID+"/target-audiences/"+targetAudienceID+"/image", nil)
req.Header.Set("Authorization", "Bearer "+token)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Response:
{
"createdAt": "2025-01-14T16:20:59Z",
"createdByUserId": "b0920767-2e30-48d3-80ce-268810bc433a",
"fileName": "string",
"id": "113c0b32-ed6c-4421-b7da-d1faf238eb56",
"targetAudienceId": "string",
"updatedAt": "2025-01-14T16:20:59Z",
"url": "https://storage.googleapis.com/audience-images/113c0b32-ed6c-4421-b7da-d1faf238eb56.jpg"
}
Update a target audience
/v1/workspaces/{workspaceId}/target-audiences/{targetAudienceId}Updates an existing target audience
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | Workspace ID |
targetAudienceId | string | Yes | Target Audience ID |
Request Body
countrystringNogenderDistributionobjectYes
femalenumberYesmalenumberYesnonBinarynumberYespreferNotToSaynumberYesinterestsarray<string>YesA list of strings stored in the database as JSONmaxAgeintegerYesminAgeintegerYesWe store age range as separate min/max fields in the databasenamestringYesnativeLanguagestringNoneedsarray<string>YesA list of strings stored in the database as JSONpainPointsarray<string>YesA list of strings stored in the database as JSONresidencestringYessharedbooleanYesResponse
_embeddedobject
imageobjectAn image associated with a target audience
createdAtstringcreatedByUserIdstringfileNamestringFileName is used to generate a storage key which ends with the file name on duplication as wellidstringtargetAudienceIdstringupdatedAtstringurlstringpermissionsobject
canDeletebooleancanDuplicatebooleancanUpdatebooleancanViewbooleancountrystringcreatedAtstringcreatedByUserIdstringgenderDistributionobject
femalenumbermalenumbernonBinarynumberpreferNotToSaynumberidstringinterestsarray<string>A list of strings stored in the database as JSONmaxAgeintegerminAgeintegerWe store age range as separate min/max fields in the databasenamestringnativeLanguagestringneedsarray<string>A list of strings stored in the database as JSONownerCustomerIdintegerpainPointsarray<string>A list of strings stored in the database as JSONresidencestringsharedbooleanupdatedAtstringviewedAtstringworkspaceIdstringExample
The update endpoint uses PUT semantics — you must supply the complete demographic profile on
every call, even if you only want to change one field. Fetch the audience first with
GET /target-audiences/{id}, then re-send all existing values with your change applied.
- cURL
- Python
- Node.js
- Go
curl -X PUT "https://app.neuroflash.com/api/audience-service/v1/workspaces/{workspace_id}/target-audiences/{target_audience_id}" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"country": "string",
"genderDistribution": {},
"interests": [],
"maxAge": 0,
"minAge": 0,
"name": "string",
"nativeLanguage": "string",
"needs": [],
"painPoints": [],
"residence": "string",
"shared": false
}'
import requests
response = requests.put(
f"https://app.neuroflash.com/api/audience-service/v1/workspaces/{workspace_id}/target-audiences/{target_audience_id}",
headers={"Authorization": f"Bearer {token}", "Content-Type": "application/json"},
json={
"country": "string",
"genderDistribution": {},
"interests": [],
"maxAge": 0,
"minAge": 0,
"name": "string",
"nativeLanguage": "string",
"needs": [],
"painPoints": [],
"residence": "string",
"shared": False
},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/audience-service/v1/workspaces/${workspaceId}/target-audiences/${targetAudienceId}`,
{
method: "PUT",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"country": "string",
"genderDistribution": {},
"interests": [],
"maxAge": 0,
"minAge": 0,
"name": "string",
"nativeLanguage": "string",
"needs": [],
"painPoints": [],
"residence": "string",
"shared": false
}),
}
).then((r) => r.json());
body, _ := json.Marshal(map[string]any{
"country": "string",
"genderDistribution": map[string]any{},
"interests": []any{},
"maxAge": 0,
"minAge": 0,
"name": "string",
"nativeLanguage": "string",
"needs": []any{},
"painPoints": []any{},
"residence": "string",
"shared": false,
})
req, _ := http.NewRequest("PUT", "https://app.neuroflash.com/api/audience-service/v1/workspaces/"+workspaceID+"/target-audiences/"+targetAudienceID+"", 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:
{
"_embedded": {
"image": {
"createdAt": "2025-01-14T16:20:59Z",
"createdByUserId": "b0920767-2e30-48d3-80ce-268810bc433a",
"fileName": "string",
"id": "113c0b32-ed6c-4421-b7da-d1faf238eb56",
"targetAudienceId": "string",
"updatedAt": "2025-01-14T16:20:59Z",
"url": "https://storage.googleapis.com/audience-images/113c0b32-ed6c-4421-b7da-d1faf238eb56.jpg"
},
"permissions": {
"canDelete": false,
"canDuplicate": false,
"canUpdate": false,
"canView": false
}
},
"country": "US",
"createdAt": "2025-01-14T16:20:59Z",
"createdByUserId": "b0920767-2e30-48d3-80ce-268810bc433a",
"genderDistribution": {
"female": 0.5,
"male": 0.4,
"nonBinary": 0.07,
"preferNotToSay": 0.03
},
"id": "113c0b32-ed6c-4421-b7da-d1faf238eb56",
"interests": [
"string"
],
"maxAge": 65,
"minAge": 18,
"name": "Young urban professionals",
"nativeLanguage": "de",
"needs": [
"string"
],
"ownerCustomerId": 12345,
"painPoints": [
"string"
],
"residence": "Berlin",
"shared": true,
"updatedAt": "2025-01-14T16:20:59Z",
"viewedAt": "2025-01-14T16:20:59Z",
"workspaceId": "113c0b32-ed6c-4421-b7da-d1faf238eb56"
}
Update the icon of a target audience
/v1/workspaces/{workspaceId}/target-audiences/{targetAudienceId}/imagePath Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | Workspace ID |
targetAudienceId | string | Yes | Target Audience ID |
Request Body
base64stringYescontentTypestringYesfileNamestringYesResponse
createdAtstringcreatedByUserIdstringfileNamestringFileName is used to generate a storage key which ends with the file name on duplication as wellidstringtargetAudienceIdstringupdatedAtstringurlstringExample
- cURL
- Python
- Node.js
- Go
curl -X PUT "https://app.neuroflash.com/api/audience-service/v1/workspaces/{workspace_id}/target-audiences/{target_audience_id}/image" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"base64": "string",
"contentType": "string",
"fileName": "string"
}'
import requests
response = requests.put(
f"https://app.neuroflash.com/api/audience-service/v1/workspaces/{workspace_id}/target-audiences/{target_audience_id}/image",
headers={"Authorization": f"Bearer {token}", "Content-Type": "application/json"},
json={
"base64": "string",
"contentType": "string",
"fileName": "string"
},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/audience-service/v1/workspaces/${workspaceId}/target-audiences/${targetAudienceId}/image`,
{
method: "PUT",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"base64": "string",
"contentType": "string",
"fileName": "string"
}),
}
).then((r) => r.json());
body, _ := json.Marshal(map[string]any{
"base64": "string",
"contentType": "string",
"fileName": "string",
})
req, _ := http.NewRequest("PUT", "https://app.neuroflash.com/api/audience-service/v1/workspaces/"+workspaceID+"/target-audiences/"+targetAudienceID+"/image", 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": "2025-01-14T16:20:59Z",
"createdByUserId": "b0920767-2e30-48d3-80ce-268810bc433a",
"fileName": "string",
"id": "113c0b32-ed6c-4421-b7da-d1faf238eb56",
"targetAudienceId": "string",
"updatedAt": "2025-01-14T16:20:59Z",
"url": "https://storage.googleapis.com/audience-images/113c0b32-ed6c-4421-b7da-d1faf238eb56.jpg"
}
Creates a usage of target audience
/v1/workspaces/{workspaceId}/target-audiences/{targetAudienceId}/usageCreate a documented usage of a target audience.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | Workspace ID (uuid4) |
targetAudienceId | string | Yes | Target Audience ID |
Example
- cURL
- Python
- Node.js
- Go
curl -X PUT "https://app.neuroflash.com/api/audience-service/v1/workspaces/{workspace_id}/target-audiences/{target_audience_id}/usage" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'
import requests
response = requests.put(
f"https://app.neuroflash.com/api/audience-service/v1/workspaces/{workspace_id}/target-audiences/{target_audience_id}/usage",
headers={"Authorization": f"Bearer {token}"},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/audience-service/v1/workspaces/${workspaceId}/target-audiences/${targetAudienceId}/usage`,
{
method: "PUT",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
}
).then((r) => r.json());
body, _ := json.Marshal(map[string]any{})
req, _ := http.NewRequest("PUT", "https://app.neuroflash.com/api/audience-service/v1/workspaces/"+workspaceID+"/target-audiences/"+targetAudienceID+"/usage", 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()
Delete a target audience
/v1/workspaces/{workspaceId}/target-audiences/{targetAudienceId}Deletes an existing target audience
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | Workspace ID |
targetAudienceId | string | Yes | Target Audience ID |
Example
- cURL
- Python
- Node.js
- Go
curl -X DELETE "https://app.neuroflash.com/api/audience-service/v1/workspaces/{workspace_id}/target-audiences/{target_audience_id}" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
import requests
requests.delete(
f"https://app.neuroflash.com/api/audience-service/v1/workspaces/{workspace_id}/target-audiences/{target_audience_id}",
headers={"Authorization": f"Bearer {token}"},
)
await fetch(
`https://app.neuroflash.com/api/audience-service/v1/workspaces/${workspaceId}/target-audiences/${targetAudienceId}`,
{
method: "DELETE",
headers: { Authorization: `Bearer ${token}` },
}
);
req, _ := http.NewRequest("DELETE", "https://app.neuroflash.com/api/audience-service/v1/workspaces/"+workspaceID+"/target-audiences/"+targetAudienceID+"", nil)
req.Header.Set("Authorization", "Bearer "+token)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Only the user who created a target audience can update or delete it. Attempting to modify a
resource owned by another user returns 403 Forbidden.
Delete a target audience image
/v1/workspaces/{workspaceId}/target-audiences/{targetAudienceId}/imageDeletes an existing image for a target audience
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
targetAudienceId | string | Yes | Target Audience ID |
Example
- cURL
- Python
- Node.js
- Go
curl -X DELETE "https://app.neuroflash.com/api/audience-service/v1/workspaces/{workspace_id}/target-audiences/{target_audience_id}/image" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
import requests
requests.delete(
f"https://app.neuroflash.com/api/audience-service/v1/workspaces/{workspace_id}/target-audiences/{target_audience_id}/image",
headers={"Authorization": f"Bearer {token}"},
)
await fetch(
`https://app.neuroflash.com/api/audience-service/v1/workspaces/${workspaceId}/target-audiences/${targetAudienceId}/image`,
{
method: "DELETE",
headers: { Authorization: `Bearer ${token}` },
}
);
req, _ := http.NewRequest("DELETE", "https://app.neuroflash.com/api/audience-service/v1/workspaces/"+workspaceID+"/target-audiences/"+targetAudienceID+"/image", nil)
req.Header.Set("Authorization", "Bearer "+token)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Get target audience limits
/v1/workspaces/{workspaceId}/limits/target-audiencesRetrieves target audience limits
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | Workspace ID |
Response
createobject
isAvailablebooleanisUnlimitedbooleanlimitintegerusageintegerExample
- cURL
- Python
- Node.js
- Go
curl "https://app.neuroflash.com/api/audience-service/v1/workspaces/{workspace_id}/limits/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}/limits/target-audiences",
headers={"Authorization": f"Bearer {token}"},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/audience-service/v1/workspaces/${workspaceId}/limits/target-audiences`,
{ headers: { Authorization: `Bearer ${token}` } }
).then((r) => r.json());
req, _ := http.NewRequest("GET", "https://app.neuroflash.com/api/audience-service/v1/workspaces/"+workspaceID+"/limits/target-audiences", nil)
req.Header.Set("Authorization", "Bearer "+token)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Response:
{
"create": {
"isAvailable": false,
"isUnlimited": false,
"limit": 0,
"usage": 0
}
}