serpent-chat API (0.1.0)

Download OpenAPI specification:

Register a new user

Request Body schema: application/json
required
email
required
string <email>
username
required
string [ 3 .. 32 ] characters
displayName
required
string [ 1 .. 64 ] characters
password
required
string >= 8 characters

Responses

Request samples

Content type
application/json
{
  • "email": "user@example.com",
  • "username": "string",
  • "displayName": "string",
  • "password": "stringst"
}

Response samples

Content type
application/json
{
  • "token": "string",
  • "user": {
    }
}

Refresh the current auth token

Authorizations:
bearerAuthcookieAuth

Responses

Response samples

Content type
application/json
{
  • "token": "string",
  • "user": {
    }
}

Logout and clear auth cookie

Authorizations:
bearerAuthcookieAuth

Responses

Response samples

Content type
application/json
{
  • "error": "string"
}

Login with email and password

Request Body schema: application/json
required
email
required
string <email>
password
required
string

Responses

Request samples

Content type
application/json
{
  • "email": "user@example.com",
  • "password": "string"
}

Response samples

Content type
application/json
{
  • "token": "string",
  • "user": {
    }
}

Get public runtime configuration

Responses

Response samples

Content type
application/json
{
  • "livekitUrl": "string"
}

Health check

Responses

Response samples

Content type
application/json
{
  • "status": "ok",
  • "error": "string"
}

List all users except the current user

Authorizations:
bearerAuthcookieAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List all direct message conversations for the current user

Authorizations:
bearerAuthcookieAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Open or find a direct message conversation with a user

Authorizations:
bearerAuthcookieAuth
Request Body schema: application/json
required
userId
required
string <uuid>

Responses

Request samples

Content type
application/json
{
  • "userId": "2c4a230c-5085-4924-a3e1-25fb4fc5965b"
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "otherUser": {
    },
  • "unreadCount": 0,
  • "createdAt": "2019-08-24T14:15:22Z"
}

Create a channel

Authorizations:
bearerAuthcookieAuth
Request Body schema: application/json
required
name
required
string [ 1 .. 64 ] characters
description
string
isPublic
boolean
Default: true
isVoice
boolean
Default: false

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "isPublic": true,
  • "isVoice": false
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "name": "string",
  • "description": "string",
  • "isPublic": true,
  • "isVoice": true,
  • "isDm": true,
  • "createdBy": "25a02396-1048-48f9-bf93-102d2fb7895e",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "isMember": true,
  • "unreadCount": 0
}

List channels

Authorizations:
bearerAuthcookieAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List channels the current user is a member of

Authorizations:
bearerAuthcookieAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get a channel

Authorizations:
bearerAuthcookieAuth
path Parameters
channelId
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "name": "string",
  • "description": "string",
  • "isPublic": true,
  • "isVoice": true,
  • "isDm": true,
  • "createdBy": "25a02396-1048-48f9-bf93-102d2fb7895e",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "isMember": true,
  • "unreadCount": 0
}

Update a channel

Authorizations:
bearerAuthcookieAuth
path Parameters
channelId
required
string <uuid>
Request Body schema: application/json
required
name
string [ 1 .. 64 ] characters
description
string

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string"
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "name": "string",
  • "description": "string",
  • "isPublic": true,
  • "isVoice": true,
  • "isDm": true,
  • "createdBy": "25a02396-1048-48f9-bf93-102d2fb7895e",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "isMember": true,
  • "unreadCount": 0
}

Delete a channel

Authorizations:
bearerAuthcookieAuth
path Parameters
channelId
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "error": "string"
}

Join a public channel

Authorizations:
bearerAuthcookieAuth
path Parameters
channelId
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "channelId": "5f6d08bc-455a-4532-98b8-19e2cee51160",
  • "userId": "2c4a230c-5085-4924-a3e1-25fb4fc5965b",
  • "role": "owner",
  • "joinedAt": "2019-08-24T14:15:22Z",
  • "lastReadAt": "2019-08-24T14:15:22Z",
  • "username": "string",
  • "displayName": "string",
  • "email": "string"
}

List channel members

Authorizations:
bearerAuthcookieAuth
path Parameters
channelId
required
string <uuid>

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Add a member to a channel

Authorizations:
bearerAuthcookieAuth
path Parameters
channelId
required
string <uuid>
Request Body schema: application/json
required
userId
required
string <uuid>
role
string (ChannelRole)
Enum: "owner" "admin" "member" "guest"

Responses

Request samples

Content type
application/json
{
  • "userId": "2c4a230c-5085-4924-a3e1-25fb4fc5965b",
  • "role": "owner"
}

Response samples

Content type
application/json
{
  • "channelId": "5f6d08bc-455a-4532-98b8-19e2cee51160",
  • "userId": "2c4a230c-5085-4924-a3e1-25fb4fc5965b",
  • "role": "owner",
  • "joinedAt": "2019-08-24T14:15:22Z",
  • "lastReadAt": "2019-08-24T14:15:22Z",
  • "username": "string",
  • "displayName": "string",
  • "email": "string"
}

Transfer channel ownership to another member

Authorizations:
bearerAuthcookieAuth
path Parameters
channelId
required
string <uuid>
Request Body schema: application/json
required
userId
required
string <uuid>

Responses

Request samples

Content type
application/json
{
  • "userId": "2c4a230c-5085-4924-a3e1-25fb4fc5965b"
}

Response samples

Content type
application/json
{
  • "channelId": "5f6d08bc-455a-4532-98b8-19e2cee51160",
  • "userId": "2c4a230c-5085-4924-a3e1-25fb4fc5965b",
  • "role": "owner",
  • "joinedAt": "2019-08-24T14:15:22Z",
  • "lastReadAt": "2019-08-24T14:15:22Z",
  • "username": "string",
  • "displayName": "string",
  • "email": "string"
}

Remove a member from a channel

Authorizations:
bearerAuthcookieAuth
path Parameters
channelId
required
string <uuid>
userId
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "error": "string"
}

Update a member's role

Authorizations:
bearerAuthcookieAuth
path Parameters
channelId
required
string <uuid>
userId
required
string <uuid>
Request Body schema: application/json
required
role
required
string (ChannelRole)
Enum: "owner" "admin" "member" "guest"

Responses

Request samples

Content type
application/json
{
  • "role": "owner"
}

Response samples

Content type
application/json
{
  • "channelId": "5f6d08bc-455a-4532-98b8-19e2cee51160",
  • "userId": "2c4a230c-5085-4924-a3e1-25fb4fc5965b",
  • "role": "owner",
  • "joinedAt": "2019-08-24T14:15:22Z",
  • "lastReadAt": "2019-08-24T14:15:22Z",
  • "username": "string",
  • "displayName": "string",
  • "email": "string"
}

Get a LiveKit token to join a voice channel

Authorizations:
bearerAuthcookieAuth
path Parameters
channelId
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "token": "string"
}

Get current voice presence for a channel

Authorizations:
bearerAuthcookieAuth
path Parameters
channelId
required
string <uuid>

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Signal joining a voice channel

Authorizations:
bearerAuthcookieAuth
path Parameters
channelId
required
string <uuid>
Request Body schema: application/json
required
muted
required
boolean
deafened
required
boolean

Responses

Request samples

Content type
application/json
{
  • "muted": true,
  • "deafened": true
}

Response samples

Content type
application/json
{
  • "error": "string"
}

Signal leaving a voice channel

Authorizations:
bearerAuthcookieAuth
path Parameters
channelId
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "error": "string"
}

Update mute/deafen state in a voice channel

Authorizations:
bearerAuthcookieAuth
path Parameters
channelId
required
string <uuid>
Request Body schema: application/json
required
muted
required
boolean
deafened
required
boolean

Responses

Request samples

Content type
application/json
{
  • "muted": true,
  • "deafened": true
}

Response samples

Content type
application/json
{
  • "error": "string"
}

Refresh voice presence TTL

Authorizations:
bearerAuthcookieAuth
path Parameters
channelId
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "error": "string"
}

Stream new messages via Server-Sent Events

Opens a persistent SSE connection. Each event has type message and a JSON-encoded Message object as its data. Implemented as a manual Gin route — not generated from this spec.

Authorizations:
bearerAuthcookieAuth
path Parameters
channelId
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "error": "string"
}

Mark channel as read

Authorizations:
bearerAuthcookieAuth
path Parameters
channelId
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "error": "string"
}

Get messages in a channel

Authorizations:
bearerAuthcookieAuth
path Parameters
channelId
required
string <uuid>
query Parameters
before
string <date-time>
limit
integer
Default: 50

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Post a message to a channel

Authorizations:
bearerAuthcookieAuth
path Parameters
channelId
required
string <uuid>
Request Body schema: application/json
required
content
required
string non-empty
parentId
string <uuid>

Responses

Request samples

Content type
application/json
{
  • "content": "string",
  • "parentId": "70850378-7d3c-4f45-91b7-942d4dfbbd43"
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "channelId": "5f6d08bc-455a-4532-98b8-19e2cee51160",
  • "userId": "2c4a230c-5085-4924-a3e1-25fb4fc5965b",
  • "displayName": "string",
  • "parentId": "70850378-7d3c-4f45-91b7-942d4dfbbd43",
  • "content": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "replyCount": 0,
  • "editedAt": "2019-08-24T14:15:22Z",
  • "reactions": [ ]
}

Delete a message

Authorizations:
bearerAuthcookieAuth
path Parameters
channelId
required
string <uuid>
messageId
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "error": "string"
}

Update a message's content

Authorizations:
bearerAuthcookieAuth
path Parameters
channelId
required
string <uuid>
messageId
required
string <uuid>
Request Body schema: application/json
required
content
required
string non-empty

Responses

Request samples

Content type
application/json
{
  • "content": "string"
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "channelId": "5f6d08bc-455a-4532-98b8-19e2cee51160",
  • "userId": "2c4a230c-5085-4924-a3e1-25fb4fc5965b",
  • "displayName": "string",
  • "parentId": "70850378-7d3c-4f45-91b7-942d4dfbbd43",
  • "content": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "replyCount": 0,
  • "editedAt": "2019-08-24T14:15:22Z",
  • "reactions": [ ]
}

Upload a file to a channel

Authorizations:
bearerAuthcookieAuth
path Parameters
channelId
required
string <uuid>
Request Body schema: multipart/form-data
required
file
required
string <binary>

Responses

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "channelId": "5f6d08bc-455a-4532-98b8-19e2cee51160",
  • "filename": "string",
  • "contentType": "string",
  • "size": 0,
  • "uploadedBy": "1e2815fd-75c7-4289-86d5-2503daeb59b8",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "url": "string"
}

Get replies to a message

Authorizations:
bearerAuthcookieAuth
path Parameters
channelId
required
string <uuid>
messageId
required
string <uuid>
query Parameters
before
string <date-time>
limit
integer
Default: 50

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Add a reaction to a message

Authorizations:
bearerAuthcookieAuth
path Parameters
channelId
required
string <uuid>
messageId
required
string <uuid>
emoji
required
string

Responses

Response samples

Content type
application/json
{
  • "error": "string"
}

Remove a reaction from a message

Authorizations:
bearerAuthcookieAuth
path Parameters
channelId
required
string <uuid>
messageId
required
string <uuid>
emoji
required
string

Responses

Response samples

Content type
application/json
{
  • "error": "string"
}

Create an invite link for a private channel

Authorizations:
bearerAuthcookieAuth
path Parameters
channelId
required
string <uuid>
Request Body schema: application/json
required
expiresIn
string (InviteExpiry)
Enum: "1h" "24h" "7d" "30d"

Responses

Request samples

Content type
application/json
{
  • "expiresIn": "1h"
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "channelId": "5f6d08bc-455a-4532-98b8-19e2cee51160",
  • "createdBy": "25a02396-1048-48f9-bf93-102d2fb7895e",
  • "expiresAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z"
}

List invite links for a channel

Authorizations:
bearerAuthcookieAuth
path Parameters
channelId
required
string <uuid>

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Revoke an invite link

Authorizations:
bearerAuthcookieAuth
path Parameters
channelId
required
string <uuid>
inviteId
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "error": "string"
}

Get invite details (channel info + membership status)

Authorizations:
bearerAuthcookieAuth
path Parameters
inviteCode
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "invite": {
    },
  • "channel": {
    },
  • "alreadyMember": true
}

Join a channel via invite link

Authorizations:
bearerAuthcookieAuth
path Parameters
inviteCode
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "channelId": "5f6d08bc-455a-4532-98b8-19e2cee51160",
  • "userId": "2c4a230c-5085-4924-a3e1-25fb4fc5965b",
  • "role": "owner",
  • "joinedAt": "2019-08-24T14:15:22Z",
  • "lastReadAt": "2019-08-24T14:15:22Z",
  • "username": "string",
  • "displayName": "string",
  • "email": "string"
}

Get the VAPID public key for Web Push

Responses

Response samples

Content type
application/json
{
  • "publicKey": "string"
}

Register a push subscription for the current user

Authorizations:
bearerAuthcookieAuth
Request Body schema: application/json
required
endpoint
required
string
p256dh
required
string
auth
required
string

Responses

Request samples

Content type
application/json
{
  • "endpoint": "string",
  • "p256dh": "string",
  • "auth": "string"
}

Response samples

Content type
application/json
{
  • "error": "string"
}

Remove a push subscription for the current user

Authorizations:
bearerAuthcookieAuth
Request Body schema: application/json
required
endpoint
required
string

Responses

Request samples

Content type
application/json
{
  • "endpoint": "string"
}

Response samples

Content type
application/json
{
  • "error": "string"
}

List all custom emoji

Authorizations:
bearerAuthcookieAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Upload a custom emoji

Authorizations:
bearerAuthcookieAuth
Request Body schema: multipart/form-data
required
name
required
string

Emoji name (e.g., "serpent_hype")

image
required
string <binary>

Image file (PNG, JPG, GIF, etc.)

Responses

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "name": "string",
  • "imageUrl": "string",
  • "createdBy": "25a02396-1048-48f9-bf93-102d2fb7895e",
  • "createdAt": "2019-08-24T14:15:22Z"
}

Delete a custom emoji (creator or admin only)

Authorizations:
bearerAuthcookieAuth
path Parameters
emojiId
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "error": "string"
}