Skip to content

Backend Routes

Yan Rivera edited this page Oct 25, 2022 · 5 revisions

API Endpoints

users

  • GET /api/users - returns members of a current channel, workspace, or direct message
  • POST /api/users - sign up

session

  • POST /api/session - log in
  • DELETE /api/session - log out

workspaces

  • GET /api/workspaces - returns a user's workspaces
  • POST /api/workspaces - creates a workspace
  • PATCH /api/workspaces - edits a workspace
  • DELETE /api/workspaces - delete a workspace (only if current user is the owner/creator)

messages

  • GET /api/messages - returns messages of a current channel, or direct message
  • POST /api/messages - creates a message
  • PATCH /api/messages - edits a message (only by author)
  • DELETE /api/messages - deletes a message (only by author)

direct_messages

  • GET /api/direct_messages - returns direct messages of current user in current workspace
  • POST /api/direct_messages - creates a new direct message

channels

  • GET /api/channels - returns channels of workspace
  • POST /api/channels - creates new channel ( only by admin/owner of workspace)
  • PATCH /api/channels - edits a channel (e.g. name and description. Only by admin/owner)
Clone this wiki locally