Push messages to your chat room from external services, bots, and integrations.
POST /rooms/{room_id}/ingress
Send a message to a chat room via HTTP POST request.
Two authentication methods are supported:
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.
Sign the request body using HMAC-SHA256 with your webhook secret:
X-Chat-Signature: sha256=COMPUTED_SIGNATURE
| Field | Type | Description |
|---|---|---|
type*required |
string | Message type. Use "chat" for chat messages. |
payload*required |
object | Message payload containing the message data. |
| Field | Type | Description |
|---|---|---|
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. |
| Field | Type | Description |
|---|---|---|
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. |
| Field | Type | Description |
|---|---|---|
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. |
| Field | Type | Description |
|---|---|---|
membershipoptional |
string | Membership status or tier (e.g., "MEMBER", "Tier 1 Sub"). |
subtitleoptional |
string | Additional membership info (e.g., "12 months", "Gifted by User"). |
| Field | Type | Description |
|---|---|---|
eventoptional |
string | Event type: "follow", "raid", "subscription", "giftpurchase", "sponsorship", etc. |
titleoptional |
string | Event title or label. |
| Field | Type | Description |
|---|---|---|
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. |
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.
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!"
}
}'
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"
}
}'
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"
}
}'
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"
}
}'
| Status | Body | Description |
|---|---|---|
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 can push messages from multiple platforms (YouTube, Twitch, TikTok, etc.) directly to your chat room.
https://api.ninjachatter.com/rooms/YOUR_ROOM_ID/ingressAuthorization: Bearer YOUR_API_KEYapplication/json{
"type": "chat",
"payload": {
"text": "{message}",
"displayName": "{author}",
"userId": "{authorId}",
"source": "{platform}",
"avatar": "{authorPhoto}"
}
}
| SSN Field | Maps To | Description |
|---|---|---|
{message} | payload.text | The chat message content |
{author} | payload.displayName | Username of the sender |
{authorId} | payload.userId | Unique user identifier |
{platform} | payload.source | Platform name (youtube, twitch, etc.) |
{authorPhoto} | payload.avatar | User's profile picture URL |
Messages sent via webhook ingress are subject to the same filtering and moderation as regular chat messages.
When enabled in room settings, the bad word filter automatically blocks messages containing inappropriate content:
202 filtered statusTo enable: Dashboard → Room Settings → "Enable chat filter"
Room moderators can take action on webhook users just like regular users:
| Limit | Value | Scope |
|---|---|---|
| Messages per user | 20 / 10 seconds | Per user ID |
| Messages per IP | 60 / 10 seconds | Per source IP |
| Message size | 64 KB max | Per message |
If you have questions or need assistance with your integration: