Projekty
APICars

Create a car

Adds a car to the authenticated user garage.

POST
/api/cars

Adds a car to the authenticated user garage.

Authorization

sessionAuth
cookiebetter-auth.session_token<token>

Better Auth session cookie (on HTTPS: __Secure-better-auth.session_token), forwarded to the login server's /api/auth/get-session

Request Body

application/json
  1. body
brand*string
Length1 <= length
model*string
Length1 <= length
year*integer
Range1950 <= value <= 9007199254740991
color?string|null
photoUrl?|unknown|null
doors?|null
seats?|null
bodyType?string|null
trunkCapacityLiters?|null

Response Body

OK

application/json
  1. response
success*boolean
id*string
Example Request
curl -X POST 'https://example.com/api/cars' \  -H 'Content-Type: application/json' \  -d '{  "brand": "string",  "model": "string",  "year": 1950}'
Example Response
{  "success": true,  "id": "string"}