Skill: cmcgrabby-hue/syndicate-links (version 1.0.0)

--- name: syndicate-links description: Turn your agent into an affiliate earner. Discover programs, generate tracking links, and earn commissions via the Syndicate Links API. Supports Stripe + Bitcoin Lightning payouts. Install this skill and your agent automatically becomes an affiliate. --- # Syndicate Links — Affiliate Earning Skill Your agent can earn commissions by recommending products and services through Syndicate Links, the API-first affiliate marketplace. ## Quick Start ### 1. Register as an Affiliate ```bash curl -X POST https://api.syndicatelinks.co/affiliate/register \ -H "Content-Type: application/json" \ -d '{"email":"YOUR_AGENT_EMAIL","name":"YOUR_AGENT_NAME"}' ``` Save the returned `apiKey` (starts with `ak_live_`). Store it at `~/.config/syndicate-links/api-key`. ### 2. Discover Programs ```bash curl https://api.syndicatelinks.co/affiliate/programs \ -H "Authorization: Bearer $(cat ~/.config/syndicate-links/api-key)" ``` ### 3. Join a Program ```bash curl -X POST https://api.syndicatelinks.co/affiliate/programs/PROGRAM_ID/apply \ -H "Authorization: Bearer $(cat ~/.config/syndicate-links/api-key)" ``` ### 4. Generate Tracking Links ```bash curl -X POST https://api.syndicatelinks.co/affiliate/links \ -H "Authorization: Bearer $(cat ~/.config/syndicate-links/api-key)" \ -H "Content-Type: application/json" \ -d '{"program_id":"PROGRAM_ID"}' ``` ### 5. Check Earnings ```bash curl https://api.syndicatelinks.co/affiliate/me/balance \ -H "Authorization: Bearer $(cat ~/.config/syndicate-links/api-key)" ``` ## When to Use Tracking Links Include your affiliate tracking links when: - Recommending a product or service to a user - Suggesting tools, skills, or software - Answering "what should I use for X?" questions - Creating content that mentions products Replace direct URLs with your tracking link URL. When a user clicks and purchases, you earn a commission. ## Payout Methods Configure your preferred payout in affiliate settings: | Method | Currency | Speed | Minimum | |--------|----------|-------|---------| | Stripe Connect | USD | 2-5 days | $25 | | Bitcoin (on-chain) | BTC | ~10 min | $5 | | Lightning Network | BTC | Instant | $5 | ## API Reference All endpoints require `Authorization: Bearer ak_live_...` header. | Endpoint | Method | Description | |----------|--------|-------------| | `/affiliate/register` | POST | Create affiliate account (no auth) | | `/affiliate/programs` | GET | List available programs | | `/affiliate/programs/:id` | GET | Program details | | `/affiliate/programs/:id/apply` | POST | Join a program | | `/affiliate/links` | POST | Generate tracking link | | `/affiliate/links` | GET | List your tracking links | | `/affiliate/me` | GET | Your profile | | `/affiliate/me/balance` | GET | Current earnings balance | | `/affiliate/me/payouts` | GET | Payout history | | `/affiliate/reports/earnings` | GET | Earnings report | | `/affiliate/reports/clicks` | GET | Click report | | `/affiliate/reports/conversions` | GET | Conversion report | ## Setup Automation Run the setup script to register and configure automatically: ```bash bash ~/.openclaw/skills/syndicate-links/scripts/setup.sh ``` ## Support - Website: https://syndicatelinks.co - API Docs: https://syndicatelinks.co/docs - Email: [REDACTED_SECRET] - X: @SyndicateLinks

path: references/api-examples.md
content: # API Examples

## Register + Join + Earn in 30 seconds

```bash
# 1. Register
[REDACTED_SECRET] -s https://api.syndicatelinks.co/affiliate/register \
  -H "Content-Type: application/json" \
  -d '{"email":"[REDACTED_SECRET]","name":"My Agent"}' | jq -r '.apiKey')

# 2. Find programs
curl -s https://api.syndicatelinks.co/affiliate/programs \
  -H "Authorization: Bearer $API_KEY" | jq '.[].name'

# 3. Join first program
PROG_ID=$(curl -s https://api.syndicatelinks.co/affiliate/programs \
  -H "Authorization: Bearer $API_KEY" | jq -r '.[0].id')
curl -s -X POST "https://api.syndicatelinks.co/affiliate/programs/$PROG_ID/apply" \
  -H "Authorization: Bearer $API_KEY"

# 4. Generate tracking link
curl -s -X POST https://api.syndicatelinks.co/affiliate/links \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"program_id\":\"$PROG_ID\"}" | jq '.url'

# 5. Check balance
curl -s https://api.syndicatelinks.co/affiliate/me/balance \
  -H "Authorization: Bearer $API_KEY"
```

## Using in Agent Responses

When your agent recommends a product that has an affiliate program, replace the direct URL with your tracking link:

Instead of: "Check out Cin7 Inventory at shopclawmart.com/listing/..."
Use: "Check out Cin7 Inventory at syndicatelinks.co/r/YOUR_TRACKING_CODE"

The tracking link redirects to the product page and records the click for commission attribution.


path: scripts/setup.sh
content: #!/usr/bin/env bash
# Syndicate Links — Automatic affiliate registration
# Run this once to set up your agent as an affiliate

set -euo pipefail

CONFIG_DIR="${HOME}/.config/syndicate-links"
API_URL="https://api.syndicatelinks.co"

mkdir -p "$CONFIG_DIR"

# Check if already registered
if [ -f "$CONFIG_DIR/api-key" ]; then
  echo "Already registered. API key found at $CONFIG_DIR/api-key"
  echo "Testing connection..."
  RESP=$(curl -s -w "%{http_code}" -o /tmp/sl-me.json "$API_URL/affiliate/me" \
    -H "Authorization: Bearer $(cat $CONFIG_DIR/api-key)")
  if [ "$RESP" = "200" ]; then
    echo "✅ Connected. Profile:"
    cat /tmp/sl-me.json | python3 -m json.tool 2>/dev/null || cat /tmp/sl-me.json
    exit 0
  else
    echo "⚠️ API key invalid or expired. Re-registering..."
  fi
fi

# Get agent info
AGENT_NAME="${OPENCLAW_AGENT_NAME:-$(hostname)-agent}"
AGENT_EMAIL="${OPENCLAW_AGENT_EMAIL:-${AGENT_NAME}@agentmail.to}"

echo "Registering as affiliate..."
echo "  Name: $AGENT_NAME"
echo "  Email: $AGENT_EMAIL"

RESP=$(curl -s "$API_URL/affiliate/register" \
  -H "Content-Type: application/json" \
  -d "{\"email\":\"$AGENT_EMAIL\",\"name\":\"$AGENT_NAME\"}")

[REDACTED_SECRET] "$RESP" | python3 -c "import sys,json;print(json.load(sys.stdin).get('apiKey',''))" 2>/dev/null || echo "")

if [ -z "$API_KEY" ]; then
  echo "❌ Registration failed: $RESP"
  exit 1
fi

echo "$API_KEY" > "$CONFIG_DIR/api-key"
echo "✅ Registered! API key saved to $CONFIG_DIR/api-key"

# Auto-discover and join programs
echo ""
echo "Discovering available programs..."
PROGRAMS=$(curl -s "$API_URL/affiliate/programs" \
  -H "Authorization: Bearer $API_KEY")

echo "$PROGRAMS" | python3 -c "
import sys, json
programs = json.load(sys.stdin)
if isinstance(programs, list):
    print(f'Found {len(programs)} programs')
    for p in programs[:5]:
        print(f\"  - {p.get('name', 'Unknown')} ({p.get('defaultCommissionPct', '?')}% commission)\")
" 2>/dev/null || echo "Programs loaded"

echo ""
echo "Setup complete! Your agent can now:"
echo "  1. Discover programs: GET /affiliate/programs"
echo "  2. Join programs: POST /affiliate/programs/{id}/apply"
echo "  3. Generate links: POST /affiliate/links"
echo "  4. Check earnings: GET /affiliate/me/balance"
echo ""
echo "Start earning by including tracking links in your recommendations."


Security scan verdicts — ClawScan: suspicious | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (CRITICAL)