Webhook Ingress API

Docs
Back to Dashboard

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

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 request body using HMAC-SHA256 with your webhook secret:

X-Chat-Signature: sha256=COMPUTED_SIGNATURE

Request Body

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

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 can push messages from multiple platforms (YouTube, Twitch, TikTok, etc.) directly to your chat room.

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

Setup Instructions

  1. Open Social Stream Ninja extension settings
  2. Navigate to the Custom Actions or API Integration section
  3. Add a new HTTP POST action with:
    • URL: https://api.ninjachatter.com/rooms/YOUR_ROOM_ID/ingress
    • Header: Authorization: Bearer YOUR_API_KEY
    • Content-Type: application/json
  4. Map the SSN message fields to the payload format:
    {
      "type": "chat",
      "payload": {
        "text": "{message}",
        "displayName": "{author}",
        "userId": "{authorId}",
        "source": "{platform}",
        "avatar": "{authorPhoto}"
      }
    }

SSN Field Mapping

SSN FieldMaps ToDescription
{message}payload.textThe chat message content
{author}payload.displayNameUsername of the sender
{authorId}payload.userIdUnique user identifier
{platform}payload.sourcePlatform name (youtube, twitch, etc.)
{authorPhoto}payload.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: