Upload Media: /media/ (POST)

Purpose:

Upload a media file to S3 and store its metadata in the database.

Input:

  • Headers:
    • Content-Type: multipart/form-data
    • Authorization: The JWT token of the user.
  • Multipart Form Data:
    • file: (File) The media file to upload.

Output (200):

{
  "id": "c20ae0ec-d1c7-40e4-9d9b-d370a919475d",
  "file_name": "example.jpg",
  "key": "media/convoforge/example.jpg",
  "url": "https://example.com/media/convoforge/example.jpg",
  "created_at": "2024-08-12T12:34:56",
  "user_id": "fc03f623-5495-41f3-a880-2e6898b016ea"
}