Skip to content
Cloudtifact docs

Discord API

Discord channels that follow a workspace, and the routes the Discord bot calls for them.

All paths are relative to the API origin. Send Authorization: Bearer <token> unless a route says otherwise; see the API overview for tokens and errors.

GET /v1/workspaces/:slug/discord

Members; the Discord channels that follow this workspace

Response

FieldTypeRequiredNotes
channelsobject[]yes
spacesobject[]no

PUT /v1/workspaces/:slug/discord/:channelId

Admin+; changes what the channel follows in this workspace

Body

FieldTypeRequiredNotes
spaceIdsstring[] | nullyes

Response: 204, no body

DELETE /v1/workspaces/:slug/discord/:channelId

Admin+; the channel stops following this workspace

Response: 204, no body

GET /v1/discord/connects/:userCode

Clerk session only; a /cloudtifact request from a Discord channel, and your workspaces to share with it

Response

FieldTypeRequiredNotes
userCodestringyes
status"pending" | "approved" | "denied" | "expired"yes
expiresAtnumberyes
guildNamestringyes
channelNamestringyes
askedBystringyes
workspacesobject[]yes
othersobject[]yes

POST /v1/discord/connects/:userCode/decide

Clerk session only; approving sets what the channel follows in the workspaces you administer

Body

FieldTypeRequiredNotes
approvebooleanyes
workspacesobject[]no (default [])

Response: 204, no body

POST /v1/discord/connects

Bot only (DISCORD_BOT_HEADER; 404 without it)

Body

FieldTypeRequiredNotes
guildIdstringyes
guildNamestringyes
channelIdstringyes
channelNamestringyes
userobjectyes

Response

FieldTypeRequiredNotes
userCodestringyes
urlstringyes
expiresInintegeryes

GET /v1/discord/channels/:channelId

Bot only

Response

FieldTypeRequiredNotes
connectedbooleanyes
workspacesobject[]yes

DELETE /v1/discord/channels/:channelId

Bot only; disconnects the channel from everything

Body

FieldTypeRequiredNotes
userobjectyes

Response: 204, no body

GET /v1/discord/channels/:channelId/spaces

Bot only; the spaces the channel follows, newest version first

Query

FieldTypeRequiredNotes
qstringno
limitintegerno (default 25)

Response

FieldTypeRequiredNotes
spacesobject[]yes

GET /v1/discord/channels/:channelId/spaces/:id/threads

Bot only; a followed space's open threads, and its home

Response

FieldTypeRequiredNotes
spaceobjectyes
linkedstring[]yes
homeobject | nullyes
threadsobject[]yes

POST /v1/discord/channels/:channelId/spaces/:id/home

Bot only; the followed space's news goes to this channel only

Body

FieldTypeRequiredNotes
userobjectyes

Response

FieldTypeRequiredNotes
spaceobjectyes
previousobject | nullyes

POST /v1/discord/channels/:channelId/main

Bot only; the main channel of every workspace it follows: spaces without a home post here

Body

FieldTypeRequiredNotes
userobjectyes

Response

FieldTypeRequiredNotes
workspacesstring[]yes

GET /v1/discord/channels/:channelId/info

Bot only; the spaces linked to a thread, the spaces that post in this channel, and how many post elsewhere

Query

FieldTypeRequiredNotes
threadIdstringno

Response

FieldTypeRequiredNotes
threadobject[]yes
hereobject[]yes
hereTotalintegeryes
mainintegeryes
elsewhereintegeryes

POST /v1/discord/channels/:channelId/comments

Bot only; a comment written in Discord, as a guest named after the Discord user, via "discord"

Body

FieldTypeRequiredNotes
spaceIdstringyes
parentIdstringno
bodystringyes
authorobjectyes

Response

FieldTypeRequiredNotes
idstringyes
threadIdstringyes
spaceIdstringyes

POST /v1/discord/channels/:channelId/comments/:id/resolve

Bot only; resolves a thread on a followed space

Body

FieldTypeRequiredNotes
userobjectyes

Response: 204, no body

POST /v1/discord/channels/:channelId/links

Bot only; links a thread (or the channel) to a followed space and makes it the space's home

Body

FieldTypeRequiredNotes
spaceIdstringyes
threadIdstringyes
threadNamestringyes
userobjectyes

Response

FieldTypeRequiredNotes
spaceobjectyes
previousobject | nullyes

POST /v1/discord/channels/:channelId/spaces

Bot only; makes an empty members-only space in the channel's first workspace, with the thread linked as its home (20 a day per channel). A thread that already has a space gets that one back, with existing: true

Body

FieldTypeRequiredNotes
namestringyes
threadIdstringyes
threadNamestringyes
userobjectyes

Response

FieldTypeRequiredNotes
spaceobjectyes
existingbooleanyes

Bot only; unlinks it; if it was the space's home, the space posts in the main channel again

Body

FieldTypeRequiredNotes
spaceIdstringyes
threadIdstringyes
threadNamestringyes
userobjectyes

Response: 204, no body

GET /v1/spaces/:id/discord

Push access; the Discord threads linked to this space

Response

FieldTypeRequiredNotes
linksobject[]yes

GET /v1/spaces/:id/discord/:threadId

Push access; the linked thread's messages, read from Discord now and not stored; + liveUrl

Query

FieldTypeRequiredNotes
all"1" | "true"no

Response

FieldTypeRequiredNotes
linkobjectyes
messagesobject[]yes
morebooleanyes
liveUrlstringno

DELETE /v1/spaces/:id/discord/:threadId

Push access; unlinks the thread; if it was the space's home, the space posts in the main channel again

Response: 204, no body