Skip to main content
POST
/
movies
Create Movie
curl --request POST \
  --url https://api.example.com/movies \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "<string>",
  "description": "<string>",
  "duration": 123,
  "main_language": "<string>",
  "release_year": 123,
  "nationality": "<string>",
  "display_picture": "<string>",
  "youtube_link": "<string>",
  "production": "<string>",
  "workshop": "<string>",
  "ai_tool": "<string>",
  "translation": "<string>",
  "synopsis_anglais": "<string>",
  "categories": [
    {}
  ],
  "collaborators": [
    {}
  ]
}
'
{
  "message": "Film soumis avec succès",
  "movie": {
    "id_movie": 24,
    "title": "Quantum Dreams",
    "description": "A journey through the quantum realm visualized with AI",
    "duration": 95,
    "main_language": "English",
    "release_year": 2025,
    "nationality": "USA",
    "display_picture": "poster-1710245678-111222333.jpg",
    "picture1": "thumbnail1-1710245678-111222333.jpg",
    "picture2": null,
    "picture3": null,
    "trailer": "filmFile-1710245678-111222333.mp4",
    "youtube_link": null,
    "production": "AI-Assisted",
    "workshop": "Quantum Visualization Workshop",
    "translation": null,
    "synopsis": "A journey through the quantum realm visualized with AI",
    "synopsis_anglais": "A journey through the quantum realm visualized with AI",
    "subtitle": "subtitlesSrt-1710245678-111222333.srt",
    "ai_tool": "DALL-E 3, Runway Gen-2",
    "thumbnail": "poster-1710245678-111222333.jpg",
    "selection_status": "submitted",
    "jury_comment": null,
    "admin_comment": null,
    "id_user": 42,
    "createdAt": "2025-03-07T10:15:30.000Z",
    "updatedAt": "2025-03-07T10:15:30.000Z"
  }
}

Overview

Submits a new movie to the MarsAI festival. Supports both multipart form data (for file uploads) and JSON payloads. Automatically generates a thumbnail from the uploaded video if not provided.

Authentication

Authorization
string
required
Bearer token for authenticated user with PRODUCER or ADMIN role

Request Body

Supports multipart/form-data for file uploads or application/json for metadata only.

Core Fields

title
string
required
Movie title (can also use filmTitleOriginal)
description
text
required
Movie description/synopsis (can also use synopsis or synopsisOriginal)
duration
integer
Duration in seconds (can also use durationSeconds). Maximum 120 seconds.
main_language
string
Main language of the film (can also use filmLanguage)
release_year
integer
Year of release (can also use releaseYear)
nationality
string
Country of origin

Media Fields

filmFile
file
Main video file (multipart upload). Automatically generates thumbnail if not provided.
display_picture
string
Main display image filename
thumbnail1
file
First thumbnail image (multipart upload, stored as picture1)
thumbnail2
file
Second thumbnail image (multipart upload, stored as picture2)
thumbnail3
file
Third thumbnail image (multipart upload, stored as picture3)
subtitlesSrt
file
Subtitle file in SRT format (multipart upload)
YouTube video URL (can also use youtubeLink)

Production Fields

production
string
Production company or AI classification (can also use aiClassification)
workshop
string
Workshop or AI methodology (can also use aiMethodology)
ai_tool
string
AI tools used in production (can also use aiStack)
translation
string
Translation language
synopsis_anglais
text
Synopsis in English (can also use synopsisEnglish)

Associations

categories
array
Array of category IDs to associate with the movie (JSON array or stringified JSON)
collaborators
array
Array of collaborator objects (JSON array or stringified JSON)Each collaborator should have:
  • email (required)
  • first_name or firstname
  • last_name or lastname
  • job (optional)

Response

message
string
Success message
movie
object
The created movie object
{
  "message": "Film soumis avec succès",
  "movie": {
    "id_movie": 24,
    "title": "Quantum Dreams",
    "description": "A journey through the quantum realm visualized with AI",
    "duration": 95,
    "main_language": "English",
    "release_year": 2025,
    "nationality": "USA",
    "display_picture": "poster-1710245678-111222333.jpg",
    "picture1": "thumbnail1-1710245678-111222333.jpg",
    "picture2": null,
    "picture3": null,
    "trailer": "filmFile-1710245678-111222333.mp4",
    "youtube_link": null,
    "production": "AI-Assisted",
    "workshop": "Quantum Visualization Workshop",
    "translation": null,
    "synopsis": "A journey through the quantum realm visualized with AI",
    "synopsis_anglais": "A journey through the quantum realm visualized with AI",
    "subtitle": "subtitlesSrt-1710245678-111222333.srt",
    "ai_tool": "DALL-E 3, Runway Gen-2",
    "thumbnail": "poster-1710245678-111222333.jpg",
    "selection_status": "submitted",
    "jury_comment": null,
    "admin_comment": null,
    "id_user": 42,
    "createdAt": "2025-03-07T10:15:30.000Z",
    "updatedAt": "2025-03-07T10:15:30.000Z"
  }
}

Error Responses

{
  "error": "Le titre et la description sont obligatoires"
}
{
  "error": "La durée maximale est de 120 secondes"
}
{
  "error": "La durée du film est invalide"
}
{
  "error": "Database error message"
}

Example Request

curl -X POST https://api.marsai.com/movies \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -F "title=Quantum Dreams" \
  -F "description=A journey through the quantum realm visualized with AI" \
  -F "duration=95" \
  -F "main_language=English" \
  -F "release_year=2025" \
  -F "nationality=USA" \
  -F "ai_tool=DALL-E 3, Runway Gen-2" \
  -F "production=AI-Assisted" \
  -F "workshop=Quantum Visualization Workshop" \
  -F "filmFile=@/path/to/video.mp4" \
  -F "thumbnail1=@/path/to/thumb1.jpg" \
  -F "subtitlesSrt=@/path/to/subtitles.srt" \
  -F 'categories=[1,3,5]' \
  -F 'collaborators=[{"email":"john@example.com","first_name":"John","last_name":"Doe","job":"Director"}]'

Notes

  • The movie is automatically created with selection_status: 'submitted'
  • If no thumbnail is provided and a video file is uploaded, a thumbnail is automatically generated at the 1-second mark (1280x720)
  • Collaborators are created or updated using findOrCreate based on email
  • Categories must be existing category IDs in the database
  • The authenticated user becomes the producer (id_user) of the movie