Fumadocs

Create a planet

POST
/planets

Time to play god and create a new planet. What do you think? Ah, don't think too much. What could go wrong anyway?

AuthorizationBearer <token>

JWT Bearer token authentication

In: header

Planet

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

curl -X POST "https://galaxy.scalar.com/planets" \  -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,
      "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: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": {
        "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:00Z",
          "image": "https://cdn.scalar.com/photos/mars.jpg",
          "satellites": [],
          "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"
        },
        "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"
}
{
  "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."
}