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

AuthorizationBearer <token>

JWT Bearer token authentication

In: header

Path Parameters

planetId*integer

The ID of the planet to get

Request Body

multipart/form-data

Image to upload

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

curl -X POST "https://example.com/planets/1/image"
{  "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"}
{  "type": "https://example.com/errors/bad-request",  "title": "Bad Request",  "status": 400,  "detail": "The request was invalid."}
{  "type": "https://example.com/errors/forbidden",  "title": "Forbidden",  "status": 403,  "detail": "You are not authorized to access this resource."}
{  "type": "https://example.com/errors/not-found",  "title": "Not Found",  "status": 404,  "detail": "The resource you are trying to access does not exist."}