Fumadocs

Upload an image to a planet

POST
/planets/{planetId}/image

Got a crazy good photo of a planet? Share it with the world!

Authorization

headerAuthorizationBearer <token>

JWT Bearer token authentication

Path Parameters

planetId*integer

The ID of the planet to get

Formatint64

Request Body

Image to upload

multipart/form-data
  1. body
image?file

The image file to upload

Formatbinary

Response Body

Image uploaded

  1. response

Message about an image upload

message?string
imageUrl?string

The URL where the uploaded image can be accessed

uploadedAt?string

Timestamp when the image was uploaded

Formatdate-time
fileSize?integer

Size of the uploaded image in bytes

mimeType?string

The content type of the uploaded image

Example Request
curl -X POST 'https://galaxy.scalar.com/planets/1/image'
Example Response
{
  "message": "Image uploaded successfully",
  "imageUrl": "https://cdn.scalar.com/images/8f47c132-9d1f-4f83-b5a4-91db5ee757ab.jpg",
  "uploadedAt": "2024-01-15T14:30:00Z",
  "fileSize": 1048576,
  "mimeType": "image/jpeg"
}