Skip to content

BGP

BGP lets a workspace announce its own IP prefixes (bring your own IP). Each workspace has at most one BGP configuration, which stores the workspace ASN, a BGP session password, and an optional instance that acts as the BGP endpoint. Prefix announcements are managed separately under /bgp/prefixes.

Fetching the BGP config and listing prefixes check workspace read permission and are available to any member with that permission. All mutation endpoints (PATCH, DELETE, POST, PUT on prefixes) are restricted to Administrator tokens.

See Workspaces and scope and Pagination for the conventions these endpoints follow.

Fetch BGP configuration

GET/v1/workspaces/{wid}/bgpFetch the BGP configuration for a workspace

Returns the current BGP configuration together with its live fields (including the decrypted session password). Returns 404 if no BGP configuration has been created for the workspace yet.

Path parameters

NameTypeDescription
widintegerWorkspace ID

Returns an object with two top-level keys:

data (the stored configuration):

FieldTypeDescription
idstringBGP configuration ID
asnintegerAutonomous system number registered to this workspace
instanceobjectInstance designated as the BGP endpoint (id, name), or null if unset
max_prefixesintegerMaximum number of prefixes allowed on this BGP session

live (fields resolved at request time):

FieldTypeDescription
passwordstringDecrypted BGP session password
bash
curl https://api.galaxygate.net/v1/workspaces/42/bgp \
  -H "Authorization: Bearer $GALAXYGATE_TOKEN" \
  -A 'curl/8.5'

Update BGP configuration

PATCH/v1/workspaces/{wid}/bgpCreate or update the BGP configuration

Administrator only. Creates the BGP configuration if none exists for the workspace, then applies the supplied fields. Every field is optional; send only what you want to change.

Path parameters

NameTypeDescription
widintegerWorkspace ID

Request body

FieldTypeDescription
asnintegerASN to register to this workspace
passwordstringBGP session password (stored encrypted; returned decrypted in live.password)
instance_idinteger or nullID of the instance to designate as the BGP endpoint; send null to clear
max_prefixesintegerMaximum number of prefixes to allow

Returns the updated BGP configuration in the same shape as the fetch endpoint.

Delete BGP configuration

DELETE/v1/workspaces/{wid}/bgpDelete the BGP configuration and all its prefixes

Administrator only. Deletes the BGP configuration for the workspace and removes all associated prefix entries.

Path parameters

NameTypeDescription
widintegerWorkspace ID

Returns 200 OK with no body.

List BGP prefixes

GET/v1/workspaces/{wid}/bgp/prefixesList BGP prefix announcements

Administrator only. Returns the prefix entries attached to the workspace BGP configuration, with pagination.

Path parameters

NameTypeDescription
widintegerWorkspace ID

Query parameters

NameTypeDescription
idinteger[]Filter to specific prefix IDs
prefixstringFilter by prefix (CIDR notation, partial match)
sourcestringFilter by source; only MANUAL is currently defined
enabledbooleanFilter to enabled or disabled prefixes

Plus the shared pagination parameters. Returns a paged list of prefix objects (see the prefix fields table in Announce a prefix below).

Announce a BGP prefix

POST/v1/workspaces/{wid}/bgp/prefixesAdd a BGP prefix announcement

Administrator only. Adds a prefix to the BGP configuration. All four fields are required.

Path parameters

NameTypeDescription
widintegerWorkspace ID

Request body

FieldTypeRequiredDescription
prefixstringyesNetwork prefix in CIDR notation, for example 203.0.113.0/24
sourcestringyesOrigin of the prefix. Currently only MANUAL is valid.
enabledbooleanyesWhether announcements for this prefix are active
communitystringyesBGP community to attach. One of DEFAULT or PROTECTED.
bash
curl -X POST https://api.galaxygate.net/v1/workspaces/42/bgp/prefixes \
  -H "Authorization: Bearer $GALAXYGATE_TOKEN" \
  -H "Content-Type: application/json" \
  -A 'curl/8.5' \
  -d '{
    "prefix": "203.0.113.0/24",
    "source": "MANUAL",
    "enabled": true,
    "community": "DEFAULT"
  }'

Returns the created prefix entry:

FieldTypeDescription
idintegerPrefix entry ID
prefixstringNetwork prefix in CIDR notation
sourcestringOrigin of the prefix
enabledbooleanWhether announcements are active
communitystringBGP community attached to this prefix

Update a BGP prefix

PUT/v1/workspaces/{wid}/bgp/prefixes/{id}Replace a BGP prefix entry

Administrator only. Replaces all fields on an existing prefix entry. All four body fields are required; to change a single field, repeat the existing values for the rest.

Path parameters

NameTypeDescription
widintegerWorkspace ID
idintegerPrefix entry ID

Request body

Same four fields as Announce a BGP prefix: prefix, source, enabled, community.

Returns the updated prefix entry in the same shape as the create response.

Delete a BGP prefix

DELETE/v1/workspaces/{wid}/bgp/prefixes/{id}Remove a BGP prefix announcement

Administrator only. Removes the prefix entry. The withdrawal takes effect asynchronously on the BGP session.

Path parameters

NameTypeDescription
widintegerWorkspace ID
idintegerPrefix entry ID

Returns 200 OK with no body.