Celestial Bodies

Create a celestial body

Stars, moons, comets, the occasional rogue asteroid — if it glows or drifts through the void, you can add it here.

post/celestial-bodies

Request

  • Base URL: https://galaxy.scalar.com
  • URL: https://galaxy.scalar.com/celestial-bodies
  • Auth: one of:
    • HTTP bearer
    • HTTP basic
    • API key in query parameter api_key
    • API key in header X-API-Key
    • API key in header X-API-Key and API key in query parameter api_key
    • API key in cookie api_key
    • OAuth 2 (authorization code, authorization URL https://galaxy.scalar.com/oauth/authorize, token URL https://galaxy.scalar.com/oauth/token; client credentials, token URL https://galaxy.scalar.com/oauth/token; implicit, authorization URL https://galaxy.scalar.com/oauth/authorize; password, token URL https://galaxy.scalar.com/oauth/token)
    • OpenID Connect (https://galaxy.scalar.com/.well-known/openid-configuration)

Request body

OR

Example request

{
  "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": [
    {
      "id": 1,
      "name": "Phobos",
      "description": "Phobos is the larger and innermost of the two moons of Mars.",
      "diameter": 22.2,
      "type": "moon",
      "orbit": {
        "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"
}

Response

Celestial body created

OR

Example response

{
  "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": [
    {
      "id": 1,
      "name": "Phobos",
      "description": "Phobos is the larger and innermost of the two moons of Mars.",
      "diameter": 22.2,
      "type": "moon",
      "orbit": {
        "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"
}

Changes

No recorded changes to this operation across all 1 revision of this API.