Skip to main content
This page is a practical workflow for engineers who want to use the API from zero to production-style integration. Scenario:
  • You want to create a Strategy programmatically.
  • The Strategy should focus on safe new launches with minimum liquidity and social proof.
  • You want to activate it, observe notifications, track performance, and receive webhook events.

Prerequisites

Set your environment variables:
export MP_BASE_URL="https://api.memeperfect.io/api/external/v1"
export MP_API_KEY="mpk_your_api_key_here"
Common header:
-H "X-API-Key: $MP_API_KEY"

Step 1: Confirm plan and limits

curl -s "$MP_BASE_URL/me" \
  -H "X-API-Key: $MP_API_KEY"
Use this to confirm:
  • your plan (PRO or DEGEN)
  • strategy activation limit
  • requests-per-minute limit

Step 2: Create a strategy

This example strategy:
  • triggers on newly created tokens
  • uses a single external rules[] list
  • marks critical checks as dealbreakers
  • applies market and social filters
  • sets alertCooldownMins to suppress duplicate alerts per token
  • keeps default trigger config empty because this example does not use twitter trigger types
curl -s -X POST "$MP_BASE_URL/strategies" \
  -H "X-API-Key: $MP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "API Safe Launch Flow",
    "description": "Programmatic strategy for safer early launches",
    "strict": true,
    "alertCooldownMins": 30,
    "triggers": ["new_token_created"],
    "rules": [
      { "rule": "is_honeypot", "dealbreaker": true, "enabled": true },
      { "rule": "has_freeze_authority", "dealbreaker": true, "enabled": true },
      { "rule": "risk_level", "dealbreaker": true, "value": "LOW" },
      { "rule": "liquidity_usd", "dealbreaker": false, "min": 10000 },
      { "rule": "market_cap", "dealbreaker": false, "max": 1500000 },
      { "rule": "has_website", "dealbreaker": false, "enabled": true },
      { "rule": "has_twitter", "dealbreaker": false, "enabled": true },
      { "rule": "website_content_validation_score", "dealbreaker": false, "min": 50 }
    ],
    "matching": {
      "enabled": true,
      "minPercent": 80
    },
    "isActive": false
  }'
Save strategy.id from the response for the next steps.

Step 3: Activate the strategy

export MP_STRATEGY_ID="your-strategy-uuid"

curl -s -X POST "$MP_BASE_URL/strategies/$MP_STRATEGY_ID/activate" \
  -H "X-API-Key: $MP_API_KEY"

Step 4: Verify strategy state

curl -s "$MP_BASE_URL/strategies/$MP_STRATEGY_ID" \
  -H "X-API-Key: $MP_API_KEY"
Check:
  • isActive is true
  • alertCooldownMins is present
  • response contains internal dealbreakers and grouped rules mapped from your external rules[]

Step 5: Update strategy rules

Example update:
  • increase liquidity threshold
  • tighten cooldown window
  • replace the full stored rules set with the new rules[] payload
curl -s -X PATCH "$MP_BASE_URL/strategies/$MP_STRATEGY_ID" \
  -H "X-API-Key: $MP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "alertCooldownMins": 45,
    "rules": [
      { "rule": "is_honeypot", "dealbreaker": true, "enabled": true },
      { "rule": "risk_level", "dealbreaker": true, "value": "LOW" },
      { "rule": "liquidity_usd", "dealbreaker": false, "min": 15000 },
      { "rule": "has_twitter", "dealbreaker": false, "enabled": true }
    ]
  }'
To fully clear existing rules, use replacement semantics with an empty list:
curl -s -X PATCH "$MP_BASE_URL/strategies/$MP_STRATEGY_ID" \
  -H "X-API-Key: $MP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "rules": []
  }'
Trigger updates follow the same replacement behavior: if you send triggers, the full trigger set is replaced; if omitted, existing triggers stay unchanged.

Step 6: Optional twitter/dev discovery queries

Get tracked twitter handles:
curl -s "$MP_BASE_URL/twitter/handles?status=active&sortBy=addedAt&sortOrder=desc" \
  -H "X-API-Key: $MP_API_KEY"
Get twitter tags (all scopes by default):
curl -s "$MP_BASE_URL/twitter/tags?scope=all&includeCounts=true" \
  -H "X-API-Key: $MP_API_KEY"
Get followed developers:
curl -s "$MP_BASE_URL/devs/my?page=1&limit=20&isActive=true" \
  -H "X-API-Key: $MP_API_KEY"
For twitter trigger strategies (twitter_mention_direct / tweet_metadata_match), include triggerConfigs.<eventType>.tagId in create/update payloads.

Step 7: Read notifications programmatically

List recent notifications:
curl -s "$MP_BASE_URL/notifications?page=1&limit=20&strategyId=$MP_STRATEGY_ID" \
  -H "X-API-Key: $MP_API_KEY"
Read one notification in detail:
export MP_NOTIFICATION_ID="your-notification-uuid"

curl -s "$MP_BASE_URL/notifications/$MP_NOTIFICATION_ID" \
  -H "X-API-Key: $MP_API_KEY"

Step 8: Check performance

Synchronous summary:
curl -s "$MP_BASE_URL/notifications/performance?range=daily&strategyId=$MP_STRATEGY_ID" \
  -H "X-API-Key: $MP_API_KEY"
Asynchronous flow for larger workloads:
curl -s -X POST "$MP_BASE_URL/notifications/performance/jobs?range=daily&strategyId=$MP_STRATEGY_ID" \
  -H "X-API-Key: $MP_API_KEY"
Then poll:
export MP_JOB_ID="job-id-from-previous-response"

curl -s "$MP_BASE_URL/notifications/performance/jobs/$MP_JOB_ID" \
  -H "X-API-Key: $MP_API_KEY"

Step 9: Configure webhook delivery

Check current config:
curl -s "$MP_BASE_URL/webhook" \
  -H "X-API-Key: $MP_API_KEY"
Set webhook endpoint:
curl -s -X PUT "$MP_BASE_URL/webhook" \
  -H "X-API-Key: $MP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": true,
    "url": "https://your-domain.com/memeperfect/webhook"
  }'
Use returned fields:
  • hasSecret
  • secret (when generated/rotated)
  • verifiedAt
  • verificationError (if verification failed)

Step 10: Deactivate strategy

curl -s -X POST "$MP_BASE_URL/strategies/$MP_STRATEGY_ID/deactivate" \
  -H "X-API-Key: $MP_API_KEY"

Step 11: Optional cleanup

curl -s -X DELETE "$MP_BASE_URL/strategies/$MP_STRATEGY_ID" \
  -H "X-API-Key: $MP_API_KEY"

Practical implementation checklist

  • Keep API key server-side only.
  • Persist strategy IDs in your own DB.
  • Use idempotent update logic in your integration.
  • Handle 429 throttling with retry/backoff.
  • Validate rule payloads with the Strategy Rules Spec before sending.

APIs

Full endpoint reference and payload examples.

Strategy Rules Spec

Rule schema, operators, and supported rule types.