> ## Documentation Index
> Fetch the complete documentation index at: https://www.latitude.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# List BGP sessions

> List the BGP sessions announcing an elastic IP



## OpenAPI

````yaml https://spec.speakeasy.com/latitude/latitude/latitude-sh-api-with-code-samples get /elastic_ips/{elastic_ip_id}/bgp_sessions
openapi: 3.0.1
info:
  title: Latitude.sh API
  version: '2023-06-01'
  description: >-
    The Latitude.sh API is a RESTful API to manage your Latitude.sh account. It
    allows you to perform the same actions as the Latitude.sh dashboard.
servers:
  - url: https://api.latitude.sh
    variables:
      latitude_api_key:
        default: <insert your api key here>
  - url: http://api.latitude.sh
    variables:
      latitude_api_key:
        default: <insert your api key here>
security: []
tags:
  - name: API keys
  - name: Baselines (Preview)
    description: >-
      Preview. Available to teams with the `baselines_api` feature flag. The
      shape of these endpoints may change before general availability.
  - name: Billing
  - name: Elastic Ips
  - name: Events
  - name: Firewalls
  - name: IP Addresses
  - name: Managed Databases
    description: Managed database instances (PostgreSQL, ClickHouse)
  - name: Kubernetes Clusters
  - name: LKS
  - name: Marketplace apps
  - name: Operating Systems
  - name: Plans
  - name: Public Networks
  - name: Private Networks
  - name: Projects
  - name: Regions
  - name: Roles
  - name: SSH Keys
  - name: Servers
  - name: Block Storage
  - name: Filesystem Storage
  - name: Object Storage
  - name: Tags
  - name: Teams
  - name: Team members
  - name: Traffic
  - name: User data
  - name: User profile
  - name: VPN Sessions
  - name: Virtual machines
  - name: Virtual machine backups
  - name: Virtual machine restores
paths:
  /elastic_ips/{elastic_ip_id}/bgp_sessions:
    get:
      tags:
        - Elastic Ips
      summary: List BGP sessions
      description: List the BGP sessions announcing an elastic IP
      operationId: list-elastic-ip-bgp-sessions
      parameters:
        - name: elastic_ip_id
          in: path
          required: true
          examples:
            Success:
              value: ueip_v9BVDaGvdRm1W
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/vnd.api+json:
              examples:
                Success:
                  value:
                    data:
                      - id: bgps_w49QDB9PqagKb
                        type: bgp_sessions
                        attributes:
                          status: active
                          status_message: null
                          server_ip: 162.43.189.161
                          asn: 65001
                          created_at: '2026-07-24T10:00:00Z'
                          server:
                            id: sv_A05EdQp4OvKYQ
                            hostname: para-bgp-3
                            primary_ipv4: 162.43.189.161
                            operating_system: ubuntu_24_04_x64_lts
                          region:
                            id: reg_qOxWMz15VGAwd
                            name: United States
                            location:
                              id: loc_Yb7VpP53OjxEr
                              name: Los Angeles 2
                              slug: LAX2
              schema:
                $ref: '#/components/schemas/bgp_sessions'
      security:
        - Bearer: []
      x-codeSamples:
        - lang: python
          label: Python (SDK)
          source: |-
            from latitudesh_python_sdk import Latitudesh
            import os


            with Latitudesh(
                bearer=os.getenv("LATITUDESH_BEARER", ""),
            ) as latitudesh:

                res = latitudesh.elastic_ips.list_elastic_ip_bgp_sessions(elastic_ip_id="ueip_v9BVDaGvdRm1W")

                # Handle response
                print(res)
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tlatitudeshgosdk \"github.com/latitudesh/latitudesh-go-sdk\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := latitudeshgosdk.New(\n        latitudeshgosdk.WithSecurity(os.Getenv(\"LATITUDESH_BEARER\")),\n    )\n\n    res, err := s.ElasticIps.ListElasticIPBgpSessions(ctx, \"ueip_v9BVDaGvdRm1W\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.BgpSessions != nil {\n        // handle response\n    }\n}"
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Latitudesh } from "latitudesh-typescript-sdk";

            const latitudesh = new Latitudesh({
              bearer: process.env["LATITUDESH_BEARER"] ?? "",
            });

            async function run() {
              const result = await latitudesh.elasticIps.listElasticIpBgpSessions({
                elasticIpId: "ueip_v9BVDaGvdRm1W",
              });

              console.log(result);
            }

            run();
components:
  schemas:
    bgp_sessions:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/bgp_session_data'
    bgp_session_data:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          enum:
            - bgp_sessions
        attributes:
          type: object
          properties:
            status:
              type: string
              nullable: true
              enum:
                - pending
                - configuring
                - active
                - removing
                - error
            status_message:
              type: string
              nullable: true
              description: >-
                Generic explanation when the session could not be configured.
                Infrastructure diagnostics are intentionally not exposed.
            server_ip:
              type: string
              nullable: true
            peer_address:
              type: string
              nullable: true
              description: >-
                IP address on the other end of the announcing server's /31 — the
                address you configure as the BGP neighbor when peering. Use it
                as the neighbor in BIRD or as peerAddress in MetalLB. Null while
                the session is still pending, or when the address cannot be
                resolved.
            asn:
              type: integer
              nullable: true
            created_at:
              type: string
              format: date-time
              nullable: true
            server:
              type: object
              nullable: true
              description: >-
                The server announcing the Elastic IP over BGP. Null when the
                announcer could not be resolved to a server record.
              properties:
                id:
                  type: string
                hostname:
                  type: string
                primary_ipv4:
                  type: string
                  nullable: true
                operating_system:
                  type: string
                  nullable: true
            region:
              type: object
              nullable: true
              description: The region where this Elastic IP is located
              properties:
                id:
                  type: string
                  description: The region ID
                name:
                  type: string
                  description: The region name
                location:
                  type: object
                  description: The site/location within the region
                  properties:
                    id:
                      type: string
                      description: The site ID
                    name:
                      type: string
                      description: The site name
                    slug:
                      type: string
                      description: The site slug
  securitySchemes:
    Bearer:
      type: apiKey
      name: Authorization
      in: header

````