Webhook Ingress API

Docs
Home Dashboard

Push messages to your chat room from external services, bots, and integrations.

SSN
Using Social Stream Ninja?

Relay SSN chat into NinjaChatter with the room ingress API key, or display a room in an SSN dock. See setup, verification, and limitations below.

Quick Setup

Endpoint

POST /rooms/{room_id}/ingress

Send a message to a chat room via HTTP POST request.

Authentication

Two authentication methods are supported:

1. API Key (Recommended)

Include your room's API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Find your API key in the Dashboard under "Bot & Webhook Integration" for each room.

2. HMAC Signature

Sign the exact request bytes using HMAC-SHA256 with your webhook secret. Encode the digest as Base64, with no sha256= prefix:

X-Chat-Signature: BASE64_HMAC_SHA256

For text-only bots, create a send-only bot key in the dashboard’s Integrations section. Use it in X-API-Key or Authorization: Bearer. It cannot delete messages or mint privileged tokens. See the automation guide for its restricted payload, key management, signing examples, response handling, and retry limitations. Existing SSN ingress keys keep their current permissions.

Request Body

FieldTypeDescription
type*required string Message type. Use "chat" for chat messages.
payload*required object Message payload containing the message data.

Deleting a message

Use the message_id returned by ingress to remove a displayed message. Send the same room authentication as for chat:

{ "type": "delete", "payload": { "target_id": "MESSAGE_ID" } }

The target can also be supplied as a top-level target_id. Chat and WebSocket overlays handle these events and the moderation event delete_message with payload.message_id. Repeating a deletion or targeting a message no longer displayed has no effect.

Payload Fields - Core

FieldTypeDescription
text*required string The message content to display in chat.
displayNameoptional string Display name for the message sender. Defaults to "webhook".
userIdoptional string Unique identifier for the sender.
avataroptional string URL to the sender's avatar image.
sourceoptional string Platform name (e.g., "youtube", "twitch", "discord").
sourceIconoptional string URL to an icon representing the source platform.

Payload Fields - Badges

FieldTypeDescription
badgesoptional array Array of badge objects. Each badge can have: src (image URL), type ("img" or "svg"), html (SVG markup).
isModeratoroptional boolean Whether the sender is a moderator.
nameColoroptional string CSS color for the display name.

Payload Fields - Donations

FieldTypeDescription
donationoptional string Donation amount as displayed (e.g., "$5.00", "500 bits").
donationValueoptional number Numeric donation value for sorting/filtering.
backgroundColoroptional string Background color for Super Chat style messages.
textColoroptional string Text color for Super Chat style messages.

Payload Fields - Memberships

FieldTypeDescription
membershipoptional string Membership status or tier (e.g., "MEMBER", "Tier 1 Sub").
subtitleoptional string Additional membership info (e.g., "12 months", "Gifted by User").

Payload Fields - Events

FieldTypeDescription
eventoptional string Event type: "follow", "raid", "subscription", "giftpurchase", "sponsorship", etc.
titleoptional string Event title or label.

Payload Fields - Additional

FieldTypeDescription
contentImageoptional string URL to content image (stickers, emotes, etc.).
replyTooptional string Name of user being replied to.
replyTextoptional string Text of message being replied to.
sourceNameoptional string Channel or stream name.
sourceImageoptional string Channel thumbnail or logo URL.

Top-Level Meta Field

In addition to the payload object, you can include a top-level meta field for custom data:

{
  "type": "chat",
  "payload": { ... },
  "meta": {
    "customField": "value",
    "anyOtherData": 123
  }
}

The meta field passes through to connected clients unchanged, useful for custom integrations.

Examples

Simple Message

curl -X POST "https://api.ninjachatter.com/rooms/YOUR_ROOM_ID/ingress" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "chat",
    "payload": {
      "text": "Hello from my bot!"
    }
  }'

Message with User Info

curl -X POST "https://api.ninjachatter.com/rooms/YOUR_ROOM_ID/ingress" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "chat",
    "payload": {
      "text": "Check out this stream!",
      "displayName": "StreamBot",
      "userId": "bot-123",
      "source": "twitch",
      "sourceIcon": "https://example.com/twitch-icon.png",
      "avatar": "https://example.com/bot-avatar.png"
    }
  }'

Super Chat / Donation

curl -X POST "https://api.ninjachatter.com/rooms/YOUR_ROOM_ID/ingress" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "chat",
    "payload": {
      "text": "Great stream! Keep it up!",
      "displayName": "GenerousViewer",
      "userId": "viewer-456",
      "source": "youtube",
      "donation": "$10.00",
      "donationValue": 10.00,
      "backgroundColor": "#1565c0",
      "textColor": "#ffffff"
    }
  }'

Event (Raid, Follow, etc.)

curl -X POST "https://api.ninjachatter.com/rooms/YOUR_ROOM_ID/ingress" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "event",
    "payload": {
      "text": "",
      "displayName": "BigStreamer",
      "event": "raid",
      "title": "RAID",
      "subtitle": "123 viewers"
    }
  }'

Response

StatusBodyDescription
202 queued Message accepted and queued for delivery.
202 filtered Message was filtered (blocked by bad word filter).
401 Unauthorized Invalid or missing API key.
400 Bad Request Invalid JSON payload.
404 Not Found Room does not exist.

Social Stream Ninja Integration

Social Stream Ninja has built-in support for Ninja Chatter. Push messages from YouTube, Twitch, TikTok, and 30+ platforms directly to your chat room with just a few clicks.

This integration allows you to consolidate chat from all your streaming platforms into one unified, shareable chat experience for your audience.

SSN → NinjaChatter: relay incoming chat

  1. Get your API Key from Ninja Chatter:
    • Go to Dashboard and create or select a room
    • Expand "Integrations" section
    • In the Social Stream Ninja panel, click Copy Key. This is the room ingress API key, not the send-only bot key, webhook secret, or your SSN session ID.
  2. Enable in Social Stream Ninja:
    • Open SSN extension popup
    • Find "Send messages to Ninja Chatter" toggle and enable it
    • Paste it into the adjacent Ingress API Key field. The key selects the room; no room ID or custom API URL is needed for the built-in relay.
    • Keep SSN running and capturing a source. Send a new ordinary text message on that source, then confirm the author and text appear in your NinjaChatter room.

Share with Your Audience

Once connected, share your chat link with viewers:

https://ninjachatter.com/YOUR_ROOM_ID

Viewers do not need the SSN extension. Joining and sending chat follow the room’s guest/provider settings. A public read-only overlay requires the room to be enabled and Allow read-only stream access to be on; guest access is a separate setting.

NinjaChatter → SSN: display a room

To show this room in an SSN dock, use the SSN-format read-only stream and dock URL. This connects the dock directly to NinjaChatter. It does not import a source into the SSN extension, merge an existing SSN session, or send replies back to Twitch/YouTube. Use NinjaChatter’s normal chat page when viewers should participate.

Verify and troubleshoot

Keep the ingress key in your private SSN configuration or integration backend, never in an overlay URL or public page. SSN exports may contain it. For a custom text-only bot, prefer the restricted send-only bot key.

Built-in relay HTTP contract

POST https://api.ninjachatter.com/ssn takes Authorization: Bearer ROOM_INGRESS_API_KEY, Content-Type: application/json, and the envelope below. The key identifies the destination room. This endpoint does not accept a send-only bot key, JWT, or HMAC signature in place of the ingress key. The request body limit is 65,536 bytes. Check every HTTP response; do not automatically retry an ambiguous publication because repeated requests can duplicate messages.

{
  "type": "chat",
  "payload": {
    "text": "Hello from SSN",
    "displayName": "Example viewer",
    "userId": "example-viewer-1",
    "source": "youtube"
  }
}

The built-in adapter converts SSN messages to this envelope; posting a raw SSN row is not the same contract. Its usual relay path forwards chat text, not every SSN event. HTML chat content is cleaned to text. Rich fields are supported selectively and are not guaranteed to survive every downstream display; the SSN read-only adapter is a smaller format than the ingress payload.

Advanced: Custom HTTP Integration

For developers building custom integrations or needing more control, you can send messages directly via HTTP POST:

Show manual setup instructions
  1. Create an HTTP POST request to: https://api.ninjachatter.com/rooms/YOUR_ROOM_ID/ingress
  2. Add headers:
    • Authorization: Bearer YOUR_API_KEY
    • Content-Type: application/json
  3. Send the payload:
    {
      "type": "chat",
      "payload": {
        "text": "{message}",
        "displayName": "{author}",
        "userId": "{authorId}",
        "source": "{platform}",
        "avatar": "{authorPhoto}"
      }
    }

SSN Field Mapping Reference

The braces above are illustrative placeholders, not an SSN template language. Map actual SSN fields in your adapter:

SSN FieldMaps ToDescription
chatmessagepayload.textThe chat message content
chatnamepayload.displayNameUsername of the sender
useridpayload.userIdUnique user identifier
typepayload.sourcePlatform name (youtube, twitch, etc.)
chatimgpayload.avatarUser's profile picture URL

Content Filtering & Moderation

Messages sent via webhook ingress are subject to the same filtering and moderation as regular chat messages.

Bad Word Filter

When enabled in room settings, the bad word filter automatically blocks messages containing inappropriate content:

To enable: Dashboard → Room Settings → "Enable chat filter"

Moderation Actions

Room moderators can take action on webhook users just like regular users:

Rate Limits

LimitValueScope
Messages per user20 / 10 secondsPer user ID
Messages per IP60 / 10 secondsPer source IP
Message size64 KB maxPer message

Security Best Practices

Related Documentation

Need Help?

If you have questions or need assistance with your integration: