Update a planet

Sometimes you make mistakes, that's fine. No worries, you can update all planets.

Path Parameters
  • planetId
    Type: integer Format: int64
    required

    The ID of the planet to get

Body·

New information about the planet

A planet in the Scalar Galaxy

  • name
    Type: string
    required
  • type
    Type: string enum
    required
    values
    • planet = Planet

      Discriminator value for Planet schema

    • terrestrial = Terrestrial

      Rocky planets with solid surfaces, like Earth and Mars

    • gas_giant = GasGiant

      Large planets composed mainly of hydrogen and helium, like Jupiter and Saturn

    • ice_giant = IceGiant

      Planets composed of water, ammonia, and methane ices, like Uranus and Neptune

    • dwarf = Dwarf

      Small planetary bodies that don't meet full planet criteria, like Pluto

    • super_earth = SuperEarth

      Rocky planets larger than Earth but smaller than gas giants

  • atmosphere
    Type: array object[]

    Atmospheric composition

  • creator
    Type: object ·

    A user

  • description
    Type: string | null
  • discoveredAt
    Type: string Format: date-time

    the date-time notation as defined by RFC 3339, section 5.6, for example, 2017-07-21T17:32:28Z

  • failureCallbackUrl
    Type: string Format: uri

    URL which gets invoked upon a failed operation

  • habitabilityIndex
    Type: number Format: float
    min:  
    0
    max:  
    1

    A score from 0 to 1 indicating potential habitability

  • image
    Type: string nullable
  • physicalProperties
    Type: object
  • satellites
    Type: array object[] ·

    Every satellite in the Scalar Galaxy

  • successCallbackUrl
    Type: string Format: uri

    URL which gets invoked upon a successful operation

Responses
Request Example for put/planets/{planetId}
curl https://galaxy.scalar.com/planets/1 \
  --request PUT \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "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,
      "temperatureMetric": 1
    },
    "measurement": 1
  },
  "atmosphere": [
    {
      "compound": "CO2",
      "percentage": 95.3,
      "atmosphericData": ""
    }
  ],
  "discoveredAt": "1610-01-07T00:00:00Z",
  "image": "https://cdn.scalar.com/photos/mars.jpg",
  "satellites": [
    {
      "name": "Phobos",
      "description": "Phobos is the larger and innermost of the two moons of Mars.",
      "diameter": 22.2,
      "type": "moon",
      "orbit": {
        "planetId": 1,
        "orbitalPeriod": 0.319,
        "distance": 9376
      }
    }
  ],
  "creator": {
    "name": "Marc"
  },
  "tags": [
    "solar-system",
    "rocky",
    "explored"
  ],
  "successCallbackUrl": "https://example.com/webhook",
  "failureCallbackUrl": "https://example.com/webhook"
}'
{
  "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,
      "temperatureMetric": 1
    },
    "measurement": 1
  },
  "atmosphere": [
    {
      "compound": "CO2",
      "percentage": 95.3,
      "atmosphericData": "string"
    }
  ],
  "discoveredAt": "1610-01-07T00:00:00Z",
  "image": "https://cdn.scalar.com/photos/mars.jpg",
  "satellites": [
    {
      "id": 1,
      "name": "Phobos",
      "description": "Phobos is the larger and innermost of the two moons of Mars.",
      "diameter": 22.2,
      "type": "moon",
      "orbit": {
        "planetId": 1,
        "orbitalPeriod": 0.319,
        "distance": 9376
      }
    }
  ],
  "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"
}