SpaceDB API

Partially update a moon

patch

Path Parameters

idintegerrequired

Body

application/json

Moon

idinteger

Example:1

namestring

Example:Luna

planet_idinteger | null

Example:3

mass_kgnumber | null(float)

Example:7.342e+22

radius_kmnumber | null(float)

Example:1737.4

orbital_period_daysnumber | null(float)

Example:27.32

discovered_atstring | null(date)

Example:null

created_atstring(date-time)
updated_atstring(date-time)

Response

Updated

patch/moons/{id}

Body

{}
 

Delete a moon

delete

Path Parameters

idintegerrequired

Response

Deleted

delete/moons/{id}
 

List all spaceships

get

Query Parameters

pageinteger
per_pageinteger

<= 100

Response

application/json

Paginated list of spaceships

dataarray[object]
Show Child Parameters
linksobject
Show Child Parameters
metaobject
Show Child Parameters
get/spaceships
 
application/json

Create a spaceship

post

Body

application/json
namestringrequired
typestringrequired

Allowed values:spacecraftprobestationrocket

operatorstring | null
launch_datestring | null(date)
statusstringrequired

Allowed values:activeretiredplannedlost

crew_capacityinteger | null
mass_kgnumber | null
descriptionstring | null

Response

application/json

Spaceship created

dataobject
Show Child Parameters
post/spaceships

Body

{ "name": "name", "type": "spacecraft", "status": "active" }
 
application/json

Get a spaceship

get

Path Parameters

idintegerrequired

Response

application/json

Spaceship details

dataobject
Show Child Parameters
get/spaceships/{id}
 
application/json