Agent-skill-layerproof social-campaigns
Public API social campaigns (X-API-KEY). CRUD campaigns, generate, confirm outline, topics, variations, captions, exports, theme, citations. PublicApiSocialCampaignController (/api/v2/social-campaigns).
install
source · Clone the upstream repo
git clone https://github.com/compilet-dev/agent-skill-layerproof
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/compilet-dev/agent-skill-layerproof "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/social-campaigns" ~/.claude/skills/compilet-dev-agent-skill-layerproof-social-campaigns && rm -rf "$T"
manifest:
skills/social-campaigns/SKILL.mdsource content
Skill: Social Campaigns
Description
Social campaigns are projects with
project_kind SOCIAL_CAMPAIGN. This skill documents PublicApiSocialCampaignController at /api/v2/social-campaigns. Authenticate with X-API-KEY.
- Campaign generation returns
— pollactivity_id
(same as slide workflows).GET /api/v2/jobs/{activity_id} - ZIP exports return
— pollexport_id
(not the jobs endpoint).GET /api/v2/social-campaigns/{campaign_id}/exports/{export_id}
TypeScript types (selected)
// --- Create / list / get --- type PublicApiCreateCampaignRequest = { name: string; description?: string | null; status?: string | null; tags?: string[] | null; metadata?: Record<string, unknown> | null; workspace_id?: string | null; theme_id?: string | null; aspect_ratio?: string | null; }; type PublicApiCampaignResponse = { campaign_id: string; name: string; description?: string | null; campaign_live_object_id: string; created_at: string; updated_at: string; }; type PublicApiCampaignListResponse = { data: PublicApiCampaignResponse[]; next_cursor?: string | null; has_more: boolean; }; // --- Generate campaign --- type PublicApiTrendSnapshot = { key: string; label: string; platform: string; region?: string | null; score?: number | null; // ... additional optional analytics fields }; type PublicApiGenerateCampaignRequest = { prompt: string; theme_id?: string | null; tone_config?: { output_language?: string | null; text_detail_level?: string | null; tone?: string | null; voice?: string | null; audience?: string | null; } | null; reference_file_paths?: string[] | null; web_search_enabled?: boolean; target_topic_count?: number | null; trend_snapshot?: PublicApiTrendSnapshot | null; trend_snapshots?: PublicApiTrendSnapshot[] | null; auto_select?: boolean; // default false — if true, skips outline confirmation }; type PublicApiGenerateCampaignResponse = { campaign_live_object_id: string; activity_id: string; workflow_type: string; }; // --- Confirm outline (after outline step when auto_select is false) --- type PublicApiConfirmOutlineRequest = { selections: { topic_index: number; option_index: number }[]; }; // --- Topics (“posts” in paths) --- type PublicApiCreateTopicRequest = { topic?: string | null; core_message?: string | null; key_points?: string[] | null; visual_suggestion?: string | null; }; type PublicApiTopicResponse = { topic_id: string; live_object_id: string; status: string; topic?: string | null; core_message?: string | null; key_points?: string[] | null; visual_suggestion?: string | null; version: number; created_at: string; updated_at: string; }; // --- Export --- type PublicApiCampaignExportStartedResponse = { export_id: string; status: string; }; type PublicApiCampaignExportStatusResponse = { export_id: string; status: 'IN_PROGRESS' | 'COMPLETED' | 'FAILED'; download_url?: string | null; expires_at?: string | null; file_size_bytes?: number | null; error_message?: string | null; };
Campaign CRUD
| Action | Method | Path |
|---|---|---|
| Create | POST | |
| List (cursor) | GET | |
| Get + posts | GET | |
| Update | PUT | |
| Update settings (theme) | PUT | |
| Delete | DELETE | |
curl -X POST "$LAYERPROOF_BASE_URL/api/v2/social-campaigns" \ -H "Content-Type: application/json" \ -H "X-API-KEY: $LAYERPROOF_API_KEY" \ -d '{"name":"Q1 Launch","workspace_id":"<workspace_uuid>"}'
Generate & confirm
| Action | Method | Path |
|---|---|---|
| Generate from prompt | POST | |
| Confirm outline picks | POST | |
curl -X POST "$LAYERPROOF_BASE_URL/api/v2/social-campaigns/<campaign_id>/generate" \ -H "Content-Type: application/json" \ -H "X-API-KEY: $LAYERPROOF_API_KEY" \ -d '{"prompt":"Holiday campaign","target_topic_count":5,"web_search_enabled":true,"auto_select":false}'
Poll
. If GET /api/v2/jobs/{activity_id}
auto_select is false, user picks outline options, then POST confirm-outline with selections.
Topics (paths use /posts
)
/posts| Action | Method | Path |
|---|---|---|
| Create topic | POST | |
| Update topic | PUT | |
| Delete topic | DELETE | |
| Reorder | PUT | body |
Variations & images
| Action | Method | Path |
|---|---|---|
| Generate variations | POST | |
| More variations | POST | |
| Delete variation | DELETE | |
| Retry variation | POST | |
| Aspect ratio variant | POST | |
| Edit variation image | POST | |
| Accept edit (if needed) | POST | |
Poll
for async variation work.GET /api/v2/jobs/{activity_id}
Captions
| Action | Method | Path |
|---|---|---|
| Update caption / hashtags | PUT | |
| Generate caption (async) | POST | |
Theme
| Action | Method | Path |
|---|---|---|
| Generate campaign theme (async) | POST | |
Poll jobs with returned activity id.
Exports (ZIP)
| Action | Method | Path |
|---|---|---|
| Export full campaign ZIP | POST | |
| Export one topic ZIP | POST | |
| Poll export | GET | |
curl -X POST "$LAYERPROOF_BASE_URL/api/v2/social-campaigns/<campaign_id>/exports/zip" \ -H "X-API-KEY: $LAYERPROOF_API_KEY"
Citations & history
| Action | Method | Path |
|---|---|---|
| Campaign citations | GET | |
| Post citations | GET | |
| Platform post citations | GET | |
| Platform generation history | GET | |
| Platform edit history | GET | |
Agent behavior
Before any API call, verify environment variables are set:
if [[ -z "${LAYERPROOF_BASE_URL}" ]]; then echo "ERROR: LAYERPROOF_BASE_URL is not set." return 1 fi if [[ -z "${LAYERPROOF_API_KEY}" ]]; then echo "ERROR: LAYERPROOF_API_KEY is not set." return 1 fi # Load .env.local if present if [[ -f .env.local ]]; then set -a source .env.local set +a fi
- Resolve
(create or list).campaign_id
in responses is the campaign root live object.campaign_live_object_id - Generate → poll jobs until
/ handleDONE
.failure_reason - Exports → poll
until.../social-campaigns/{id}/exports/{export_id}
orCOMPLETED
.FAILED - Topics are listed under
in API paths; treatposts
as topic id.post_id - There is no
or per-platform image-edit in this public controller; platform-specific data appears in get campaign and citations/history endpoints when present.generate-platform
Response format (required)
- When responses include image URLs for posts or variations, render previews and show raw JSON.
- Always show verbatim JSON in a code block.