This document summarizes the HTTP API exposed by narubox-bot. The implementation is defined in the routing modules under the Kotlin source tree and the OpenAPI document at src/main/resources/openapi/documentation.yaml.
- Local development: http://localhost:8080
- Production: the origin configured for the deployment environment
Most bot-management endpoints require a JWT bearer token.
Headers:
Authorization: Bearer <jwt-token>
Content-Type: application/json- Register a user with POST /api/v1/auth/user.
- If mail verification is enabled, open the verification URL sent by email.
- Log in with POST /api/v1/auth/login to receive a JWT token.
Create a new user account.
Request body:
{
"username": "example-user",
"mail": "user@example.com",
"password": "secret-password"
}Responses:
- 201 Created: account created successfully
- 400/500: invalid input or registration failure
Verify an email-based registration token.
Query parameters:
- token: verification token sent by mail
Responses:
- 200 OK: verification succeeded
- 400 Bad Request: missing token
- 403 Forbidden: invalid or expired token
Authenticate an existing user and return a JWT.
Request body:
{
"username": "example-user",
"password": "secret-password"
}Responses:
- 200 OK: returns a token object
{
"token": "<jwt-token>"
}- 401 Unauthorized: invalid credentials
- 403 Forbidden: email verification is still pending
Get the authenticated user's profile information.
Authentication: required
Responses:
- 200 OK: returns the user profile
{
"mail": "user@example.com",
"username": "example-user",
"createdAt": "2026-06-29T12:00:00",
"lastAccess": null
}List bots owned by the authenticated user.
Authentication: required
Responses:
- 200 OK: list of bot summaries
[
{
"botID": "<uuid>",
"label": "My Discord Bot",
"mentionRoleID": "123456789"
}
]Register a new bot for the authenticated user.
Authentication: required
Request body:
{
"botLabel": "My Discord Bot",
"wsUrl": "https://example.com/webhook",
"mentionRoleID": "123456789"
}Responses:
- 202 Accepted: registration succeeded
- 400 Bad Request: registration failed
Get a specific bot and the channels subscribed to it.
Authentication: required
Path parameters:
- botID: bot identifier
Responses:
- 200 OK: bot details and subscribed channels
{
"botInfo": {
"botID": "<uuid>",
"label": "My Discord Bot",
"mentionRoleID": "123456789"
},
"channels": [
"UC1234567890"
]
}Subscribe a YouTube channel to a bot.
Authentication: required
Path parameters:
- botID: bot identifier
Request body:
{
"channelID": "UC1234567890",
"refresh": false
}Responses:
- 202 Accepted: subscription succeeded
- 400 Bad Request: subscription failed
Unregister a bot.
Authentication: required
Path parameters:
- botID: bot identifier
Responses:
- 202 Accepted: bot removed
- 400 Bad Request: invalid request
Unsubscribe a channel from a bot.
Authentication: required
Path parameters:
- botID: bot identifier
- channelID: subscribed channel identifier
Responses:
- 202 Accepted: unsubscribe succeeded
- 400 Bad Request: invalid request
PubSubHubbub challenge endpoint used during subscription verification.
Query parameters:
- hub.challenge: challenge value returned by the hub
Responses:
- 200 OK: returns the challenge value as plain text
- 400 Bad Request: missing challenge parameter
Receive PubSubHubbub XML notifications from YouTube.
Path parameters:
- endpointID: endpoint identifier generated for the channel subscription
Request body:
- XML feed body from YouTube PubSubHubbub
Responses:
- 200 OK: notification accepted
Returns a fun response string.
Responses:
- 202 Accepted
Returns a fun response string.
Responses:
- 202 Accepted
{
"username": "string",
"mail": "user@example.com",
"password": "string"
}{
"username": "string",
"password": "string"
}{
"botLabel": "string",
"wsUrl": "string",
"mentionRoleID": "string"
}{
"channelID": "string",
"refresh": false
}{
"mail": "string",
"username": "string",
"createdAt": "datetime",
"lastAccess": "datetime|null"
}- The server uses JWT-based authentication for protected endpoints.
- The PubSubHubbub callback path is generated automatically for each subscribed channel.
- The OpenAPI document is available at src/main/resources/openapi/documentation.yaml and can be used with Swagger UI or Redoc.