Skip to main content
POST
Create Station

Authorizations

Authorization
string
header
required

An API key, sent as Authorization: Bearer <key>. Create one in the SWITCH Copilot under Settings → API keys (needs the API keys permission in your company), or with POST /auth/api-keys. The key is shown once, at creation.

Body

application/json

Schema for creating a new station.

All required fields must be provided including name, address, capacity, and WGS84 coordinates. An optional polygon boundary can define the station's geographic area.

name
string
required

Station name.

Example:

"Duomo"

address
string
required

Full address.

Example:

"Piazza del Duomo, 20122 Milano MI"

max_capacity
integer
required

Maximum number of vehicles the station holds.

Example:

20

latitude
number
required

Latitude (WGS84).

Example:

45.4642

longitude
number
required

Longitude (WGS84).

Example:

9.19

company_slug
string
required

Owning company slug.

Example:

"acme-mobility"

polygon
number[][] | null

Optional station area as a closed ring of [longitude, latitude] pairs: at least 4 points, the last equal to the first.

Example:

Response

Station created successfully. Returns the complete station profile including coordinates, capacity, optional polygon boundary, and company ownership.

Public schema for a station resource.

Exposes station details to API consumers, including coordinates, capacity, optional polygon boundary, and company ownership.

id
integer
required

Unique ID.

Example:

1

name
string
required

Station name.

Example:

"Duomo"

address
string
required

Full address.

Example:

"Piazza del Duomo, 20122 Milano MI"

max_capacity
integer
required

Maximum number of vehicles the station holds.

Example:

20

latitude
number
required

Latitude.

Example:

45.4642

longitude
number
required

Longitude.

Example:

9.19

company_slug
string
required

Owning company slug.

Example:

"acme-mobility"

company_name
string
required

Owning company display name.

created_at
string<date-time>
required

Datetime when the record was created.

polygon
number[][] | null

Station area as a closed ring of [longitude, latitude] pairs; absent when the station has none.

Example:
updated_at
string<date-time> | null

Datetime when the record was last updated, if ever.