> ## Documentation Index
> Fetch the complete documentation index at: https://docs.posttu.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Social Listening Overview

> Monitor brand mentions, competitor queries, and industry topics across 12 social sources in realtime.

# Social Listening

Posttu Social Listening enables you to monitor keyword phrases, brand mentions, competitor discussions, and industry topics across 12 social sources with automated sentiment analysis, conversation intent classification, and realtime alerts.

## Supported Platforms

You can monitor mentions across 12 social networks:

| Platform | Identifier | Platform | Identifier |
| :- | :- | :- | :- |
| **X (Twitter)** | `TWITTER` | **Substack** | `SUBSTACK` |
| **Reddit** | `REDDIT` | **Instagram** | `INSTAGRAM` |
| **Bluesky** | `BLUESKY` | **Facebook** | `FACEBOOK` |
| **Mastodon** | `MASTODON` | **TikTok** | `TIKTOK` |
| **LinkedIn** | `LINKEDIN` | **Threads** | `THREADS` |
| **Hacker News** | `HACKERNEWS` | **Pinterest** | `PINTEREST` |

***

## Authentication & Authorization

All Social Listening endpoints require authentication using a Posttu API key passed as a Bearer token in the `Authorization` header:

```bash theme={null}
Authorization: Bearer <YOUR_POSTTU_API_KEY>
```

### Required Scopes

Access is governed by fine-grained API scopes and your workspace role:

| Endpoint / Operation | Scope Required | Description |
| :- | :- | :- |
| `GET /api/v1/inbox/listening/keywords` | `inbox:read` | List all tracked monitors |
| `GET /api/v1/inbox/listening/keywords/{id}` | `inbox:read` | Retrieve a single monitor |
| `POST /api/v1/inbox/listening/keywords` | `inbox:write` | Create a new tracked monitor |
| `PATCH /api/v1/inbox/listening/keywords/{id}` | `inbox:write` | Update or pause/resume a monitor |
| `DELETE /api/v1/inbox/listening/keywords/{id}` | `inbox:write` | Delete a monitor |
| `GET /api/v1/inbox/listening/analytics` | `inbox:read` | Fetch listening metrics and breakdowns |
| `GET /api/v1/inbox?type=KEYWORD` | `inbox:read` | Retrieve ingested mention items |

***

## Core Data Shapes

### Tracked Keyword Monitor (`ListeningKeyword`)

Each monitor tracks a single search query across chosen platforms, with optional negative keywords to exclude noise:

```typescript theme={null}
interface ListeningKeyword {
  id: string;                 // Unique identifier (e.g. "kw_abc123")
  organizationId: string;     // Workspace organization ID
  name: string;               // Display label (max 60 characters)
  query: string;              // Primary query or mention string (max 100 characters)
  negativeKeywords: string[]; // Up to 10 excluded keywords to suppress false positives
  platforms: string[];        // Array of enabled platform identifiers
  languages: string[];        // ISO language filters (e.g. ["en", "es"])
  isActive: boolean;          // Active status (toggle to pause/resume monitoring)
  color: string | null;       // Hex color for UI badge presentation
  eventsCount: number;        // Total cumulative mentions captured
  lastEventAt: string | null; // ISO 8601 timestamp of most recent mention
  createdAt: string;          // ISO 8601 creation timestamp
  updatedAt: string;          // ISO 8601 last update timestamp
}
```

### Mention Item (`InboxItem`)

Mentions are delivered as inbox items with `type: "KEYWORD"`:

```typescript theme={null}
interface KeywordInboxItem {
  id: string;                   // Unique mention ID
  type: "KEYWORD";              // Content type discriminator
  platform: string;             // Platform where mention was published
  channelId: string | null;     // null for public social listening mentions
  keywordId: string;            // ID of matching ListeningKeyword monitor
  keyword: {
    id: string;
    name: string;
    color: string | null;
  };
  contentPreview: string;       // Text body of the post or comment
  senderName: string | null;    // Display name of post author
  senderHandle: string | null;  // Username or handle (e.g. "@username")
  permalinkUrl: string | null;  // Direct web URL to the live post
  sentiment: "positive" | "negative" | "neutral" | "mixed" | null;
  intent: {
    id: string;
    name: string;
    slug: string;
    color: string | null;
  } | null;
  readAt: string | null;        // Read timestamp or null if unread
  isPinned: boolean;            // Pinned status in inbox
  isArchived: boolean;          // Archived status
  createdAt: string;            // ISO 8601 timestamp when mention was captured
}
```

***

## Querying Mentions & Search Syntax

You can retrieve captured social listening mentions using `GET /api/v1/inbox?type=KEYWORD`.

### Filter Parameters

| Parameter | Type | Description |
| :- | :- | :- |
| `keywordId` | `string` | Scope mentions to a specific monitor ID |
| `platform` | `string` | Filter by platform (e.g. `TWITTER`, `REDDIT`, `HACKERNEWS`) |
| `sentiment` | `string` | Filter by sentiment (`positive`, `negative`, `neutral`, `mixed`) |
| `intentId` | `string` | Filter by classified conversation intent ID |
| `isRead` | `boolean` | `true` for read, `false` for unread |
| `isPinned` | `boolean` | Filter by pinned state |
| `isArchived` | `boolean` | Filter by archived state |
| `start` / `end` | `string` | ISO 8601 date range boundaries |
| `limit` | `number` | Items per page (default: 50, max: 100) |
| `offset` | `number` | Pagination offset |

### Search Operators (`q` parameter)

The search query parameter `q` supports combined natural language queries and structured filter operators:

| Operator | Syntax Example | Description |
| :- | :- | :- |
| `keyword:` / `kw:` | `keyword:"posttu brand"` | Filter by tracked keyword label or query |
| `sentiment:` | `sentiment:negative` | Filter by detected sentiment (`positive`, `negative`, `neutral`, `mixed`) |
| `platform:` | `platform:reddit` | Filter by social source |
| `from:` | `from:@jane` | Filter by author username or handle |
| `since:` / `until:` | `since:7d until:2026-09-01` | Relative duration (`24h`, `7d`, `30d`) or ISO date |
| `is:unread` / `is:read` | `is:unread` | Read status filter |
| `is:pinned` | `is:pinned` | Pinned items filter |

**Example Combined Query**:

```http theme={null}
GET /api/v1/inbox?type=KEYWORD&q=pricing%20complaints%20platform:reddit%20sentiment:negative%20since:14d
```

***

## Model Context Protocol (MCP)

If you are integrating AI assistants, agents, or automated workflows using the Model Context Protocol (MCP), the following tools are available:

### Available Tools

1. **`list_tracked_keywords`**:
   * **Purpose**: Retrieve all active and paused social listening monitors, match counts, and last detection activity.
   * **Required Scope**: `inbox:read`
   * **Arguments**: `{}`

2. **`create_tracked_keyword`**:
   * **Purpose**: Set up a new keyword monitor across chosen social platforms.
   * **Required Scope**: `inbox:write`
   * **Arguments**:
     ```json theme={null}
     {
       "name": "Competitor Tracker",
       "query": "competitor_name",
       "negativeKeywords": ["hiring", "job opening"],
       "platforms": ["TWITTER", "REDDIT", "HACKERNEWS", "SUBSTACK"],
       "color": "#ef4444",
       "isActive": true
     }
     ```

3. **`get_listening_analytics`**:
   * **Purpose**: Retrieve volume metrics, sentiment percentages, platform distribution, and intent breakdowns.
   * **Required Scope**: `inbox:read`
   * **Arguments**:
     ```json theme={null}
     {
       "days": 30,
       "keywordId": "kw_123456",
       "platform": "TWITTER"
     }
     ```

4. **`list_inbox`**:
   * **Purpose**: Query inbox items with `platform`, `priority`, `isRead`, and keyword search terms.
   * **Required Scope**: `inbox:read`

***

## Realtime Streaming & Webhooks

When a mention is detected, a realtime event payload is emitted with `eventType: "keyword"`.

### Event Payload Schema

```json theme={null}
{
  "eventType": "keyword",
  "inboxItemId": "inbox_item_78910",
  "organizationId": "org_abc123",
  "keywordId": "kw_123456",
  "keywordName": "Posttu Mentions",
  "platform": "REDDIT",
  "contentPreview": "Just switched our social scheduling to Posttu, the unified inbox is incredible.",
  "senderName": "alex_dev",
  "senderHandle": "u/alex_dev",
  "permalinkUrl": "https://reddit.com/r/SaaS/comments/...",
  "sentiment": "positive",
  "intent": {
    "id": "intent_praise_01",
    "name": "Praise"
  },
  "timestamp": "2026-09-03T13:35:00.000Z"
}
```

***

## Rate Limits & Error Codes

| Status Code | Code | Reason / Handling |
| :- | :- | :- |
| `400` | `INVALID_PAYLOAD` | Validation error (e.g. query length > 100 characters, > 10 negative keywords). |
| `401` | `UNAUTHORIZED` | Missing or invalid Bearer API key. |
| `402` | `LIMIT_EXCEEDED` | Active keywords limit reached for workspace plan. Upgrade required. |
| `403` | `FORBIDDEN` | API key lacks required scope (`inbox:read` or `inbox:write`). |
| `404` | `NOT_FOUND` | Tracked keyword ID does not exist in workspace. |
| `429` | `RATE_LIMITED` | Request rate limit exceeded. Check `Retry-After` header. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.