Accessing /api/docs/ returns a 404 #8230

Closed
opened 2025-12-29 20:34:05 +01:00 by adam · 7 comments
Owner

Originally created by @palmersample on GitHub (Jun 22, 2023).

NetBox version

v3.5.3, v3.5.4

Python version

3.8

Steps to Reproduce

Was contacted by someone asking if this problem was occurring for me also. Running v3.4.2 locally and accessing https://netbox-url/api/docs/ opens the Swagger UI.

On v3.5.3 and v3.5.4, this location results in Page not found - BUT clicking the API documentation link at the bottom of the dashboard (the "page" icon) opens Swagger at the location /api/schema/swagger-ui/

This is observable on https://demo.netbox.com:

image

And the working link:
image

Expected Behavior

Swagger UI to open with API documentation

Observed Behavior

Page not found error when accessing /api/docs/

Originally created by @palmersample on GitHub (Jun 22, 2023). ### NetBox version v3.5.3, v3.5.4 ### Python version 3.8 ### Steps to Reproduce Was contacted by someone asking if this problem was occurring for me also. Running v3.4.2 locally and accessing https://netbox-url/api/docs/ opens the Swagger UI. On v3.5.3 and v3.5.4, this location results in Page not found - BUT clicking the API documentation link at the bottom of the dashboard (the "page" icon) opens Swagger at the location /api/schema/swagger-ui/ This is observable on https://demo.netbox.com: <img width="697" alt="image" src="https://github.com/netbox-community/netbox/assets/40956652/4a01ad11-057b-4888-8fb4-a9c73dab8727"> And the working link: <img width="501" alt="image" src="https://github.com/netbox-community/netbox/assets/40956652/e4a6a4dc-20d7-4f9e-b32a-b513375fe8c1"> ### Expected Behavior Swagger UI to open with API documentation ### Observed Behavior Page not found error when accessing /api/docs/
adam closed this issue 2025-12-29 20:34:05 +01:00
Author
Owner

@kkthxbye-code commented on GitHub (Jun 22, 2023):

Please read the release notes, it's right there.

https://github.com/netbox-community/netbox/releases/tag/v3.5.0

Breaking Changes

  • The REST API schema is now generated using the OpenAPI 3.0 spec
  • The URLs for the REST API schema documentation have changed:
    • /api/docs/ is now /api/schema/swagger-ui/
    • /api/redoc/ is now /api/schema/redoc/
@kkthxbye-code commented on GitHub (Jun 22, 2023): Please read the release notes, it's right there. https://github.com/netbox-community/netbox/releases/tag/v3.5.0 >Breaking Changes > * The REST API schema is now generated using the OpenAPI 3.0 spec > * The URLs for the REST API schema documentation have changed: > * * /api/docs/ is now /api/schema/swagger-ui/ > * * /api/redoc/ is now /api/schema/redoc/
Author
Owner

@palmersample commented on GitHub (Jun 22, 2023):

Perhaps the demo documentation should be updated to reflect this. There may be other references as well, as I reported this on behalf of someone that is not active here.

https://demo.netbox.dev/static/docs/rest-api/overview/

"Comprehensive, interactive documentation of all REST API endpoints is available on a running NetBox instance at /api/docs/"

It's possible that this was the source of confusion, as the demo documentation appears first when searching for "NetBox API documentation"

image
@palmersample commented on GitHub (Jun 22, 2023): Perhaps the demo documentation should be updated to reflect this. There may be other references as well, as I reported this on behalf of someone that is not active here. https://demo.netbox.dev/static/docs/rest-api/overview/ "Comprehensive, interactive documentation of all REST API endpoints is available on a running NetBox instance at /api/docs/" It's possible that this was the source of confusion, as the demo documentation appears first when searching for "NetBox API documentation" <img width="373" alt="image" src="https://github.com/netbox-community/netbox/assets/40956652/5fd487dc-2955-4c53-a9fd-c4c83a6e8f2b">
Author
Owner

@kkthxbye-code commented on GitHub (Jun 22, 2023):

Perhaps the demo documentation should be updated to reflect this.

It has been, that's the wrong URL.

https://demo.netbox.dev/static/docs/integrations/rest-api/

Comprehensive, interactive documentation of all REST API endpoints is available on a running NetBox instance at /api/schema/swagger-ui/.

Not sure how to fix google, but this repo is really only for issues relating to core netbox. I can raise it internally.

@kkthxbye-code commented on GitHub (Jun 22, 2023): > Perhaps the demo documentation should be updated to reflect this. It has been, that's the wrong URL. https://demo.netbox.dev/static/docs/integrations/rest-api/ > Comprehensive, interactive documentation of all REST API endpoints is available on a running NetBox instance at /api/schema/swagger-ui/. Not sure how to fix google, but this repo is really only for issues relating to core netbox. I can raise it internally.
Author
Owner

@palmersample commented on GitHub (Jun 22, 2023):

Totally understand about the search results - just wanted to bring it to your attention. Thank you! -P

@palmersample commented on GitHub (Jun 22, 2023): Totally understand about the search results - just wanted to bring it to your attention. Thank you! -P
Author
Owner

@jeremystretch commented on GitHub (Jun 22, 2023):

Not sure how to fix google

FWIW I did tackle this a while back under #9994 but it appears to not be working anymore. Will need to dig into that. Thanks for the heads up @palmersample!

@jeremystretch commented on GitHub (Jun 22, 2023): > Not sure how to fix google FWIW I did tackle this a while back under #9994 but it appears to not be working anymore. Will need to dig into that. Thanks for the heads up @palmersample!
Author
Owner

@palmersample commented on GitHub (Jun 22, 2023):

No problem. And I was able to confirm this was the source of confusion for the person that reported the issue to me as well.

If there's anything I can do to help, please let me know!

@palmersample commented on GitHub (Jun 22, 2023): No problem. And I was able to confirm this was the source of confusion for the person that reported the issue to me as well. If there's anything I can do to help, please let me know!
Author
Owner

@bluikko commented on GitHub (Jul 14, 2023):

The URL https://demo.netbox.dev/static/docs/rest-api/overview/#interactive-documentation definitely still claims the API docs are at /api/docs/

@bluikko commented on GitHub (Jul 14, 2023): The URL https://demo.netbox.dev/static/docs/rest-api/overview/#interactive-documentation definitely still claims the API docs are at `/api/docs/`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8230