Skip to content
API v2v2.0.0 · 11 endpoints
GitHubDiscord

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

Planets
PUT
https://galaxy.scalar.com/planets/{planetId}
Try it
Authorization (bearerAuth)

path Parameters

planetIdinteger <int64>required

The ID of the planet to get

Example 1

Authorization

  • bearerAuth (bearer)

    JWT Bearer token authentication

  • basicAuth (basic)

    Basic HTTP authentication

  • apiKeyQuery (query: api_key)

    API key query parameter

  • apiKeyHeader (header: X-API-Key)

    API key request header

  • apiKeyCookie (cookie: api_key)

    API key browser cookie

  • oAuth2 (oauth2)

    OAuth 2.0 authentication

  • openIdConnect (openIdConnect)

    OpenID Connect Authentication

Request Body

New information about the planet

Media Type
Planet

A planet in the Scalar Galaxy

id
integer <int64>Required
name
stringRequired
description?
string | null
type?
string
Enum:"terrestrial""gas_giant""ice_giant""dwarf""super_earth"
habitabilityIndex?
number <float>

A score from 0 to 1 indicating potential habitability

physicalProperties?
object

Map value

[key: string]?
number <float>

Additional physical measurements for the planet

mass?
number <float>

Mass in Earth masses (must be greater than 0)

radius?
number <float>

Radius in Earth radii (must be greater than 0)

gravity?
number <float>

Surface gravity in Earth g

temperature?
object

Map value

[key: string]?
number <float>

Additional temperature-related measurements in Kelvin

min?
number <float>

Minimum temperature in Kelvin

max?
number <float>

Maximum temperature in Kelvin

average?
number <float>

Average temperature in Kelvin

atmosphere?
array<object>

Atmospheric composition

object

Map value

[key: string]?
string

Additional atmospheric composition data

compound?
string
percentage?
number <float>
discoveredAt?
string <date-time>
image?
string | null
satellites?
array<Satellite>
creator?
tags?
array<string>
lastUpdated?
string <date-time>
successCallbackUrl?
string <uri>

URL which gets invoked upon a successful operation

failureCallbackUrl?
string <uri>

URL which gets invoked upon a failed operation

Responses

200

Planet updated successfully

Media Type
Planet

A planet in the Scalar Galaxy

id
integer <int64>Required
name
stringRequired
description?
string | null
type?
string
Enum:"terrestrial""gas_giant""ice_giant""dwarf""super_earth"
habitabilityIndex?
number <float>

A score from 0 to 1 indicating potential habitability

physicalProperties?
object

Map value

[key: string]?
number <float>

Additional physical measurements for the planet

mass?
number <float>

Mass in Earth masses (must be greater than 0)

radius?
number <float>

Radius in Earth radii (must be greater than 0)

gravity?
number <float>

Surface gravity in Earth g

temperature?
object

Map value

[key: string]?
number <float>

Additional temperature-related measurements in Kelvin

min?
number <float>

Minimum temperature in Kelvin

max?
number <float>

Maximum temperature in Kelvin

average?
number <float>

Average temperature in Kelvin

atmosphere?
array<object>

Atmospheric composition

object

Map value

[key: string]?
string

Additional atmospheric composition data

compound?
string
percentage?
number <float>
discoveredAt?
string <date-time>
image?
string | null
satellites?
array<Satellite>
creator?
tags?
array<string>
lastUpdated?
string <date-time>
successCallbackUrl?
string <uri>

URL which gets invoked upon a successful operation

failureCallbackUrl?
string <uri>

URL which gets invoked upon a failed operation

400

Bad Request

Media Type
BadRequestError

RFC 7807 (https://datatracker.ietf.org/doc/html/rfc7807)

type?
string
title?
string
status?
integer <int64>
detail?
string
403

Forbidden

Media Type
ForbiddenError

Error response for forbidden access (RFC 7807). Returned when the user does not have permission to access the requested resource.

type?
string
title?
string
status?
integer <int64>
detail?
string
404

Not Found

Media Type
NotFoundError

Error response for resource not found (RFC 7807). Returned when the requested resource does not exist.

type?
string
title?
string
status?
integer <int64>
detail?
string

Code Samples

curl -X PUT 'https://galaxy.scalar.com/planets/{planetId}' \
  -H 'Authorization: Basic <base64-credentials>' \
  -H 'X-API-Key: <X-API-Key>' \
  -H 'Content-Type: application/json' \
  -d '{
  "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,
      "temperatureMetric1": 0.1,
      "temperatureMetric2": 0.1
    },
    "measurement1": 0.1,
    "measurement2": 0.1
  },
  "atmosphere": [
    {
      "compound": "CO2",
      "percentage": 95.3,
      "atmosphericData1": "string",
      "atmosphericData2": "string"
    }
  ],
  "discoveredAt": "1610-01-07T00:00:00.000Z",
  "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": {
        "planet": {
          "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,
              "temperatureMetric1": 0.1,
              "temperatureMetric2": 0.1
            },
            "measurement1": 0.1,
            "measurement2": 0.1
          },
          "atmosphere": [
            {
              "compound": "CO2",
              "percentage": 95.3,
              "atmosphericData1": "string",
              "atmosphericData2": "string"
            }
          ],
          "discoveredAt": "1610-01-07T00:00:00.000Z",
          "image": "https://cdn.scalar.com/photos/mars.jpg",
          "satellites": [],
          "creator": {
            "name": "Marc"
          },
          "tags": [
            "solar-system",
            "rocky",
            "explored"
          ],
          "successCallbackUrl": "https://example.com/webhook",
          "failureCallbackUrl": "https://example.com/webhook"
        },
        "orbitalPeriod": 0.319,
        "distance": 9376
      }
    }
  ],
  "creator": {
    "name": "Marc"
  },
  "tags": [
    "solar-system",
    "rocky",
    "explored"
  ],
  "successCallbackUrl": "https://example.com/webhook",
  "failureCallbackUrl": "https://example.com/webhook"
}'

Example Responses

{
  "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,
      "temperatureMetric1": 0.1,
      "temperatureMetric2": 0.1
    },
    "measurement1": 0.1,
    "measurement2": 0.1
  },
  "atmosphere": [
    {
      "compound": "CO2",
      "percentage": 95.3,
      "atmosphericData1": "string",
      "atmosphericData2": "string"
    }
  ],
  "discoveredAt": "1610-01-07T00:00:00.000Z",
  "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": {
        "planet": {
          "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,
              "temperatureMetric1": 0.1,
              "temperatureMetric2": 0.1
            },
            "measurement1": 0.1,
            "measurement2": 0.1
          },
          "atmosphere": [
            {
              "compound": "CO2",
              "percentage": 95.3,
              "atmosphericData1": "string",
              "atmosphericData2": "string"
            }
          ],
          "discoveredAt": "1610-01-07T00:00:00.000Z",
          "image": "https://cdn.scalar.com/photos/mars.jpg",
          "satellites": [],
          "creator": {
            "id": 1,
            "name": "Marc"
          },
          "tags": [
            "solar-system",
            "rocky",
            "explored"
          ],
          "lastUpdated": "2024-01-15T14:30:00.000Z",
          "successCallbackUrl": "https://example.com/webhook",
          "failureCallbackUrl": "https://example.com/webhook"
        },
        "orbitalPeriod": 0.319,
        "distance": 9376
      }
    }
  ],
  "creator": {
    "id": 1,
    "name": "Marc"
  },
  "tags": [
    "solar-system",
    "rocky",
    "explored"
  ],
  "lastUpdated": "2024-01-15T14:30:00.000Z",
  "successCallbackUrl": "https://example.com/webhook",
  "failureCallbackUrl": "https://example.com/webhook"
}