Update a planet
Sometimes you make mistakes, that's fine. No worries, you can update all planets.
AuthorizationBearer <token>
JWT Bearer token authentication
In: header
Path Parameters
planetIdinteger
The ID of the planet to get
Format
int64New information about the planet
namestring
description?string|null
type?string
Value in
"terrestrial" | "gas_giant" | "ice_giant" | "dwarf" | "super_earth"habitabilityIndex?number
A score from 0 to 1 indicating potential habitability
Format
floatRange
0 <= value <= 1physicalProperties?
atmosphere?
Atmospheric composition
discoveredAt?string
Format
date-timeimage?string
satellites?
creator?
A user
tags?array<string>
successCallbackUrl?string
URL which gets invoked upon a successful operation
Format
urifailureCallbackUrl?string
URL which gets invoked upon a failed operation
Format
uriResponse Body
curl -X PUT "https://galaxy.scalar.com/planets/1" \  -H "Content-Type: application/json" \  -d '{    "name": "Mars"  }'{
  "id": 1,
  "name": "Mars",
  "description": "The red planet",
  "type": "terrestrial",
  "habitabilityIndex": 0.68,
  "physicalProperties": {
    "mass": 0.107,
    "radius": 0.532,
    "gravity": 0.378,
    "temperature": {
      "min": 130,
      "max": 308,
      "average": 210
    }
  },
  "atmosphere": [
    {
      "compound": "CO2",
      "percentage": 95.3
    }
  ],
  "discoveredAt": "1610-01-07T00:00:00Z",
  "image": "https://cdn.scalar.com/photos/mars.jpg",
  "satellites": [
    {
      "name": "Phobos",
      "diameter": 22.2
    }
  ],
  "creator": {
    "id": 1,
    "name": "Marc"
  },
  "tags": [
    "solar-system",
    "rocky",
    "explored"
  ],
  "lastUpdated": "2024-01-15T14:30:00Z",
  "successCallbackUrl": "https://example.com/webhook",
  "failureCallbackUrl": "https://example.com/webhook"
}{
  "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."
}