Skip to main content
POST
/
load-balancers
/
{id}
/
destinations
Create load balancer destination
curl --request POST \
  --url https://api.sevalla.com/v3/load-balancers/{id}/destinations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "service_type": "APP",
  "service_id": "fb5e5168-4281-4bec-94c5-0d1584e9e657",
  "weight": 100,
  "url": "https://example.com",
  "latitude": 37.7749,
  "longitude": -122.4194
}
'
{
  "id": "fb5e5168-4281-4bec-94c5-0d1584e9e657",
  "service_id": "fb5e5168-4281-4bec-94c5-0d1584e9e657",
  "service_type": "APP",
  "is_enabled": true,
  "weight": 100,
  "url": null,
  "latitude": null,
  "longitude": null,
  "created_at": "2025-01-30T00:00:00.000Z",
  "updated_at": "2025-01-30T00:00:00.000Z"
}

Authorizations

Authorization
string
header
required

API key authentication. Pass your API key as a Bearer token in the Authorization header.

Path Parameters

id
string<uuid>
required

Load balancer identifier

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Example:

"fb5e5168-4281-4bec-94c5-0d1584e9e657"

Body

application/json
service_type
enum<string>
required

Type of the backing service. APP - application. STATIC_SITE - static site. OBJECT_STORAGE - object storage bucket. EXTERNAL - external URL. LOAD_BALANCER - nested load balancer.

Available options:
APP,
STATIC_SITE,
OBJECT_STORAGE,
EXTERNAL,
LOAD_BALANCER
Example:

"APP"

service_id
string

Identifier of the backing service. Required for APP, STATIC_SITE, OBJECT_STORAGE, and LOAD_BALANCER types. Must not be set for EXTERNAL type.

Minimum string length: 1
Example:

"fb5e5168-4281-4bec-94c5-0d1584e9e657"

weight
integer

Traffic weight for weighted routing. Higher values receive proportionally more traffic.

Required range: 0 <= x <= 10000
Example:

100

url
string

External URL, required when service_type is EXTERNAL

Example:

"https://example.com"

latitude
number

Geographic latitude for GEO routing

Required range: -90 <= x <= 90
Example:

37.7749

longitude
number

Geographic longitude for GEO routing

Required range: -180 <= x <= 180
Example:

-122.4194

Response

Default Response

id
string<uuid>
required

Unique identifier for the destination

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Example:

"fb5e5168-4281-4bec-94c5-0d1584e9e657"

service_id
string | null
required

Identifier of the backing service for this destination. Null for EXTERNAL type destinations.

Example:

"fb5e5168-4281-4bec-94c5-0d1584e9e657"

service_type
enum<string>
required

Type of the backing service. APP - application. STATIC_SITE - static site. OBJECT_STORAGE - object storage bucket. EXTERNAL - external URL. LOAD_BALANCER - nested load balancer.

Available options:
APP,
STATIC_SITE,
OBJECT_STORAGE,
EXTERNAL,
LOAD_BALANCER
Example:

"APP"

is_enabled
boolean
required

Whether this destination is currently receiving traffic

Example:

true

weight
integer | null
required

Traffic weight for weighted routing. Higher values receive proportionally more traffic.

Required range: 0 <= x <= 10000
Example:

100

url
string | null
required

External URL for EXTERNAL service type destinations

Example:

null

latitude
number | null
required

Geographic latitude for GEO routing

Required range: -90 <= x <= 90
Example:

null

longitude
number | null
required

Geographic longitude for GEO routing

Required range: -180 <= x <= 180
Example:

null

created_at
string<date-time>
required

Timestamp when the destination was created, in ISO 8601 format

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Example:

"2025-01-30T00:00:00.000Z"

updated_at
string<date-time>
required

Timestamp when the destination was last modified, in ISO 8601 format

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Example:

"2025-01-30T00:00:00.000Z"