Campaign and results services
Package pulse.v1. Every method needs a bearer token.
CampaignService
| Method | Request → Response | Notes |
|---|---|---|
CreateCampaign | CreateCampaignRequest → Campaign | |
GetCampaign | GetCampaignRequest → Campaign | |
ListCampaigns | ListCampaignsRequest → ListCampaignsResponse | Filter by status |
UpdateCampaign | UpdateCampaignRequest → Campaign | |
DeleteCampaign | DeleteCampaignRequest → Empty | Soft delete |
ArchiveCampaign | ArchiveCampaignRequest → Campaign |
message Campaign {
string id = 1;
string user_id = 2;
string name = 3;
string description = 4;
string objective = 5; // "brand_awareness", "lead_gen", "engagement", "sales"
repeated Channel channels = 6;
CampaignStatus status = 7;
double budget = 8;
double spent = 9;
string currency = 10; // "BRL", "USD", etc.
google.protobuf.Timestamp start_date = 11;
google.protobuf.Timestamp end_date = 12;
string target_audience = 13;
map<string, string> metadata = 14;
google.protobuf.Timestamp created_at = 15;
google.protobuf.Timestamp updated_at = 16;
string diagnostic_id = 17;
}
message CreateCampaignRequest {
string name = 1;
string description = 2;
string objective = 3;
repeated Channel channels = 4;
double budget = 5;
string currency = 6;
google.protobuf.Timestamp start_date = 7;
google.protobuf.Timestamp end_date = 8;
string target_audience = 9;
string diagnostic_id = 10;
}
message GetCampaignRequest {
string id = 1;
}
message ListCampaignsRequest {
PaginationRequest pagination = 1;
CampaignStatus status_filter = 2;
}
message ListCampaignsResponse {
repeated Campaign campaigns = 1;
PaginationResponse pagination = 2;
}
message UpdateCampaignRequest {
string id = 1;
string name = 2;
string description = 3;
string objective = 4;
repeated Channel channels = 5;
double budget = 6;
string currency = 7;
google.protobuf.Timestamp start_date = 8;
google.protobuf.Timestamp end_date = 9;
string target_audience = 10;
}
message DeleteCampaignRequest {
string id = 1;
}
message ArchiveCampaignRequest {
string id = 1;
}MetricsService
No PULSE code writes the
metrics table these methods read, so follower,
impression, engagement, click, lead, and reach figures are zero unless something
outside PULSE fills it. content_published is counted from your content and is
real. The campaign_id filter in GetMetricsSummaryRequest is ignored.| Method | Request → Response |
|---|---|
GetMetricsSummary | GetMetricsSummaryRequest → MetricsSummary |
GetDailyEvolution | GetDailyEvolutionRequest → DailyEvolutionResponse |
GetChannelDistribution | GetChannelDistributionRequest → ChannelDistributionResponse |
GetAgentReading | GetAgentReadingRequest → AgentReadingResponse |
message GetMetricsSummaryRequest {
DateRange date_range = 1;
string campaign_id = 2; // optional filter
}
message MetricsSummary {
int64 total_followers = 1;
int64 total_impressions = 2;
int64 total_engagements = 3;
double engagement_rate = 4;
int64 total_clicks = 5;
int64 total_leads = 6;
double conversion_rate = 7;
int64 content_published = 8;
double follower_growth_rate = 9;
double reach = 10;
map<string, double> channel_scores = 11; // per-channel health score 0-100
}
message GetDailyEvolutionRequest {
DateRange date_range = 1;
repeated Channel channels = 2;
string metric_type = 3; // "followers", "engagement", "impressions", "leads"
}
message DailyEvolutionResponse {
repeated MetricPoint data_points = 1;
map<string, double> trend_slopes = 2; // per-channel trend direction
}
message GetChannelDistributionRequest {
DateRange date_range = 1;
}
message ChannelDistribution {
Channel channel = 1;
double percentage = 2;
int64 absolute_value = 3;
double growth_rate = 4;
}
message ChannelDistributionResponse {
repeated ChannelDistribution distributions = 1;
}
message GetAgentReadingRequest {
DateRange date_range = 1;
string focus_area = 2; // "growth", "engagement", "content_performance", "overall"
}
message AgentReadingResponse {
string summary = 1;
repeated string key_insights = 2;
repeated string recommendations = 3;
double confidence = 4;
google.protobuf.Timestamp generated_at = 5;
}AnalyticsService
Google Analytics 4 trends and forecasts. Needs a Google Analytics connection.
| Method | Request → Response | Notes |
|---|---|---|
SyncGaData | SyncGaDataRequest → SyncGaDataResponse | Pulls one GA4 metric into the local cache. 90 days by default. |
GetTrends | GetTrendsRequest → GetTrendsResponse | Reads the cache |
GetForecast | GetForecastRequest → GetForecastResponse | 14 days by default. Needs at least 4 days of cached data. Bounds are ±2 residual standard deviations. |
message SyncGaDataRequest {
string metric = 1; // GA4 metric API name, e.g. "sessions", "activeUsers", "conversions"
int32 lookback_days = 2; // defaults to 90 if unset
}
message SyncGaDataResponse {
int32 synced_count = 1;
google.protobuf.Timestamp synced_at = 2;
}
message GetTrendsRequest {
string metric = 1;
int32 days = 2; // defaults to 90 if unset
}
message GetTrendsResponse {
repeated MetricPoint points = 1;
string metric = 2;
}
message GetForecastRequest {
string metric = 1;
int32 horizon_days = 2; // number of future days to forecast, defaults to 14
}
message GetForecastResponse {
repeated MetricPoint historical = 1;
repeated ForecastPoint forecast = 2;
repeated string anomalies = 3; // human-readable notes on historical anomalies
repeated google.protobuf.Timestamp changepoints = 4; // dates where the trend slope shifted
int32 season_period_days = 5; // 0 = no seasonality detected
}
message ForecastPoint {
google.protobuf.Timestamp date = 1;
double predicted_value = 2;
double lower_bound = 3;
double upper_bound = 4;
}FollowUpService
30-day cycles. See Follow up and measure.
| Method | Request → Response | Notes |
|---|---|---|
GetCycleProgress | GetCycleProgressRequest → CycleProgress | Empty cycle_id = the active cycle |
GetPlanner | GetPlannerRequest → PlannerResponse | week_number 0 = all weeks |
UpdateTaskStatus | UpdateTaskStatusRequest → PlannerTask | |
SaveCheckIn | SaveCheckInRequest → CheckIn | |
RecalculateWithEvolution | RecalculateWithEvolutionRequest → stream StreamChunk | |
GetEvolutionHistory | GetEvolutionHistoryRequest → EvolutionHistoryResponse | last_n_cycles 0 = all |
message GetCycleProgressRequest {
string cycle_id = 1; // empty = current active cycle
}
message CycleProgress {
string id = 1;
string user_id = 2;
int32 cycle_number = 3;
google.protobuf.Timestamp start_date = 4;
google.protobuf.Timestamp end_date = 5;
int32 total_tasks = 6;
int32 completed_tasks = 7;
double completion_percentage = 8;
int32 week_number = 9; // current week within cycle (1-4)
string status = 10; // "active", "completed", "abandoned"
string prescription_summary = 11;
string diagnostic_id = 12;
}
message GetPlannerRequest {
string cycle_id = 1;
int32 week_number = 2; // 0 = all weeks
}
message PlannerTask {
string id = 1;
string cycle_id = 2;
int32 week_number = 3;
int32 day_of_week = 4; // 1=Monday ... 7=Sunday
string title = 5;
string description = 6;
Channel channel = 7;
TaskStatus status = 8;
string content_type = 9; // "post", "story", "reel", "article", "engagement"
map<string, string> metadata = 10;
google.protobuf.Timestamp due_date = 11;
google.protobuf.Timestamp completed_at = 12;
}
message PlannerResponse {
string cycle_id = 1;
repeated PlannerTask tasks = 2;
int32 week_number = 3;
}
message UpdateTaskStatusRequest {
string task_id = 1;
TaskStatus status = 2;
string notes = 3;
}
message CheckIn {
string id = 1;
string cycle_id = 2;
int32 week_number = 3;
string user_id = 4;
int64 new_followers = 5;
int64 posts_published = 6;
int64 engagement_count = 7;
int64 leads_generated = 8;
string qualitative_notes = 9; // user's free-form update
string challenges = 10; // what didn't work
string wins = 11; // what worked well
double satisfaction_score = 12; // 1-10
google.protobuf.Timestamp created_at = 13;
}
message SaveCheckInRequest {
string cycle_id = 1;
int32 week_number = 2;
int64 new_followers = 3;
int64 posts_published = 4;
int64 engagement_count = 5;
int64 leads_generated = 6;
string qualitative_notes = 7;
string challenges = 8;
string wins = 9;
double satisfaction_score = 10;
}
message RecalculateWithEvolutionRequest {
string cycle_id = 1;
}
message GetEvolutionHistoryRequest {
int32 last_n_cycles = 1; // 0 = all
}
message EvolutionEntry {
string cycle_id = 1;
int32 week_number = 2;
int64 followers = 3;
int64 engagement = 4;
int64 leads = 5;
double satisfaction = 6;
google.protobuf.Timestamp date = 7;
}
message EvolutionHistoryResponse {
repeated EvolutionEntry entries = 1;
string trend_analysis = 2;
}