from fastapi import APIRouter from api.v1.models.message import Message router = APIRouter() @router.post("/messages/", response_model=Message) async def create_message(message: Message): # You would typically save the message to the database here return message