We use cookies to measure site usage with Google Analytics. We only turn that on if you say yes. See our Privacy Policy.

Documentation

Building Custom Integrations

Build custom integrations with BlackOps Center using our REST API, webhooks, and extensibility points.

BlackOps Center is built to be extended. Whether you're connecting to your CRM, building a mobile app, or automating workflows with Zapier, our API and webhook system make it possible.

Integration Approaches

1. REST API

Use Case: Pull data from BlackOps Center or push data to it programmatically

Examples:

  • Fetch blog posts for a mobile app
  • Add notes to a brain from external tools
  • Sync content to a CMS
  • Build custom analytics dashboards

Authentication: API keys (bearer token)

2. Webhooks

Use Case: React to events in real-time without polling

Examples:

  • Notify Slack when content is published
  • Update CRM when user subscribes
  • Trigger CI/CD pipeline on content changes
  • Sync analytics to data warehouse

Authentication: Signature verification

3. Email Integration

Use Case: Forward content to BlackOps Center via email

Examples:

  • Forward newsletters to a capture address
  • Save Gmail starred emails as content
  • Email voice memos (via transcription service)

Authentication: Capture addresses. Mail sent to one lands in the Triage lane of the brain it maps to

4. Browser Extension

Use Case: Capture content while browsing

Examples:

  • One-click save of a highlight to your default brain
  • Right-click to save selection
  • Automatic capture of starred tweets

Authentication: OAuth or API key

5. MCP (Claude CoWork)

Use Case: Run BlackOps operations directly from Claude via MCP tools

Examples:

  • List sites, posts, and notes from chat
  • Create and publish drafts without leaving Claude
  • Fetch brand voice/context before generating content
  • Run tweet workflows across multiple site accounts

Authentication: Bearer token via MCP server environment

Read the Claude CoWork MCP setup guide.

REST API

Base URL

https://blackopscenter.com/api

Authentication

All API requests require an API key passed as a bearer token:

Authorization: Bearer YOUR_API_KEY

Generating API Keys

  1. Log in to BlackOps Center
  2. Go to Settings → Developer → API Keys
  3. Click "Create API Key"
  4. Name it (e.g., "Mobile App", "Zapier Integration")
  5. Copy the key immediately (only shown once)
  6. Store securely

🔒 API Key Security

  • Never commit keys to version control
  • Use environment variables
  • Rotate keys periodically
  • Revoke keys when no longer needed
  • Use separate keys per integration (easier to revoke)

Common API Endpoints

Brains

# List brains
GET /api/v2/brains

# Get a brain
GET /api/v2/brains/{brainId}

# Create a brain
POST /api/v2/brains
{
  "name": "React Performance",
  "description": "Performance tips and patterns",
  "site_id": "xxx"
}

# Ingest into a brain (lands in the brain's Triage lane)
POST /api/v2/brains/{brainId}/ingest
{
  "title": "React 19 useMemo Changes",
  "content": "Full content here...",
  "url": "https://example.com/post",
  "source": "article",
  "tags": ["react", "performance"]
}

# List a brain's pending Triage items
GET /api/v2/brains/{brainId}/triage

# List a brain's notes
GET /api/v2/notes/list?brain_id={brainId}

source must be one of manual, discovery, rss_feed, content_library, tweet, article, email, youtube, upload or v2_api. Omit it and the note records v2_api. See Brain Ingest.

Blog Posts

# List published posts
GET /api/blog/posts?site_id={siteId}&limit=10

# Get single post
GET /api/blog/posts/{slug}

# Create draft
POST /api/admin/posts
{
  "title": "Getting Started with Next.js",
  "content": "Markdown content...",
  "status": "draft",
  "site_id": "xxx"
}

# Publish post
PATCH /api/admin/posts/{postId}
{
  "status": "published",
  "published_at": "2025-02-01T10:00:00Z"
}

Newsletter Subscribers

# List subscribers
GET /api/admin/newsletters/{newsletterId}/subscribers

# Add subscriber
POST /api/admin/newsletters/{newsletterId}/subscribe
{
  "email": "user@example.com",
  "name": "User Name"
}

# Unsubscribe
POST /api/admin/newsletters/{newsletterId}/unsubscribe
{
  "email": "user@example.com"
}

Analytics

# Get site analytics
GET /api/admin/analytics?site_id={siteId}&start_date=2025-01-01&end_date=2025-01-31

# Track custom event
POST /api/track/event
{
  "event_name": "custom_cta_click",
  "site_id": "xxx",
  "properties": {
    "cta_location": "sidebar",
    "post_slug": "react-performance"
  }
}

Error Handling

API returns standard HTTP status codes:

200 OK - Success
201 Created - Resource created
400 Bad Request - Invalid input
401 Unauthorized - Missing/invalid API key
403 Forbidden - No access to resource
404 Not Found - Resource doesn't exist
429 Too Many Requests - Rate limit exceeded
500 Internal Server Error - Server error

# Error response format
{
  "error": "Invalid API key",
  "code": "INVALID_AUTH",
  "details": {
    "message": "The API key provided is not valid"
  }
}

Rate Limiting

API requests are rate-limited per API key:

  • 1,000 requests/hour per API key

Rate limit headers:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 847
X-RateLimit-Reset: 1738368000

Integration Examples

Example 1: Sync Notion Pages to a Brain

// notion-to-blackops.js
import { Client } from '@notionhq/client'

const notion = new Client({ auth: process.env.NOTION_API_KEY })
const BLACKOPS_API_KEY = process.env.BLACKOPS_API_KEY
const BRAIN_ID = 'your-brain-id'

async function syncNotionToBrain() {
  // Fetch pages from Notion database
  const response = await notion.databases.query({
    database_id: process.env.NOTION_DATABASE_ID,
    filter: {
      property: 'Status',
      select: { equals: 'Ready to Sync' }
    }
  })
  
  for (const page of response.results) {
    // Extract content
    const title = page.properties.Name.title[0]?.plain_text
    const content = await getPageContent(page.id)
    
    // Ingest into the brain (lands in its Triage lane)
    await fetch(`https://blackopscenter.com/api/v2/brains/${BRAIN_ID}/ingest`, {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${BLACKOPS_API_KEY}`,
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        title,
        content,
        source: 'manual',
        tags: ['notion', 'synced']
      })
    })
    
    // Update Notion status
    await notion.pages.update({
      page_id: page.id,
      properties: {
        Status: { select: { name: 'Synced' } }
      }
    })
  }
}

// Run daily
setInterval(syncNotionToBrain, 24 * 60 * 60 * 1000)

Example 2: Slack Notification on Post Publish

// webhook-handler.js (your server)
import { WebhookClient } from '@slack/webhook'

const slackWebhook = new WebhookClient(process.env.SLACK_WEBHOOK_URL)

export async function POST(request) {
  const event = await request.json()
  
  if (event.type === 'post.published') {
    const post = event.data
    
    await slackWebhook.send({
      text: `📝 New blog post published!`,
      blocks: [
        {
          type: 'section',
          text: {
            type: 'mrkdwn',
            text: `*${post.title}*\n${post.excerpt}`
          }
        },
        {
          type: 'actions',
          elements: [
            {
              type: 'button',
              text: { type: 'plain_text', text: 'View Post' },
              url: post.url
            }
          ]
        }
      ]
    })
  }
  
  return new Response('OK', { status: 200 })
}

Example 3: iOS Shortcut to Save to a Brain

# iOS Shortcuts app (pseudo-code)

1. Get URL from Share Sheet
2. Extract metadata (title, image) via web scraping
3. Get text input "Add notes (optional)"
4. Make API request:
   
   POST https://blackopscenter.com/api/v2/brains/{brainId}/ingest
   Headers:
     Authorization: Bearer {API_KEY}
   Body:
     {
       "url": {URL from Share Sheet},
       "title": {Extracted Title},
       "content": {User Notes},
       "source": "manual",
       "tags": ["mobile-saved"]
     }
   
5. Show notification "Saved to brain"

Example 4: Zapier Integration

# Zapier Workflow

Trigger: New row in Google Sheets
Action: HTTP POST to BlackOps Center API

Setup:
1. Trigger: New or Updated Row in Google Sheets
   - Spreadsheet: Content Ideas
   - Worksheet: Ideas

2. Action: Webhooks by Zapier - POST
   - URL: https://blackopscenter.com/api/v2/brains/xxx/ingest
   - Headers:
     Authorization: Bearer YOUR_API_KEY
     Content-Type: application/json
   - Data:
     {
       "title": {{Title}},
       "content": {{Description}},
       "tags": ["google-sheets", "idea"],
       "source": "manual"
     }

Result: Google Sheets → New item in the brain's Triage lane

Building a Chrome Extension

Manifest v3 Example

// manifest.json
{
  "manifest_version": 3,
  "name": "BlackOps Center Clipper",
  "version": "1.0",
  "permissions": [
    "activeTab",
    "storage"
  ],
  "background": {
    "service_worker": "background.js"
  },
  "action": {
    "default_popup": "popup.html",
    "default_icon": "icon.png"
  },
  "commands": {
    "save-to-brain": {
      "suggested_key": {
        "default": "Ctrl+Shift+S"
      },
      "description": "Save to brain"
    }
  }
}

Background Script

// background.js
chrome.commands.onCommand.addListener((command) => {
  if (command === 'save-to-brain') {
    chrome.tabs.query({ active: true, currentWindow: true }, async (tabs) => {
      const tab = tabs[0]
      
      // Get API key from storage
      const { apiKey } = await chrome.storage.sync.get('apiKey')
      
      // Save current page
      await fetch('https://blackopscenter.com/api/v2/brains/xxx/ingest', {
        method: 'POST',
        headers: {
          'Authorization': `Bearer ${apiKey}`,
          'Content-Type': 'application/json'
        },
        body: JSON.stringify({
          title: tab.title,
          url: tab.url,
          source: 'article',
          tags: ['chrome-saved']
        })
      })
      
      // Show notification
      chrome.notifications.create({
        type: 'basic',
        iconUrl: 'icon.png',
        title: 'Saved to Brain',
        message: tab.title
      })
    })
  }
})

Best Practices

1. Handle Errors Gracefully

async function ingestIntoBrain(data) {
  try {
    const response = await fetch(API_URL, {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${API_KEY}`,
        'Content-Type': 'application/json'
      },
      body: JSON.stringify(data)
    })
    
    if (!response.ok) {
      const error = await response.json()
      throw new Error(`API Error: ${error.message}`)
    }
    
    return await response.json()
  } catch (error) {
    console.error('Failed to create item:', error)
    // Don't crash - queue for retry or notify user
    await queueForRetry(data)
  }
}

2. Implement Retry Logic

async function apiRequestWithRetry(url, options, maxRetries = 3) {
  for (let i = 0; i < maxRetries; i++) {
    try {
      const response = await fetch(url, options)
      if (response.ok) return response
      
      // Retry on 5xx errors
      if (response.status >= 500) {
        await sleep(Math.pow(2, i) * 1000) // Exponential backoff
        continue
      }
      
      // Don't retry on 4xx errors
      throw new Error(`HTTP ${response.status}`)
    } catch (error) {
      if (i === maxRetries - 1) throw error
      await sleep(Math.pow(2, i) * 1000)
    }
  }
}

3. Respect Rate Limits

class RateLimitedClient {
  constructor(apiKey, requestsPerHour = 1000) {
    this.apiKey = apiKey
    this.requestsPerHour = requestsPerHour
    this.requests = []
  }
  
  async request(url, options) {
    // Remove requests older than 1 hour
    const oneHourAgo = Date.now() - 3600000
    this.requests = this.requests.filter(t => t > oneHourAgo)
    
    // Check rate limit
    if (this.requests.length >= this.requestsPerHour) {
      const oldestRequest = this.requests[0]
      const waitTime = oldestRequest + 3600000 - Date.now()
      throw new Error(`Rate limit exceeded. Wait ${waitTime}ms`)
    }
    
    // Make request
    this.requests.push(Date.now())
    return fetch(url, {
      ...options,
      headers: {
        ...options.headers,
        'Authorization': `Bearer ${this.apiKey}`
      }
    })
  }
}

4. Cache API Responses

const cache = new Map()

async function getCachedBrains(siteId) {
  const cacheKey = `brains-${siteId}`
  
  // Check cache
  if (cache.has(cacheKey)) {
    const { data, timestamp } = cache.get(cacheKey)
    // Cache valid for 5 minutes
    if (Date.now() - timestamp < 300000) {
      return data
    }
  }
  
  // Fetch fresh data
  const response = await fetch('/api/v2/brains')
  const data = await response.json()
  
  // Update cache
  cache.set(cacheKey, {
    data,
    timestamp: Date.now()
  })
  
  return data
}

5. Validate Input

import { z } from 'zod'

const BrainIngestSchema = z.object({
  title: z.string().min(1).max(500),
  content: z.string().optional(),
  url: z.string().url().optional(),
  tags: z.array(z.string()).max(50),
  source: z.string().optional()
})

// Validate before sending
const data = {
  title: userInput.title,
  content: userInput.content,
  url: userInput.url,
  tags: userInput.tags
}

try {
  const validated = BrainIngestSchema.parse(data)
  await ingestIntoBrain(validated)
} catch (error) {
  console.error('Validation error:', error.errors)
  // Show user-friendly error
}

OAuth Integration (Coming Soon)

OAuth 2.0 support is coming soon for third-party applications. This will enable:

  • User authorization without sharing API keys
  • Scoped permissions (read-only, write-only, etc.)
  • Token refresh and expiration
  • Revocation by users

OAuth flow will look like:

1. Redirect user to:
   https://blackopscenter.com/oauth/authorize?
     client_id=YOUR_CLIENT_ID&
     redirect_uri=https://yourapp.com/callback&
     scope=brains:write,posts:read

2. User approves access

3. BlackOps Center redirects back:
   https://yourapp.com/callback?code=AUTHORIZATION_CODE

4. Exchange code for access token:
   POST https://blackopscenter.com/oauth/token
   {
     "code": "AUTHORIZATION_CODE",
     "client_id": "YOUR_CLIENT_ID",
     "client_secret": "YOUR_CLIENT_SECRET",
     "grant_type": "authorization_code"
   }

5. Use access token for API requests:
   Authorization: Bearer ACCESS_TOKEN

Integration Gallery

Community-built integrations (coming soon):

  • Notion Sync: Bi-directional sync between Notion and brains
  • Airtable Bridge: Use Airtable as content source
  • Make (Integromat): Visual workflow automation
  • n8n: Self-hosted workflow automation
  • Obsidian Plugin: Save notes to brains
  • Readwise: Import highlights to brains

Getting Help

The best tools are the ones that play well with others. Build something cool? Share it with the community.

Want this page as machine-readable markdown? GET /docs/developer/integrations.md