Skip to content

Create Station

Create a new station.

Endpoint

INFO

POST /api/v1/dashboard/stations

Headers

HeaderValueRequired
Content-Typeapplication/jsonYes
Acceptapplication/jsonYes
AuthorizationBearer {token}Yes

Request Body

ParameterTypeRequiredDescription
agency_idintegerYesAgency ID
namestringYesStation name
addressstringYesPhysical address
latitudedecimalYesLocation latitude
longitudedecimalYesLocation longitude
phonestringNoContact phone
emailstringNoContact email
operating_hoursobjectNoOperating hours by day
amenitiesarrayNoList of amenities

Example Request

bash
curl -X POST https://api.daakey.com/api/v1/dashboard/stations \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {token}" \
  -d '{
    "agency_id": 1,
    "name": "Midtown Station",
    "address": "456 5th Ave, New York, NY",
    "latitude": 40.7549,
    "longitude": -73.9840,
    "operating_hours": {
      "monday": "06:00-22:00",
      "tuesday": "06:00-22:00",
      "wednesday": "06:00-22:00",
      "thursday": "06:00-22:00",
      "friday": "06:00-23:00",
      "saturday": "07:00-23:00",
      "sunday": "07:00-21:00"
    },
    "amenities": ["parking", "charging", "restroom"]
  }'

Response

Success (201)

json
{
  "success": true,
  "message": "Station created successfully",
  "data": {
    "id": 3,
    "name": "Midtown Station",
    "address": "456 5th Ave, New York, NY",
    "latitude": 40.7549,
    "longitude": -73.9840,
    "agency": {
      "id": 1,
      "name": "Downtown Agency"
    },
    "status": "active",
    "operating_hours": {
      "monday": "06:00-22:00",
      "tuesday": "06:00-22:00",
      "wednesday": "06:00-22:00",
      "thursday": "06:00-22:00",
      "friday": "06:00-23:00",
      "saturday": "07:00-23:00",
      "sunday": "07:00-21:00"
    },
    "amenities": ["parking", "charging", "restroom"],
    "created_at": "2024-01-15T00:00:00Z"
  },
  "request_id": "uuid",
  "timestamp": "2024-01-01T00:00:00.000Z"
}

Daakey Car Sharing Platform