Create Marketing Campaigns Command
Creates a command object to generate optimized marketing campaigns based on monthly budget, business goals, and target audience.
Endpoint
POST /api/agents/growth/campaignsRequest Body
| Parameter | Type | Required | Description |
|---|---|---|---|
siteId | string | Yes | ID of the website to create campaigns for |
agent_id | string | No | ID of the agent to handle campaign creation |
userId | string | No | ID of the user creating the campaigns |
campaignData | object | Yes | Object containing all campaign-specific data |
campaignData Object
| Parameter | Type | Required | Description |
|---|---|---|---|
segmentIds | array | No | Array of target audience segment IDs |
Example Request
{
"siteId": "site_456",
"agent_id": "agent_growth_123",
"userId": "user_789",
"campaignData": {
"segmentIds": ["seg_123", "seg_456"]
}
}Try It
You can test this API directly using our API Tester interface. The API tester allows you to generate optimized marketing campaigns based on your business parameters.
Required fields:
- Site ID: The ID of the website to create campaigns for
Optional fields:
- Agent ID: ID of the agent to handle campaign creation
- User ID: ID of the user creating the campaigns
- Segment IDs: Array of target audience segment IDs
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 campaign creation process:
{
"task": "create marketing campaigns",
"userId": "user_789",
"agentId": "agent_growth_123",
"site_id": "site_456",
"description": "Generate marketing campaigns for the specified site",
"targets": [
{
"campaigns": [
{
"title": "B2B Lead Generation Campaign",
"description": "High-performance search campaign focusing on decision-makers in the B2B software sector",
"type": "inbound' | 'outbound' | 'branding' | 'product' | 'events' | 'success' | 'account' | 'community' | 'guerrilla' | 'affiliate' | 'experiential' | 'programmatic' | 'performance' | 'publicRelations"
}
]
}
],
"context": "Campaign Creation Context:\n{\n \"segments\": [\n {\n \"title\": \"B2B Decision Makers\"\n },\n {\n \"title\": \"Enterprise Software Users\"\n }\n ]\n}",
"supervisor": [
{
"agent_role": "growth_marketer",
"status": "not_initialized"
},
{
"agent_role": "budget_optimizer",
"status": "not_initialized"
}
]
}Response
Success Response
{
"success": true,
"data": {
"command_id": "cmd_abc123",
"site_id": "site_456",
"campaigns": [
{
"id": "camp_123abc"
},
{
"id": "camp_456def"
},
{
"id": "camp_789ghi"
},
{
"id": "camp_012jkl"
}
],
"saved_to_database": true
}
}Error Response
{
"success": false,
"error": {
"code": "INVALID_REQUEST",
"message": "Invalid request parameters"
}
}Error Codes
| Code | Description |
|---|---|
INVALID_REQUEST | The request parameters are invalid |
SITE_NOT_FOUND | The specified site does not exist |
SEGMENT_NOT_FOUND | The specified segment does not exist |
USER_NOT_FOUND | The specified user does not exist |
SYSTEM_ERROR | Internal system error occurred |
Campaign Database Structure
| Field | Type | Required | Description |
|---|---|---|---|
id | uuid | Yes | Unique identifier for the campaign |
title | text | Yes | Title of the campaign |
description | text | No | Description of the campaign |
status | text | No | Current status of the campaign |
type | text | No | Type of campaign |
site_id | uuid | Yes | ID of the website (foreign key to sites.id) |
user_id | uuid | No | ID of the user (foreign key to users.id) |
created_at | timestamptz | Auto | Creation timestamp (default: now()) |
updated_at | timestamptz | Auto | Last update timestamp (default: now()) |
due_date | date | No | Due date for the campaign |
assignees | int4 | No | Number of assignees |
issues | int4 | No | Number of issues |
Campaign Types
| Type | Description |
|---|---|
search_ads | Search engine advertising campaigns |
social_ads | Social media advertising campaigns |
display_ads | Display network advertising campaigns |
email_marketing | Email marketing campaigns and sequences |
content_creation | Content marketing and thought leadership |
video_marketing | Video content and advertising campaigns |
affiliate | Affiliate and partnership marketing programs |
retargeting | Retargeting/remarketing campaigns |
Notes
- The command executes asynchronously
- The generated command controls the campaign planning process with:
campaigns: An array of objects defining campaigns with title, description, and typecontext: Provides business information and segments to guide campaign creationsupervisors: Defines which agent roles can provide additional inputtask: Specifies the high-level objective for the agentdescription: Contains the detailed prompt instructions for the agent
- The system automatically selects the most appropriate segments for each campaign
- All created campaigns are saved to the database with the structure shown above
Last updated on