NetBird · Capability

NetBird REST API — Policies

NetBird REST API — Policies. 5 operations. Lead operation: List all Policies. Self-contained Naftiko capability covering one Netbird business surface.

Run with Naftiko NetbirdPolicies

What You Can Do

GET
Get — List all Policies
/v1/api/policies
POST
Post — Create a Policy
/v1/api/policies
GET
Get — Retrieve a Policy
/v1/api/policies/{policyid}
PUT
Put — Update a Policy
/v1/api/policies/{policyid}
DELETE
Delete — Delete a Policy
/v1/api/policies/{policyid}

MCP Tools

list-all-policies

List all Policies

read-only idempotent
create-policy

Create a Policy

retrieve-policy

Retrieve a Policy

read-only idempotent
update-policy

Update a Policy

idempotent
delete-policy

Delete a Policy

idempotent

Capability Spec

netbird-policies.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: NetBird REST API — Policies
  description: 'NetBird REST API — Policies. 5 operations. Lead operation: List all Policies. Self-contained Naftiko capability
    covering one Netbird business surface.'
  tags:
  - Netbird
  - Policies
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    NETBIRD_API_KEY: NETBIRD_API_KEY
capability:
  consumes:
  - type: http
    namespace: netbird-policies
    baseUri: https://api.netbird.io
    description: NetBird REST API — Policies business capability. Self-contained, no shared references.
    resources:
    - name: api-policies
      path: /api/policies
      operations:
      - name: get
        method: GET
        description: List all Policies
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: post
        method: POST
        description: Create a Policy
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: api-policies-policyId
      path: /api/policies/{policyId}
      operations:
      - name: get
        method: GET
        description: Retrieve a Policy
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: policyId
          in: path
          type: string
          description: The unique identifier of a policy
          required: true
      - name: put
        method: PUT
        description: Update a Policy
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: policyId
          in: path
          type: string
          description: The unique identifier of a policy
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
      - name: delete
        method: DELETE
        description: Delete a Policy
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: policyId
          in: path
          type: string
          description: The unique identifier of a policy
          required: true
    authentication:
      type: bearer
      token: '{{env.NETBIRD_API_KEY}}'
  exposes:
  - type: rest
    namespace: netbird-policies-rest
    port: 8080
    description: REST adapter for NetBird REST API — Policies. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1/api/policies
      name: api-policies
      description: REST surface for api-policies.
      operations:
      - method: GET
        name: get
        description: List all Policies
        call: netbird-policies.get
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: post
        description: Create a Policy
        call: netbird-policies.post
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/policies/{policyid}
      name: api-policies-policyid
      description: REST surface for api-policies-policyId.
      operations:
      - method: GET
        name: get
        description: Retrieve a Policy
        call: netbird-policies.get
        with:
          policyId: rest.policyId
        outputParameters:
        - type: object
          mapping: $.
      - method: PUT
        name: put
        description: Update a Policy
        call: netbird-policies.put
        with:
          policyId: rest.policyId
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: DELETE
        name: delete
        description: Delete a Policy
        call: netbird-policies.delete
        with:
          policyId: rest.policyId
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: netbird-policies-mcp
    port: 9090
    transport: http
    description: MCP adapter for NetBird REST API — Policies. One tool per consumed operation, routed inline through this
      capability's consumes block.
    tools:
    - name: list-all-policies
      description: List all Policies
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: netbird-policies.get
      outputParameters:
      - type: object
        mapping: $.
    - name: create-policy
      description: Create a Policy
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: netbird-policies.post
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: retrieve-policy
      description: Retrieve a Policy
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: netbird-policies.get
      with:
        policyId: tools.policyId
      outputParameters:
      - type: object
        mapping: $.
    - name: update-policy
      description: Update a Policy
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: netbird-policies.put
      with:
        policyId: tools.policyId
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: delete-policy
      description: Delete a Policy
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: netbird-policies.delete
      with:
        policyId: tools.policyId
      outputParameters:
      - type: object
        mapping: $.