> ## 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 & Sentiment Analysis API

> How to programmatically create keyword monitors, filter negative terms, track sentiment velocity, and ingest brand mentions across social platforms.

Posttu's Social Listening API provides real-time brand mention tracking, competitor intelligence, and automated sentiment scoring across social channels.

***

## 1. Authentication & Scopes

Social listening operations require an API key or OAuth 2.1 access token with `inbox:read` (for listing keywords and querying analytics) and `inbox:write` (for creating, updating, or deleting keyword monitors):

```http theme={null}
Authorization: Bearer YOUR_POSTTU_API_KEY
```

***

## 2. Create a Keyword Monitor

To track mentions of your product, executive names, or competitors, create a monitor using `POST /api/v1/inbox/listening/keywords`:

```bash theme={null}
curl -X POST "https://posttu.com/api/v1/inbox/listening/keywords" \
  -H "Authorization: Bearer YOUR_POSTTU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Posttu Brand Mentions",
    "query": "posttu",
    "negativeKeywords": ["careers", "hiring", "internship"],
    "platforms": ["TWITTER", "REDDIT", "BLUESKY"],
    "color": "#3b82f6",
    "isActive": true
  }'
```

### Parameters

| Parameter | Type | Required | Description |
| :- | :- | :- | :- |
| `name` | `string` | **Yes** | Internal display label for the monitor (1–60 chars). |
| `query` | `string` | **Yes** | Primary search query, hashtag, or brand phrase (1–100 chars). |
| `negativeKeywords` | `string[]` | No | List of terms (up to 10) that automatically exclude a post from results. |
| `platforms` | `string[]` | **Yes** | Social platforms to track: `TWITTER`, `REDDIT`, `BLUESKY`, etc. |
| `color` | `string` | No | Hex color code for UI tag rendering. |
| `isActive` | `boolean` | No | Enable or pause listening ingestion (default: `true`). |

***

## 3. List and Manage Keyword Monitors

Manage your active monitors using standard REST operations:

* `GET /api/v1/inbox/listening/keywords` — List all active monitors in the workspace.
* `GET /api/v1/inbox/listening/keywords/{id}` — Fetch details for a specific monitor.
* `PATCH /api/v1/inbox/listening/keywords/{id}` — Update monitor query, negative keywords, or status.
* `DELETE /api/v1/inbox/listening/keywords/{id}` — Delete a keyword monitor.

***

## 4. Query Real-Time Sentiment Analytics

Retrieve aggregated sentiment classifications, mention velocity, and platform breakdowns using `GET /api/v1/inbox/listening/analytics`:

```bash theme={null}
curl -X GET "https://posttu.com/api/v1/inbox/listening/analytics?days=30&keywordId=kw_123456" \
  -H "Authorization: Bearer YOUR_POSTTU_API_KEY"
```

### Query Parameters

| Parameter | Type | Required | Description |
| :- | :- | :- | :- |
| `days` | `number` | No | Historical time range in days (default: `30`). |
| `keywordId` | `string` | No | Filter analytics to a specific keyword monitor ID. |
| `platform` | `string` | No | Filter analytics to a specific platform. |

### Sample Response:

```json theme={null}
{
  "success": true,
  "data": {
    "days": 30,
    "overview": {
      "totalMentions": 1420,
      "uniqueAuthors": 980,
      "positiveRatio": 0.68,
      "neutralRatio": 0.24,
      "negativeRatio": 0.08
    },
    "breakdowns": {
      "byPlatform": [
        { "platform": "TWITTER", "count": 890 },
        { "platform": "REDDIT", "count": 350 },
        { "platform": "BLUESKY", "count": 180 }
      ]
    },
    "timeSeries": []
  }
}
```

***

## 5. Trigger Automated Workflows on Mentions

Combine Social Listening with Posttu's [Workflow Automation Engine](https://docs.posttu.com/api-reference/workflow/overview.md):

1. **Trigger**: New brand mention detected matching high-intent keywords.
2. **Filter**: Sentiment classified as Positive or High-Intent.
3. **Action**: Dispatch instant notification to a private Slack channel or auto-assign a lead thread to sales in the [Unified Social Inbox](https://docs.posttu.com/api-reference/inbox/overview.md).


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