---
title: "Adds a BGP Policy"
method: POST
path: "/config/bgp/policy/definitions"
---

# Adds a BGP Policy

`POST /config/bgp/policy/definitions`

## Request

- Base URL: `http://0.0.0.0:11111/netlox/v1`
- URL: `http://0.0.0.0:11111/netlox/v1/config/bgp/policy/definitions`
- Auth: API key in header `Authorization`

Adds a BGP Policy

## Request body

- BGPPolicyDefinitionsMod
  - `name` string: BGP Neighbor IP address
  - `statements` BGPPolicyDefinitionsStatement[]
    - `name` string
    - `conditions` object
      - `bgpConditions` object
        - `afiSafiIn` string[]
        - `asPathLength` object
          - `operator` string
          - `value` integer
        - `matchAsPathSet` object
          - `asPathSet` string
          - `matchSetOptions` string
        - `matchCommunitySet` object
          - `communitySet` string
          - `matchSetOptions` string
        - `matchExtCommunitySet` object
          - `communitySet` string
          - `matchSetOptions` string
        - `matchLargeCommunitySet` object
          - `communitySet` string
          - `matchSetOptions` string
        - `nextHopInList` string[]
        - `rpki` string
        - `routeType` string
      - `matchNeighborSet` object
        - `matchSetOption` string
        - `neighborSet` string
      - `matchPrefixSet` object
        - `matchSetOption` string
        - `prefixSet` string
    - `actions` object
      - `routeDisposition` string
      - `bgpActions` object
        - `setMed` string
        - `setNextHop` string
        - `setLocalPerf` integer
        - `setCommunity` object
          - `options` string
          - `setCommunityMethod` string[]
        - `setExtCommunity` object
          - `options` string
          - `setCommunityMethod` string[]
        - `setLargeCommunity` object
          - `options` string
          - `setCommunityMethod` string[]
        - `setAsPathPrepend` object
          - `as` string
          - `repeatN` integer

## Response `204`

OK

## Other responses

- `400`: Malformed arguments for API call
- `401`: Invalid authentication credentials
- `403`: Capacity insufficient
- `404`: Resource not found
- `409`: Resource Conflict.
- `500`: Internal service error
- `503`: Maintenance mode

## Changes

- **2024-06-04** `0301bcc4c3ef`: 1 info
  - endpoint added
- **2024-05-28** `3a9759e42d77`: 1 breaking
  - api path removed without deprecation
- **2024-05-24** `e435e8afd033`: 1 info
  - endpoint added
- **2023-06-29** `0e6bd4e2dcc9`: 1 breaking
  - api path removed without deprecation

[Operation history](https://skmtc.dev/loxilb-io/apis/loxilb-rest-api/changes/config/bgp/policy/definitions/post.md)

---

[API](https://skmtc.dev/loxilb-io/apis/loxilb-rest-api.md) - [All operations](https://skmtc.dev/loxilb-io/apis/loxilb-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/loxilb-io/apis/loxilb-rest-api/revisions/cb6820b4f999?raw)
