Skip to content

Create location

POST
/api/locations

Create a new location and initialize its durable object

Request Body required

object
location
required
object
name
required
string
<= 128 characters
timeZone
string
default: Etc/UTC
coordinates
object
latitude
required
number
>= -9007199254740991 <= 9007199254740991
longitude
required
number
>= -9007199254740991 <= 9007199254740991

Responses

200

Response for status ok

object
success
required
boolean
location
required
object
id
required
string
>= 21 characters <= 21 characters
namespaceId
required
string
applicationId
required
string
durableObjectId
required
string
>= 64 characters <= 64 characters
name
required
string
<= 128 characters
timeZone
string
default: Etc/UTC
coordinates
object
latitude
required
number
>= -9007199254740991 <= 9007199254740991
longitude
required
number
>= -9007199254740991 <= 9007199254740991
tariff
required
object
elements
required
Array<object>
object
id
required
string
>= 21 characters <= 21 characters
name
required
string
<= 64 characters
backgroundColor
required
string
<= 12 characters
priceComponents
required
object
Flat
string
PerMinute
string
PerKilowattHour
string
restrictions
object
startTime
object
hour
required
integer
<= 23
minute
required
integer
<= 59
endTime
object
hour
required
integer
<= 23
minute
required
integer
<= 59
daysOfWeek
Array<string>
Allowed values: Mon Tue Wed Thu Fri Sat Sun
minEnergy
number
<= 9007199254740991
maxEnergy
number
<= 9007199254740991
minCurrent
number
<= 9007199254740991
maxCurrent
number
<= 9007199254740991
minPower
number
<= 9007199254740991
maxPower
number
<= 9007199254740991
minDuration
integer
<= 9007199254740991
maxDuration
integer
<= 9007199254740991
vehicleRequestingPower
boolean
minRestrictionsDuration
integer
>= -9007199254740991 <= 9007199254740991
minPrice
string
maxPrice
string
altTexts
Array<object>
object
language
required
string
>= 2 characters <= 2 characters
text
required
string
<= 512 characters
altUrl
string format: uri
createdAt
required
string format: date-time
updatedAt
required
string format: date-time

403

Response for status forbidden

object
success
required
boolean
message
required
string

500

Response for status internalServerError

object
success
required
boolean
message
required
string