Skip to main content

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

POST/v1/workspaces/{workspaceId}/target-audiences

Creates a new target audience for the specified workspace

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace ID

Request Body

FieldTypeRequiredDescription
additionalInformationstringNo
countrystringNo
genderDistributionobjectYes
femalenumberYes
malenumberYes
nonBinarynumberYes
preferNotToSaynumberYes
interestsarray<string>YesA list of strings stored in the database as JSON
maxAgeintegerYes
minAgeintegerYesWe store age range as separate min/max fields in the database
namestringYes
nativeLanguagestringNo
needsarray<string>YesA list of strings stored in the database as JSON
painPointsarray<string>YesA list of strings stored in the database as JSON
residencestringYes

Response

FieldTypeDescription
_embeddedobject
createdByCustomerobject
emailstringEmail of the customer
hadTrialbooleanTrue if the customer has ever started a trial in any workspace
legacyIdintegerID of the customer in the legacy system
namestringName of the customer
imageobjectAn image associated with a target audience
createdAtstring
createdByUserIdstring
fileNamestringFileName is used to generate a storage key which ends with the file name on duplication as well
idstring
targetAudienceIdstring
updatedAtstring
urlstring
newPermissionsobject
deletionAllowedboolean
duplicationAllowedboolean
updateAllowedboolean
viewingAllowedboolean
permissionsobject
canDeleteboolean
canDuplicateboolean
canUpdateboolean
canViewboolean
additionalInformationstring
countrystring
createdAtstring
createdByUserIdstring
genderDistributionobject
femalenumber
malenumber
nonBinarynumber
preferNotToSaynumber
idstring
interestsarray<string>A list of strings stored in the database as JSON
maxAgeinteger
minAgeintegerWe store age range as separate min/max fields in the database
namestring
nativeLanguagestring
needsarray<string>A list of strings stored in the database as JSON
painPointsarray<string>A list of strings stored in the database as JSON
residencestring
summarystringSummary is the rendered prose blurb fed into downstream prompts (chat, prompt-runs, etc.). Serialized via the api for the frontend in chat etc
updatedAtstring
viewedAtstring
workspaceIdstring

Example

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"
}'

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

POST/v1/workspaces/{workspaceId}/target-audiences/{targetAudienceId}/duplication

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace ID
targetAudienceIdstringYesTarget Audience ID

Request Body

FieldTypeRequiredDescription
newNamestringNo

Response

FieldTypeDescription
duplicateobjectA target audience is a group of people that share common properties and content can be targeted towards them
_embeddedobject
createdByCustomerobject
emailstringEmail of the customer
hadTrialbooleanTrue if the customer has ever started a trial in any workspace
legacyIdintegerID of the customer in the legacy system
namestringName of the customer
imageobjectAn image associated with a target audience
createdAtstring
createdByUserIdstring
fileNamestringFileName is used to generate a storage key which ends with the file name on duplication as well
idstring
targetAudienceIdstring
updatedAtstring
urlstring
newPermissionsobject
deletionAllowedboolean
duplicationAllowedboolean
updateAllowedboolean
viewingAllowedboolean
permissionsobject
canDeleteboolean
canDuplicateboolean
canUpdateboolean
canViewboolean
additionalInformationstring
countrystring
createdAtstring
createdByUserIdstring
genderDistributionobject
femalenumber
malenumber
nonBinarynumber
preferNotToSaynumber
idstring
interestsarray<string>A list of strings stored in the database as JSON
maxAgeinteger
minAgeintegerWe store age range as separate min/max fields in the database
namestring
nativeLanguagestring
needsarray<string>A list of strings stored in the database as JSON
painPointsarray<string>A list of strings stored in the database as JSON
residencestring
summarystringSummary is the rendered prose blurb fed into downstream prompts (chat, prompt-runs, etc.). Serialized via the api for the frontend in chat etc
updatedAtstring
viewedAtstring
workspaceIdstring
originalobjectA target audience is a group of people that share common properties and content can be targeted towards them
_embeddedobject
createdByCustomerobject
emailstringEmail of the customer
hadTrialbooleanTrue if the customer has ever started a trial in any workspace
legacyIdintegerID of the customer in the legacy system
namestringName of the customer
imageobjectAn image associated with a target audience
createdAtstring
createdByUserIdstring
fileNamestringFileName is used to generate a storage key which ends with the file name on duplication as well
idstring
targetAudienceIdstring
updatedAtstring
urlstring
newPermissionsobject
deletionAllowedboolean
duplicationAllowedboolean
updateAllowedboolean
viewingAllowedboolean
permissionsobject
canDeleteboolean
canDuplicateboolean
canUpdateboolean
canViewboolean
additionalInformationstring
countrystring
createdAtstring
createdByUserIdstring
genderDistributionobject
femalenumber
malenumber
nonBinarynumber
preferNotToSaynumber
idstring
interestsarray<string>A list of strings stored in the database as JSON
maxAgeinteger
minAgeintegerWe store age range as separate min/max fields in the database
namestring
nativeLanguagestring
needsarray<string>A list of strings stored in the database as JSON
painPointsarray<string>A list of strings stored in the database as JSON
residencestring
summarystringSummary is the rendered prose blurb fed into downstream prompts (chat, prompt-runs, etc.). Serialized via the api for the frontend in chat etc
updatedAtstring
viewedAtstring
workspaceIdstring

Example

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"
}'

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

POST/v1/workspaces/{workspaceId}/target-audiences/{targetAudienceId}/image-creation-jobs

Create an image-generation job for a target audience. The dedicated processImageCreationJobs worker picks the row up and runs the LLM prompt.

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYes
targetAudienceIdstringYes

Response

FieldTypeDescription
createdAtstringTimestamp when the resource was created
createdByUserIdstringnot set for workspaces imported from legacy team
finishedAtstringWhen the image was rendered and stored. Null while in progress.
idstringUnique identifier for the resource
imageIdstringId 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 updated
workspaceIdstringThe workspace this image job belongs to.

Example

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 '{}'

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

GET/v1/workspaces/{workspaceId}/target-audiences

List all target audiences that the user has access to

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace ID

Query Parameters

ParameterTypeDefaultDescription
pageintegerpage number
sizeintegerpage size
searchstringfind audience by name
countrystringfilter audience by country
nativeLanguagestringfilter audience by native language

Response

FieldTypeDescription
dataarray<object>
_embeddedobject
createdByCustomerobject
emailstringEmail of the customer
hadTrialbooleanTrue if the customer has ever started a trial in any workspace
legacyIdintegerID of the customer in the legacy system
namestringName of the customer
imageobjectAn image associated with a target audience
createdAtstring
createdByUserIdstring
fileNamestringFileName is used to generate a storage key which ends with the file name on duplication as well
idstring
targetAudienceIdstring
updatedAtstring
urlstring
newPermissionsobject
deletionAllowedboolean
duplicationAllowedboolean
updateAllowedboolean
viewingAllowedboolean
permissionsobject
canDeleteboolean
canDuplicateboolean
canUpdateboolean
canViewboolean
additionalInformationstring
countrystring
createdAtstring
createdByUserIdstring
genderDistributionobject
femalenumber
malenumber
nonBinarynumber
preferNotToSaynumber
idstring
interestsarray<string>A list of strings stored in the database as JSON
maxAgeinteger
minAgeintegerWe store age range as separate min/max fields in the database
namestring
nativeLanguagestring
needsarray<string>A list of strings stored in the database as JSON
painPointsarray<string>A list of strings stored in the database as JSON
residencestring
summarystringSummary is the rendered prose blurb fed into downstream prompts (chat, prompt-runs, etc.). Serialized via the api for the frontend in chat etc
updatedAtstring
viewedAtstring
workspaceIdstring
pageobject
currentPageinteger
sizeinteger
totalElementsinteger
totalPagesinteger

Example

curl "https://app.neuroflash.com/api/audience-service/v1/workspaces/{workspace_id}/target-audiences" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

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

GET/v1/workspaces/{workspaceId}/target-audiences/{targetAudienceId}

Retrieves a target audience by its ID

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace ID
targetAudienceIdstringYesTarget Audience ID

Response

FieldTypeDescription
_embeddedobject
createdByCustomerobject
emailstringEmail of the customer
hadTrialbooleanTrue if the customer has ever started a trial in any workspace
legacyIdintegerID of the customer in the legacy system
namestringName of the customer
imageobjectAn image associated with a target audience
createdAtstring
createdByUserIdstring
fileNamestringFileName is used to generate a storage key which ends with the file name on duplication as well
idstring
targetAudienceIdstring
updatedAtstring
urlstring
newPermissionsobject
deletionAllowedboolean
duplicationAllowedboolean
updateAllowedboolean
viewingAllowedboolean
permissionsobject
canDeleteboolean
canDuplicateboolean
canUpdateboolean
canViewboolean
additionalInformationstring
countrystring
createdAtstring
createdByUserIdstring
genderDistributionobject
femalenumber
malenumber
nonBinarynumber
preferNotToSaynumber
idstring
interestsarray<string>A list of strings stored in the database as JSON
maxAgeinteger
minAgeintegerWe store age range as separate min/max fields in the database
namestring
nativeLanguagestring
needsarray<string>A list of strings stored in the database as JSON
painPointsarray<string>A list of strings stored in the database as JSON
residencestring
summarystringSummary is the rendered prose blurb fed into downstream prompts (chat, prompt-runs, etc.). Serialized via the api for the frontend in chat etc
updatedAtstring
viewedAtstring
workspaceIdstring

Example

curl "https://app.neuroflash.com/api/audience-service/v1/workspaces/{workspace_id}/target-audiences/{target_audience_id}" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

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

GET/v1/workspaces/{workspaceId}/target-audiences/{targetAudienceId}/image

Returns a signed URL for the target audience image

Path Parameters

ParameterTypeRequiredDescription
targetAudienceIdstringYesTarget Audience ID

Response

FieldTypeDescription
createdAtstring
createdByUserIdstring
fileNamestringFileName is used to generate a storage key which ends with the file name on duplication as well
idstring
targetAudienceIdstring
updatedAtstring
urlstring

Example

curl "https://app.neuroflash.com/api/audience-service/v1/workspaces/{workspace_id}/target-audiences/{target_audience_id}/image" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

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

GET/v1/workspaces/{workspaceId}/target-audiences/{targetAudienceId}/image-creation-jobs

List image-generation jobs for an audience, newest first.

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYes
targetAudienceIdstringYes

Query Parameters

ParameterTypeDefaultDescription
pageinteger1page number for pagination, starting with 1 for the first page
sizeinteger20number of elements returned per page
sortstringfield by which to sort
orderstringascsort order

Response

FieldTypeDescription
dataarray<object>
createdAtstringTimestamp when the resource was created
createdByUserIdstringnot set for workspaces imported from legacy team
finishedAtstringWhen the image was rendered and stored. Null while in progress.
idstringUnique identifier for the resource
imageIdstringId 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 updated
workspaceIdstringThe workspace this image job belongs to.
pageobject
currentPageinteger
sizeinteger
totalElementsinteger
totalPagesinteger

Example

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"

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

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

ParameterTypeRequiredDescription
workspaceIdstringYes
targetAudienceIdstringYes
jobIdstringYes

Response

FieldTypeDescription
createdAtstringTimestamp when the resource was created
createdByUserIdstringnot set for workspaces imported from legacy team
finishedAtstringWhen the image was rendered and stored. Null while in progress.
idstringUnique identifier for the resource
imageIdstringId 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 updated
workspaceIdstringThe workspace this image job belongs to.

Example

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"

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

PUT/v1/workspaces/{workspaceId}/target-audiences/{targetAudienceId}

Updates an existing target audience

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace ID
targetAudienceIdstringYesTarget Audience ID

Request Body

FieldTypeRequiredDescription
additionalInformationstringNo
countrystringNo
genderDistributionobjectYes
femalenumberYes
malenumberYes
nonBinarynumberYes
preferNotToSaynumberYes
interestsarray<string>YesA list of strings stored in the database as JSON
maxAgeintegerYes
minAgeintegerYesWe store age range as separate min/max fields in the database
namestringYes
nativeLanguagestringNo
needsarray<string>YesA list of strings stored in the database as JSON
painPointsarray<string>YesA list of strings stored in the database as JSON
residencestringYes

Response

FieldTypeDescription
_embeddedobject
createdByCustomerobject
emailstringEmail of the customer
hadTrialbooleanTrue if the customer has ever started a trial in any workspace
legacyIdintegerID of the customer in the legacy system
namestringName of the customer
imageobjectAn image associated with a target audience
createdAtstring
createdByUserIdstring
fileNamestringFileName is used to generate a storage key which ends with the file name on duplication as well
idstring
targetAudienceIdstring
updatedAtstring
urlstring
newPermissionsobject
deletionAllowedboolean
duplicationAllowedboolean
updateAllowedboolean
viewingAllowedboolean
permissionsobject
canDeleteboolean
canDuplicateboolean
canUpdateboolean
canViewboolean
additionalInformationstring
countrystring
createdAtstring
createdByUserIdstring
genderDistributionobject
femalenumber
malenumber
nonBinarynumber
preferNotToSaynumber
idstring
interestsarray<string>A list of strings stored in the database as JSON
maxAgeinteger
minAgeintegerWe store age range as separate min/max fields in the database
namestring
nativeLanguagestring
needsarray<string>A list of strings stored in the database as JSON
painPointsarray<string>A list of strings stored in the database as JSON
residencestring
summarystringSummary is the rendered prose blurb fed into downstream prompts (chat, prompt-runs, etc.). Serialized via the api for the frontend in chat etc
updatedAtstring
viewedAtstring
workspaceIdstring

Example

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"
}'

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

PUT/v1/workspaces/{workspaceId}/target-audiences/{targetAudienceId}/image

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace ID
targetAudienceIdstringYesTarget Audience ID

Request Body

FieldTypeRequiredDescription
base64stringYes
contentTypestringYes
fileNamestringYes

Response

FieldTypeDescription
createdAtstring
createdByUserIdstring
fileNamestringFileName is used to generate a storage key which ends with the file name on duplication as well
idstring
targetAudienceIdstring
updatedAtstring
urlstring

Example

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"
}'

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

DELETE/v1/workspaces/{workspaceId}/target-audiences/{targetAudienceId}

Deletes an existing target audience

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace ID
targetAudienceIdstringYesTarget Audience ID

Example

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"

Delete a target audience image

DELETE/v1/workspaces/{workspaceId}/target-audiences/{targetAudienceId}/image

Deletes an existing image for a target audience

Path Parameters

ParameterTypeRequiredDescription
targetAudienceIdstringYesTarget Audience ID

Example

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"