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.md
source 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
    activity_id
    — poll
    GET /api/v2/jobs/{activity_id}
    (same as slide workflows).
  • ZIP exports return
    export_id
    — poll
    GET /api/v2/social-campaigns/{campaign_id}/exports/{export_id}
    (not the jobs endpoint).

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

ActionMethodPath
CreatePOST
/api/v2/social-campaigns
List (cursor)GET
/api/v2/social-campaigns?limit=20&cursor=
Get + postsGET
/api/v2/social-campaigns/{campaign_id}
UpdatePUT
/api/v2/social-campaigns/{campaign_id}
Update settings (theme)PUT
/api/v2/social-campaigns/{campaign_id}/settings
DeleteDELETE
/api/v2/social-campaigns/{campaign_id}
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

ActionMethodPath
Generate from promptPOST
/api/v2/social-campaigns/{campaign_id}/generate
Confirm outline picksPOST
/api/v2/social-campaigns/{campaign_id}/confirm-outline
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

GET /api/v2/jobs/{activity_id}
. If
auto_select
is false, user picks outline options, then POST confirm-outline with
selections
.


Topics (paths use
/posts
)

ActionMethodPath
Create topicPOST
/api/v2/social-campaigns/{campaign_id}/posts
Update topicPUT
/api/v2/social-campaigns/{campaign_id}/posts/{post_id}
Delete topicDELETE
/api/v2/social-campaigns/{campaign_id}/posts/{post_id}
ReorderPUT
/api/v2/social-campaigns/{campaign_id}/reorder
body
{"topic_ids":["uuid",...]}

Variations & images

ActionMethodPath
Generate variationsPOST
.../posts/{post_id}/generate-variations
More variationsPOST
.../posts/{post_id}/generate-more-variations
Delete variationDELETE
.../posts/{post_id}/variations/{variation_id}
Retry variationPOST
.../posts/{post_id}/variations/{variation_id}/retry
Aspect ratio variantPOST
.../posts/{post_id}/variations/{variation_id}/generate-aspect-ratio
Edit variation imagePOST
.../posts/{post_id}/variations/{variation_id}/edit-image
Accept edit (if needed)POST
.../posts/{post_id}/variations/{variation_id}/accept-edit

Poll

GET /api/v2/jobs/{activity_id}
for async variation work.


Captions

ActionMethodPath
Update caption / hashtagsPUT
.../posts/{post_id}/caption
Generate caption (async)POST
.../posts/{post_id}/generate-caption

Theme

ActionMethodPath
Generate campaign theme (async)POST
/api/v2/social-campaigns/{campaign_id}/generate-theme

Poll jobs with returned activity id.


Exports (ZIP)

ActionMethodPath
Export full campaign ZIPPOST
/api/v2/social-campaigns/{campaign_id}/exports/zip
Export one topic ZIPPOST
/api/v2/social-campaigns/{campaign_id}/posts/{post_id}/exports/zip
Poll exportGET
/api/v2/social-campaigns/{campaign_id}/exports/{export_id}
curl -X POST "$LAYERPROOF_BASE_URL/api/v2/social-campaigns/<campaign_id>/exports/zip" \
  -H "X-API-KEY: $LAYERPROOF_API_KEY"

Citations & history

ActionMethodPath
Campaign citationsGET
/api/v2/social-campaigns/{campaign_id}/citations
Post citationsGET
.../posts/{post_id}/citations
Platform post citationsGET
.../posts/{post_id}/platforms/{platform}/citations
Platform generation historyGET
.../posts/{post_id}/platforms/{platform}/history
Platform edit historyGET
.../posts/{post_id}/platforms/{platform}/edits

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
  1. Resolve
    campaign_id
    (create or list).
    campaign_live_object_id
    in responses is the campaign root live object.
  2. Generate → poll jobs until
    DONE
    / handle
    failure_reason
    .
  3. Exports → poll
    .../social-campaigns/{id}/exports/{export_id}
    until
    COMPLETED
    or
    FAILED
    .
  4. Topics are listed under
    posts
    in API paths; treat
    post_id
    as topic id.
  5. There is no
    generate-platform
    or per-platform image-edit in this public controller; platform-specific data appears in get campaign and citations/history endpoints when present.

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.