Skip to Content
Uncodie Market Fit está disponible 🎉
Rest APIAgentsGrowthGrowth Agent Segments API

Growth Agent Segments API

Creates audience segments and performs ICP analysis using Growth Marketer agents to identify profitable audiences and enhance targeting precision.

Endpoints

Create Audience Segments

POST /api/agents/growth/segments

Creates new audience segments for a website using Growth Marketer agent analysis.

Enhance Segments with ICP Analysis

POST /api/agents/growth/segments/icp

Performs detailed ICP (Ideal Customer Profile) analysis on existing segments to enhance targeting precision.

Request Body

Create Segments Request

ParameterTypeRequiredDescription
siteIdstringYesID of the website to analyze for segments
agent_idstringNoID of the agent to handle segment analysis
userIdstringNoID of the user creating the segments
segmentDataobjectNoObject containing segment analysis configuration

segmentData Object

ParameterTypeRequiredDescription
segmentCountnumberNoNumber of segments to create (default: 5)

Example Request

{ "siteId": "site_456", "agent_id": "agent_growth_123", "userId": "user_789", "segmentData": { "segmentCount": 5 } }

ICP Analysis Request

ParameterTypeRequiredDescription
siteIdstringYesID of the website containing the segments
agent_idstringNoID of the agent to handle ICP analysis
userIdstringNoID of the user requesting analysis
segmentIdsarrayYesArray of segment IDs to analyze

Example Request

{ "siteId": "site_456", "agent_id": "agent_growth_123", "userId": "user_789", "segmentIds": ["seg_123", "seg_456", "seg_789"] }

Try It

You can test this API directly using our API Tester interface. The API tester allows you to create audience segments and perform ICP analysis.

Create Segments Mode:

  • Site ID: The ID of the website to analyze for segments

ICP Analysis Mode:

  • Site ID: The ID of the website containing the segments
  • Segment IDs: Array of segment IDs to analyze

Optional fields for both modes:

  • Agent ID: ID of the agent to handle analysis
  • User ID: ID of the user creating/analyzing segments

API Tester

Este componente te permite probar diferentes endpoints de API.

Generated Command Structure

The system generates a command object with the following structure to control the segment analysis process:

{ "task": "analyze audience segments", "userId": "user_789", "agentId": "agent_growth_123", "site_id": "site_456", "description": "Analyze website and identify the most profitable audience segments", "targets": [ { "segments": [ { "name": "Digital Content Creators", "description": "Professionals aged 20-40 dedicated to creating digital content", "targetAudience": "media_entertainment", "estimatedSize": "189,000", "estimatedValue": "9,000,000", "profitabilityScore": 0.88 } ] } ], "context": "Segment Analysis Context:\n{\n \"segmentCount\": 5\n}", "supervisor": [ { "agent_role": "data_analyst", "status": "not_initialized" }, { "agent_role": "marketing_strategist", "status": "not_initialized" } ] }

Response

Create Segments Success Response

{ "success": true, "data": { "command_id": "cmd_abc123", "site_id": "site_456", "url": null, "segmentsAnalyzed": 5, "segmentsCreated": 3, "segments": [ { "id": "seg_content_creators", "name": "Digital Content Creators", "description": "Professionals aged 20-40 dedicated to creating digital content", "summary": "Highly profitable segment of digital creators", "estimatedSize": "189,000", "estimatedValue": "9,000,000", "profitabilityScore": 0.88, "confidenceScore": 0.85, "targetAudience": "media_entertainment", "language": "en", "attributes": { "demographic": { "ageRange": "20-40", "gender": "mixed", "income": "medium-high" } }, "audienceProfile": { "adPlatforms": { "googleAds": { "demographics": { "ageRanges": ["25-34", "35-44"] } } } }, "createdInDatabase": true, "created_at": "2023-06-15T14:30:00Z" } ], "saved_to_database": true } }

ICP Analysis Success Response

{ "success": true, "data": { "command_id": "cmd_icp456", "site_id": "site_456", "segmentsAnalyzed": 3, "segmentsUpdated": 3, "segments": [ { "id": "seg_content_creators", "name": "Digital Content Creators", "description": "Professionals aged 20-40 dedicated to creating digital content", "icpEnhanced": true, "icpEnhancementData": { "demographic_insights": { "age_distribution": "25-35 (60%), 36-45 (30%), 20-24 (10%)", "income_analysis": "$50K-$100K annually with variable income", "education_background": "Bachelor's degree in creative fields", "geographic_distribution": "Urban areas, creative hubs" }, "psychographic_profile": { "values_and_beliefs": "Creativity, authenticity, innovation", "lifestyle_preferences": "Work-life balance, flexible schedules", "personality_traits": "Creative, ambitious, tech-savvy", "motivations": "Self-expression, audience growth, monetization" }, "behavioral_insights": { "buying_behavior": "Research-heavy, value-conscious, trend-followers", "media_consumption": "Video content, social media, podcasts", "technology_adoption": "Early adopters, mobile-first", "engagement_preferences": "Visual content, interactive formats" } }, "updated_at": "2023-06-15T15:30:00Z" } ], "saved_to_database": true } }

Error Response

{ "success": false, "error": { "code": "SEGMENTS_NOT_FOUND", "message": "No segments found for the provided IDs and site" } }

Error Codes

CodeDescription
INVALID_REQUESTThe request parameters are invalid
INVALID_JSONCould not parse request body as JSON
SITE_NOT_FOUNDThe specified site does not exist
USER_NOT_FOUNDThe specified user does not exist
GROWTH_MARKETER_NOT_FOUNDNo Growth Marketer agent found for this site
SEGMENTS_NOT_FOUNDNo segments found for the provided IDs and site
SEGMENTS_VERIFICATION_FAILEDFailed to verify segments existence
SEGMENT_ANALYSIS_FAILEDGrowth Marketer segment analysis failed
ICP_ANALYSIS_FAILEDGrowth Marketer ICP analysis failed
NO_SEGMENTS_CREATEDNo segments could be created from analysis results
NO_SEGMENTS_UPDATEDNo segments could be updated with ICP results
INTERNAL_SERVER_ERRORAn error occurred while processing the request

Segment Database Structure

FieldTypeRequiredDescription
iduuidYesUnique identifier for the segment
nametextYesName of the audience segment
descriptiontextNoDetailed description of the segment
summarytextNoBrief summary of the segment
estimated_sizetextNoEstimated audience size
estimated_valuetextNoEstimated monetary value
profitability_scoredecimalNoProfitability score (0-1)
confidence_scoredecimalNoAnalysis confidence score (0-1)
target_audiencetextNoTarget audience category
languagetextNoPrimary language of the segment
attributesjsonbNoSegment attributes (demographic, behavioral, etc.)
audience_profilejsonbNoDetailed audience profile for ad platforms
site_iduuidYesID of the website (foreign key to sites.id)
user_iduuidNoID of the user (foreign key to users.id)
created_attimestamptzAutoCreation timestamp (default: now())
updated_attimestamptzAutoLast update timestamp (default: now())

Target Audiences

CategoryDescription
enterpriseLarge enterprise customers
smbSmall and medium businesses
e_commerceE-commerce and retail focused
techTechnology sector audiences
financeFinancial services sector
healthcareHealthcare and medical sector
educationEducational institutions
media_entertainmentMedia and entertainment industry
professionalProfessional services

Notes

  • The command executes asynchronously using advanced AI models
  • Automatically analyzes website content to identify profitable audience segments
  • Segments include detailed targeting information for advertising platforms
  • All segments are saved to the database with profitability scores
  • The system integrates with existing marketing automation platforms
Last updated on