Post messages into Snook topics from external services (CI/CD, monitoring, GitHub webhooks, custom bots) using API keys.
Bot messages appear in the message flow with a BOT badge and support text formatting.
The integration API requires a community ID (for key management) and a topic ID (for posting messages). Both are visible in the Snook URL when you open a topic in the browser:
https://your-app/w/{communityId}/c/{topicId}
For example, in https://snook.app/w/mJTLP72z7kM86sDR2EdG/c/AYittVTgjtlBxhjwBxst:
mJTLP72z7kM86sDR2EdGAYittVTgjtlBxhjwBxstCopy these from the URL bar and provide them to your integration when configuring it.
1. Create an API key (requires community admin role):
curl -X POST https://your-api/api/v1/communities/{communityId}/api-keys \
-H "Authorization: Bearer {firebase-token}" \
-H "Content-Type: application/json" \
-d '{"name": "Deploy Bot"}'
Response includes the raw API key (shown once, save it):
{
"id": "abc123",
"name": "Deploy Bot",
"key": "snk_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
"keyPrefix": "snk_a1b2",
"createdAt": "..."
}
2. Post a message:
curl -X POST https://your-api/api/v1/integrations/topics/{topicId}/messages \
-H "Authorization: Bearer snk_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4" \
-H "Content-Type: application/json" \
-d '{"text": "Deploy succeeded for commit abc123"}'
The integration API uses API keys, separate from Firebase user tokens.
snk_ prefix + 32 hex characters (e.g., snk_0786b94f3b37bc50d017e0827a4d4d4f)Authorization: Bearer snk_...These endpoints require Firebase user authentication and community admin/owner role.
POST /api/v1/communities/{communityId}/api-keys
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | Display name for the bot (1-50 chars) |
Response (201):
{
"id": "S2XSQf01ktHBKGJu5pT7",
"name": "GitHub Bot",
"key": "snk_0786b94f3b37bc50d017e0827a4d4d4f",
"keyPrefix": "snk_0786",
"createdAt": { "_seconds": 1775763085, "_nanoseconds": 950000000 }
}
GET /api/v1/communities/{communityId}/api-keys
Returns all keys for the community. Raw keys and hashes are never included.
Response (200):
{
"keys": [
{
"id": "S2XSQf01ktHBKGJu5pT7",
"name": "GitHub Bot",
"keyPrefix": "snk_0786",
"createdAt": "...",
"lastUsedAt": "...",
"revokedAt": null
}
]
}
DELETE /api/v1/communities/{communityId}/api-keys/{keyId}
Soft-deletes the key. Any subsequent requests using this key will return 401.
Response: 204 No Content
POST /api/v1/integrations/topics/{topicId}/messages
Authenticated with an API key (not a Firebase token).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
text | string | yes | Message content (1-4000 chars) | |
format | string | no | "plain" | "plain" or "markdown" |
When format is "markdown", standard Markdown is converted to Snook's internal format before storage:
| You send | Stored & rendered as |
|---|---|
**bold** | bold |
*italic* | italic |
~~strikethrough~~ | |
`code` | code |
``` code blocks | code blocks |
- list item | bullet lists |
When format is "plain" (default), the text is stored as-is. You can also use Snook's native formatting directly: *bold*, _italic_, ~strikethrough~.
{
"id": "jryx6wpnveCid40cuIlY",
"topicId": "AYittVTgjtlBxhjwBxst",
"content": "Deploy *succeeded* for _commit abc123_",
"createdAt": { "_seconds": 1775763099, "_nanoseconds": 329000000 }
}
| Status | Meaning |
|---|---|
| 400 | Missing or invalid text field |
| 401 | Missing, invalid, or revoked API key |
| 403 | Topic does not belong to this key's community |
| 404 | Topic not found |
| 422 | Topic is archived |
| 429 | Rate limit exceeded |
name fieldlastMessageAt (they appear in "recent activity")