Aller au contenu
ZenithDocs
Français

Create a rocket

Add a rocket to an account.

POST/rockets

Autorisations

  • bearerAuthbearer <JWT>

    A token issued by the console.

Corps de la requête

The rocket to create.

  • namestringrequis

    Display name.

  • status"design" | "testing" | "flying" | "retired"

    Lifecycle of a rocket.

  • stagesStage[]requis

    At least one stage.

    Afficher les attributs
    • namestringrequis

      Name of the stage.

    • enginesinteger<int32>requis

      Number of engines on the stage.

    • reusableboolean

      Whether the stage lands back.

Requête
curl -X POST 'https://api.rockets.example/v1/rockets' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "Zenith Heavy",
  "status": "design",
  "stages": [
    {
      "name": "Booster",
      "engines": 9,
      "reusable": false
    }
  ]
}'
application/json
{
  "name": "Zenith Heavy",
  "status": "design",
  "stages": [
    {
      "name": "Booster",
      "engines": 9,
      "reusable": false
    }
  ]
}

Réponses

201

201The rocket was created.

  • idstring<uuid>requis

    Identifier of the rocket.

  • namestringrequis

    Display name.

  • status"design" | "testing" | "flying" | "retired"requis

    Lifecycle of a rocket.

  • thrustinteger<int64>

    Thrust at sea level, in kilonewtons.

  • stagesStage[]requis

    Stages, from the booster upwards.

    Afficher les attributs
    • namestringrequis

      Name of the stage.

    • enginesinteger<int32>requis

      Number of engines on the stage.

    • reusableboolean

      Whether the stage lands back.

  • createdAtstring<date-time>

Réponse
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "name": "Zenith Heavy",
  "status": "design",
  "thrust": 7600,
  "stages": [
    {
      "name": "Booster",
      "engines": 9,
      "reusable": false
    }
  ],
  "createdAt": "2026-01-01T00:00:00Z"
}

422

422The payload did not pass validation.

  • codestringrequis

    Machine-readable code.

  • messagestringrequis

    What went wrong.

  • errorsobject[]

    One entry per rejected field.

    Afficher les attributs
    • fieldstring

    • reasonstring

Réponse
{
  "code": "not_found",
  "message": "string",
  "errors": [
    {
      "field": "stages",
      "reason": "must contain at least one stage"
    }
  ]
}

Dernière mise à jour le