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
additionalInformationstringNocountrystringNogenderDistributionobjectYes
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 JSONresidencestringYesResponse
_embeddedobject
createdByCustomerobject
emailstringEmail of the customerhadTrialbooleanTrue if the customer has ever started a trial in any workspacelegacyIdintegerID of the customer in the legacy systemnamestringName of the customerimageobjectAn image associated with a target audience
createdAtstringcreatedByUserIdstringfileNamestringFileName is used to generate a storage key which ends with the file name on duplication as wellidstringtargetAudienceIdstringupdatedAtstringurlstringnewPermissionsobject
deletionAllowedbooleanduplicationAllowedbooleanupdateAllowedbooleanviewingAllowedbooleanpermissionsobject
canDeletebooleancanDuplicatebooleancanUpdatebooleancanViewbooleanadditionalInformationstringcountrystringcreatedAtstringcreatedByUserIdstringgenderDistributionobject
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 JSONpainPointsarray<string>A list of strings stored in the database as JSONresidencestringsummarystringSummary is the rendered prose blurb fed into downstream prompts (chat, prompt-runs, etc.). Serialized via the api for the frontend in chat etcupdatedAtstringviewedAtstringworkspaceIdstringExample
- 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 '{
"additionalInformation": "string",
"country": "string",
"genderDistribution": {},
"interests": [],
"maxAge": 0,
"minAge": 0,
"name": "string",
"nativeLanguage": "string",
"needs": [],
"painPoints": [],
"residence": "string"
}'
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={
"additionalInformation": "string",
"country": "string",
"genderDistribution": {},
"interests": [],
"maxAge": 0,
"minAge": 0,
"name": "string",
"nativeLanguage": "string",
"needs": [],
"painPoints": [],
"residence": "string"
},
).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({
"additionalInformation": "string",
"country": "string",
"genderDistribution": {},
"interests": [],
"maxAge": 0,
"minAge": 0,
"name": "string",
"nativeLanguage": "string",
"needs": [],
"painPoints": [],
"residence": "string"
}),
}
).then((r) => r.json());
body, _ := json.Marshal(map[string]any{
"additionalInformation": "string",
"country": "string",
"genderDistribution": map[string]any{},
"interests": []any{},
"maxAge": 0,
"minAge": 0,
"name": "string",
"nativeLanguage": "string",
"needs": []any{},
"painPoints": []any{},
"residence": "string",
})
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": {
"createdByCustomer": {
"email": "eren.jaeger@neuroflash.com",
"hadTrial": false,
"legacyId": 5,
"name": "Eren Jaeger"
},
"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"
},
"newPermissions": {
"deletionAllowed": true,
"duplicationAllowed": true,
"updateAllowed": true,
"viewingAllowed": true
},
"permissions": {
"canDelete": false,
"canDuplicate": false,
"canUpdate": false,
"canView": false
}
},
"additionalInformation": "This audience prefers short-form video content",
"country": "US",
"createdAt": "2025-01-14T16:20:59Z",
"createdByUserId": "b0920767-2e30-48d3-80ce-268810bc433a",
"genderDistribution": {
"female": 0.5,
"male": 0.5,
"nonBinary": 0.5,
"preferNotToSay": 0.5
},
"id": "113c0b32-ed6c-4421-b7da-d1faf238eb56",
"interests": [
"string"
],
"maxAge": 65,
"minAge": 18,
"name": "Young urban professionals",
"nativeLanguage": "de",
"needs": [
"string"
],
"painPoints": [
"string"
],
"residence": "Berlin",
"summary": "string",
"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
createdByCustomerobject
emailstringEmail of the customerhadTrialbooleanTrue if the customer has ever started a trial in any workspacelegacyIdintegerID of the customer in the legacy systemnamestringName of the customerimageobjectAn image associated with a target audience
createdAtstringcreatedByUserIdstringfileNamestringFileName is used to generate a storage key which ends with the file name on duplication as wellidstringtargetAudienceIdstringupdatedAtstringurlstringnewPermissionsobject
deletionAllowedbooleanduplicationAllowedbooleanupdateAllowedbooleanviewingAllowedbooleanpermissionsobject
canDeletebooleancanDuplicatebooleancanUpdatebooleancanViewbooleanadditionalInformationstringcountrystringcreatedAtstringcreatedByUserIdstringgenderDistributionobject
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 JSONpainPointsarray<string>A list of strings stored in the database as JSONresidencestringsummarystringSummary is the rendered prose blurb fed into downstream prompts (chat, prompt-runs, etc.). Serialized via the api for the frontend in chat etcupdatedAtstringviewedAtstringworkspaceIdstringoriginalobjectA target audience is a group of people that share common properties and content can be targeted towards them
_embeddedobject
createdByCustomerobject
emailstringEmail of the customerhadTrialbooleanTrue if the customer has ever started a trial in any workspacelegacyIdintegerID of the customer in the legacy systemnamestringName of the customerimageobjectAn image associated with a target audience
createdAtstringcreatedByUserIdstringfileNamestringFileName is used to generate a storage key which ends with the file name on duplication as wellidstringtargetAudienceIdstringupdatedAtstringurlstringnewPermissionsobject
deletionAllowedbooleanduplicationAllowedbooleanupdateAllowedbooleanviewingAllowedbooleanpermissionsobject
canDeletebooleancanDuplicatebooleancanUpdatebooleancanViewbooleanadditionalInformationstringcountrystringcreatedAtstringcreatedByUserIdstringgenderDistributionobject
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 JSONpainPointsarray<string>A list of strings stored in the database as JSONresidencestringsummarystringSummary is the rendered prose blurb fed into downstream prompts (chat, prompt-runs, etc.). Serialized via the api for the frontend in chat etcupdatedAtstringviewedAtstringworkspaceIdstringExample
- 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": {
"createdByCustomer": {
"email": "eren.jaeger@neuroflash.com",
"hadTrial": false,
"legacyId": 5,
"name": "Eren Jaeger"
},
"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"
},
"newPermissions": {
"deletionAllowed": true,
"duplicationAllowed": true,
"updateAllowed": true,
"viewingAllowed": true
},
"permissions": {
"canDelete": false,
"canDuplicate": false,
"canUpdate": false,
"canView": false
}
},
"additionalInformation": "This audience prefers short-form video content",
"country": "US",
"createdAt": "2025-01-14T16:20:59Z",
"createdByUserId": "b0920767-2e30-48d3-80ce-268810bc433a",
"genderDistribution": {
"female": 0.5,
"male": 0.5,
"nonBinary": 0.5,
"preferNotToSay": 0.5
},
"id": "113c0b32-ed6c-4421-b7da-d1faf238eb56",
"interests": [
"string"
],
"maxAge": 65,
"minAge": 18,
"name": "Young urban professionals",
"nativeLanguage": "de",
"needs": [
"string"
],
"painPoints": [
"string"
],
"residence": "Berlin",
"summary": "string",
"updatedAt": "2025-01-14T16:20:59Z",
"viewedAt": "2025-01-14T16:20:59Z",
"workspaceId": "113c0b32-ed6c-4421-b7da-d1faf238eb56"
},
"original": {
"_embedded": {
"createdByCustomer": {
"email": "eren.jaeger@neuroflash.com",
"hadTrial": false,
"legacyId": 5,
"name": "Eren Jaeger"
},
"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"
},
"newPermissions": {
"deletionAllowed": true,
"duplicationAllowed": true,
"updateAllowed": true,
"viewingAllowed": true
},
"permissions": {
"canDelete": false,
"canDuplicate": false,
"canUpdate": false,
"canView": false
}
},
"additionalInformation": "This audience prefers short-form video content",
"country": "US",
"createdAt": "2025-01-14T16:20:59Z",
"createdByUserId": "b0920767-2e30-48d3-80ce-268810bc433a",
"genderDistribution": {
"female": 0.5,
"male": 0.5,
"nonBinary": 0.5,
"preferNotToSay": 0.5
},
"id": "113c0b32-ed6c-4421-b7da-d1faf238eb56",
"interests": [
"string"
],
"maxAge": 65,
"minAge": 18,
"name": "Young urban professionals",
"nativeLanguage": "de",
"needs": [
"string"
],
"painPoints": [
"string"
],
"residence": "Berlin",
"summary": "string",
"updatedAt": "2025-01-14T16:20:59Z",
"viewedAt": "2025-01-14T16:20:59Z",
"workspaceId": "113c0b32-ed6c-4421-b7da-d1faf238eb56"
}
}
Create image creation jobs
/v1/workspaces/{workspaceId}/target-audiences/{targetAudienceId}/image-creation-jobsCreate an image-generation job for a target audience. The dedicated processImageCreationJobs worker picks the row up and runs the LLM prompt.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | |
targetAudienceId | string | Yes |
Response
createdAtstringTimestamp when the resource was createdcreatedByUserIdstringnot set for workspaces imported from legacy teamfinishedAtstringWhen the image was rendered and stored. Null while in progress.idstringUnique identifier for the resourceimageIdstringId of the target audience image produced by this job. Only set after finishedAt is populated.targetAudienceIdstringThe audience this image is generated for.updatedAtstringTimestamp when the resource was last updatedworkspaceIdstringThe workspace this image job belongs to.Example
- cURL
- Python
- Node.js
- Go
curl -X POST "https://app.neuroflash.com/api/audience-service/v1/workspaces/{workspace_id}/target-audiences/{target_audience_id}/image-creation-jobs" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'
import requests
response = requests.post(
f"https://app.neuroflash.com/api/audience-service/v1/workspaces/{workspace_id}/target-audiences/{target_audience_id}/image-creation-jobs",
headers={"Authorization": f"Bearer {token}"},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/audience-service/v1/workspaces/${workspaceId}/target-audiences/${targetAudienceId}/image-creation-jobs`,
{
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
}
).then((r) => r.json());
body, _ := json.Marshal(map[string]any{})
req, _ := http.NewRequest("POST", "https://app.neuroflash.com/api/audience-service/v1/workspaces/"+workspaceID+"/target-audiences/"+targetAudienceID+"/image-creation-jobs", 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",
"finishedAt": "2024-01-15T10:30:00Z",
"id": "string",
"imageId": "string",
"targetAudienceId": "string",
"updatedAt": "2024-01-15T10:30:00Z",
"workspaceId": "string"
}
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
createdByCustomerobject
emailstringEmail of the customerhadTrialbooleanTrue if the customer has ever started a trial in any workspacelegacyIdintegerID of the customer in the legacy systemnamestringName of the customerimageobjectAn image associated with a target audience
createdAtstringcreatedByUserIdstringfileNamestringFileName is used to generate a storage key which ends with the file name on duplication as wellidstringtargetAudienceIdstringupdatedAtstringurlstringnewPermissionsobject
deletionAllowedbooleanduplicationAllowedbooleanupdateAllowedbooleanviewingAllowedbooleanpermissionsobject
canDeletebooleancanDuplicatebooleancanUpdatebooleancanViewbooleanadditionalInformationstringcountrystringcreatedAtstringcreatedByUserIdstringgenderDistributionobject
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 JSONpainPointsarray<string>A list of strings stored in the database as JSONresidencestringsummarystringSummary is the rendered prose blurb fed into downstream prompts (chat, prompt-runs, etc.). Serialized via the api for the frontend in chat etcupdatedAtstringviewedAtstringworkspaceIdstringpageobject
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": {
"createdByCustomer": {
"email": "...",
"hadTrial": "...",
"legacyId": "...",
"name": "..."
},
"image": {
"createdAt": "...",
"createdByUserId": "...",
"fileName": "...",
"id": "...",
"targetAudienceId": "...",
"updatedAt": "...",
"url": "..."
},
"newPermissions": {
"deletionAllowed": "...",
"duplicationAllowed": "...",
"updateAllowed": "...",
"viewingAllowed": "..."
},
"permissions": {
"canDelete": "...",
"canDuplicate": "...",
"canUpdate": "...",
"canView": "..."
}
},
"additionalInformation": "This audience prefers short-form video content",
"country": "US",
"createdAt": "2025-01-14T16:20:59Z",
"createdByUserId": "b0920767-2e30-48d3-80ce-268810bc433a",
"genderDistribution": {
"female": 0.5,
"male": 0.5,
"nonBinary": 0.5,
"preferNotToSay": 0.5
},
"id": "113c0b32-ed6c-4421-b7da-d1faf238eb56",
"interests": [
"string"
],
"maxAge": 65,
"minAge": 18,
"name": "Young urban professionals",
"nativeLanguage": "de",
"needs": [
"string"
],
"painPoints": [
"string"
],
"residence": "Berlin",
"summary": "string",
"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
createdByCustomerobject
emailstringEmail of the customerhadTrialbooleanTrue if the customer has ever started a trial in any workspacelegacyIdintegerID of the customer in the legacy systemnamestringName of the customerimageobjectAn image associated with a target audience
createdAtstringcreatedByUserIdstringfileNamestringFileName is used to generate a storage key which ends with the file name on duplication as wellidstringtargetAudienceIdstringupdatedAtstringurlstringnewPermissionsobject
deletionAllowedbooleanduplicationAllowedbooleanupdateAllowedbooleanviewingAllowedbooleanpermissionsobject
canDeletebooleancanDuplicatebooleancanUpdatebooleancanViewbooleanadditionalInformationstringcountrystringcreatedAtstringcreatedByUserIdstringgenderDistributionobject
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 JSONpainPointsarray<string>A list of strings stored in the database as JSONresidencestringsummarystringSummary is the rendered prose blurb fed into downstream prompts (chat, prompt-runs, etc.). Serialized via the api for the frontend in chat etcupdatedAtstringviewedAtstringworkspaceIdstringExample
- 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": {
"createdByCustomer": {
"email": "eren.jaeger@neuroflash.com",
"hadTrial": false,
"legacyId": 5,
"name": "Eren Jaeger"
},
"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"
},
"newPermissions": {
"deletionAllowed": true,
"duplicationAllowed": true,
"updateAllowed": true,
"viewingAllowed": true
},
"permissions": {
"canDelete": false,
"canDuplicate": false,
"canUpdate": false,
"canView": false
}
},
"additionalInformation": "This audience prefers short-form video content",
"country": "US",
"createdAt": "2025-01-14T16:20:59Z",
"createdByUserId": "b0920767-2e30-48d3-80ce-268810bc433a",
"genderDistribution": {
"female": 0.5,
"male": 0.5,
"nonBinary": 0.5,
"preferNotToSay": 0.5
},
"id": "113c0b32-ed6c-4421-b7da-d1faf238eb56",
"interests": [
"string"
],
"maxAge": 65,
"minAge": 18,
"name": "Young urban professionals",
"nativeLanguage": "de",
"needs": [
"string"
],
"painPoints": [
"string"
],
"residence": "Berlin",
"summary": "string",
"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"
}
Get image creation jobs
/v1/workspaces/{workspaceId}/target-audiences/{targetAudienceId}/image-creation-jobsList image-generation jobs for an audience, newest first.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | |
targetAudienceId | string | Yes |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | page number for pagination, starting with 1 for the first page |
size | integer | 20 | number of elements returned per page |
sort | string | — | field by which to sort |
order | string | asc | sort order |
Response
dataarray<object>
createdAtstringTimestamp when the resource was createdcreatedByUserIdstringnot set for workspaces imported from legacy teamfinishedAtstringWhen the image was rendered and stored. Null while in progress.idstringUnique identifier for the resourceimageIdstringId of the target audience image produced by this job. Only set after finishedAt is populated.targetAudienceIdstringThe audience this image is generated for.updatedAtstringTimestamp when the resource was last updatedworkspaceIdstringThe workspace this image job belongs to.pageobject
currentPageintegersizeintegertotalElementsintegertotalPagesintegerExample
- cURL
- Python
- Node.js
- Go
curl "https://app.neuroflash.com/api/audience-service/v1/workspaces/{workspace_id}/target-audiences/{target_audience_id}/image-creation-jobs" \
-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-creation-jobs",
headers={"Authorization": f"Bearer {token}"},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/audience-service/v1/workspaces/${workspaceId}/target-audiences/${targetAudienceId}/image-creation-jobs`,
{ 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-creation-jobs", nil)
req.Header.Set("Authorization", "Bearer "+token)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Response:
{
"data": [
{
"createdAt": "2024-01-15T10:30:00Z",
"createdByUserId": "string",
"finishedAt": "2024-01-15T10:30:00Z",
"id": "string",
"imageId": "string",
"targetAudienceId": "string",
"updatedAt": "2024-01-15T10:30:00Z",
"workspaceId": "string"
}
],
"page": {
"currentPage": 0,
"size": 0,
"totalElements": 0,
"totalPages": 0
}
}
Get
/v1/workspaces/{workspaceId}/target-audiences/{targetAudienceId}/image-creation-jobs/{jobId}Read a single image-generation job; imageUrl is populated once status=finished.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | |
targetAudienceId | string | Yes | |
jobId | string | Yes |
Response
createdAtstringTimestamp when the resource was createdcreatedByUserIdstringnot set for workspaces imported from legacy teamfinishedAtstringWhen the image was rendered and stored. Null while in progress.idstringUnique identifier for the resourceimageIdstringId of the target audience image produced by this job. Only set after finishedAt is populated.targetAudienceIdstringThe audience this image is generated for.updatedAtstringTimestamp when the resource was last updatedworkspaceIdstringThe workspace this image job belongs to.Example
- cURL
- Python
- Node.js
- Go
curl "https://app.neuroflash.com/api/audience-service/v1/workspaces/{workspace_id}/target-audiences/{target_audience_id}/image-creation-jobs/{job_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}/image-creation-jobs/{job_id}",
headers={"Authorization": f"Bearer {token}"},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/audience-service/v1/workspaces/${workspaceId}/target-audiences/${targetAudienceId}/image-creation-jobs/${jobId}`,
{ 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-creation-jobs/"+jobID+"", 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",
"finishedAt": "2024-01-15T10:30:00Z",
"id": "string",
"imageId": "string",
"targetAudienceId": "string",
"updatedAt": "2024-01-15T10:30:00Z",
"workspaceId": "string"
}
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
additionalInformationstringNocountrystringNogenderDistributionobjectYes
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 JSONresidencestringYesResponse
_embeddedobject
createdByCustomerobject
emailstringEmail of the customerhadTrialbooleanTrue if the customer has ever started a trial in any workspacelegacyIdintegerID of the customer in the legacy systemnamestringName of the customerimageobjectAn image associated with a target audience
createdAtstringcreatedByUserIdstringfileNamestringFileName is used to generate a storage key which ends with the file name on duplication as wellidstringtargetAudienceIdstringupdatedAtstringurlstringnewPermissionsobject
deletionAllowedbooleanduplicationAllowedbooleanupdateAllowedbooleanviewingAllowedbooleanpermissionsobject
canDeletebooleancanDuplicatebooleancanUpdatebooleancanViewbooleanadditionalInformationstringcountrystringcreatedAtstringcreatedByUserIdstringgenderDistributionobject
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 JSONpainPointsarray<string>A list of strings stored in the database as JSONresidencestringsummarystringSummary is the rendered prose blurb fed into downstream prompts (chat, prompt-runs, etc.). Serialized via the api for the frontend in chat etcupdatedAtstringviewedAtstringworkspaceIdstringExample
- 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 '{
"additionalInformation": "string",
"country": "string",
"genderDistribution": {},
"interests": [],
"maxAge": 0,
"minAge": 0,
"name": "string",
"nativeLanguage": "string",
"needs": [],
"painPoints": [],
"residence": "string"
}'
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={
"additionalInformation": "string",
"country": "string",
"genderDistribution": {},
"interests": [],
"maxAge": 0,
"minAge": 0,
"name": "string",
"nativeLanguage": "string",
"needs": [],
"painPoints": [],
"residence": "string"
},
).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({
"additionalInformation": "string",
"country": "string",
"genderDistribution": {},
"interests": [],
"maxAge": 0,
"minAge": 0,
"name": "string",
"nativeLanguage": "string",
"needs": [],
"painPoints": [],
"residence": "string"
}),
}
).then((r) => r.json());
body, _ := json.Marshal(map[string]any{
"additionalInformation": "string",
"country": "string",
"genderDistribution": map[string]any{},
"interests": []any{},
"maxAge": 0,
"minAge": 0,
"name": "string",
"nativeLanguage": "string",
"needs": []any{},
"painPoints": []any{},
"residence": "string",
})
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": {
"createdByCustomer": {
"email": "eren.jaeger@neuroflash.com",
"hadTrial": false,
"legacyId": 5,
"name": "Eren Jaeger"
},
"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"
},
"newPermissions": {
"deletionAllowed": true,
"duplicationAllowed": true,
"updateAllowed": true,
"viewingAllowed": true
},
"permissions": {
"canDelete": false,
"canDuplicate": false,
"canUpdate": false,
"canView": false
}
},
"additionalInformation": "This audience prefers short-form video content",
"country": "US",
"createdAt": "2025-01-14T16:20:59Z",
"createdByUserId": "b0920767-2e30-48d3-80ce-268810bc433a",
"genderDistribution": {
"female": 0.5,
"male": 0.5,
"nonBinary": 0.5,
"preferNotToSay": 0.5
},
"id": "113c0b32-ed6c-4421-b7da-d1faf238eb56",
"interests": [
"string"
],
"maxAge": 65,
"minAge": 18,
"name": "Young urban professionals",
"nativeLanguage": "de",
"needs": [
"string"
],
"painPoints": [
"string"
],
"residence": "Berlin",
"summary": "string",
"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"
}
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()
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()