API endpoint for NetBox (or API) version #3087

Closed
opened 2025-12-29 18:25:31 +01:00 by adam · 2 comments
Owner

Originally created by @richardtector on GitHub (Dec 24, 2019).

Environment

  • Python version: 3.6.8
  • NetBox version: 2.6.9

Proposed Functionality

As changes are often made to the API data models, it would be useful to be able to check the NetBox version programmatically in order that integrations can modify their behaviour, accordingly. Perhaps GET /api/netbox/version, or GET /api/netbox could return the version plus any other relevant bits of information about the installation.

Alternatively the API could be versioned, however this might limit development flexibility.

Use Case

A recent example that caught me out going from 2.4 to 2.6 was the prefix address family being just a number in the JSON in 2.4 changing to an object with 'value' and 'label' keys. This broke an integration that I had written. Where to check in the JSON could be modified according to the NetBox version.

Database Changes

None expected.

External Dependencies

None expected.

Originally created by @richardtector on GitHub (Dec 24, 2019). ### Environment * Python version: 3.6.8 * NetBox version: 2.6.9 ### Proposed Functionality As changes are often made to the API data models, it would be useful to be able to check the NetBox version programmatically in order that integrations can modify their behaviour, accordingly. Perhaps GET /api/netbox/version, or GET /api/netbox could return the version plus any other relevant bits of information about the installation. Alternatively the API could be versioned, however this might limit development flexibility. ### Use Case A recent example that caught me out going from 2.4 to 2.6 was the prefix address family being just a number in the JSON in 2.4 changing to an object with 'value' and 'label' keys. This broke an integration that I had written. Where to check in the JSON could be modified according to the NetBox version. ### Database Changes None expected. ### External Dependencies None expected.
adam closed this issue 2025-12-29 18:25:31 +01:00
Author
Owner

@markkuleinio commented on GitHub (Dec 25, 2019):

Each API call (like http://netbox.example.com/api) response has an API-Version header included. See an example of pynetbox usage in https://github.com/netbox-community/netbox/issues/3416#issuecomment-565806949.

@markkuleinio commented on GitHub (Dec 25, 2019): Each API call (like http://netbox.example.com/api) response has an `API-Version` header included. See an example of `pynetbox` usage in https://github.com/netbox-community/netbox/issues/3416#issuecomment-565806949.
Author
Owner

@kobayashi commented on GitHub (Dec 26, 2019):

Yes, the current version can be found in response headers. Thanks @markkuleinio

@kobayashi commented on GitHub (Dec 26, 2019): Yes, the current version can be found in response headers. Thanks @markkuleinio
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3087