[GH-ISSUE #1619] API Support #1218

Closed
opened 2026-02-26 06:36:15 +03:00 by kerem · 10 comments
Owner

Originally created by @danielpmc on GitHub (Nov 30, 2021).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1619

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
A way to create API tokens that are perm. I have been making a js API for nginx proxy manager. Its all going good and works but having to use the user token that resets every 24 - 48hours.

Describe alternatives you've considered
None at the moment. Token automatically resets every 24 - 48hours. Only way i can see around this for now is to automatically login and fetch the new token

Originally created by @danielpmc on GitHub (Nov 30, 2021). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1619 **Is your feature request related to a problem? Please describe.** No **Describe the solution you'd like** A way to create API tokens that are perm. I have been making a js API for nginx proxy manager. Its all going good and works but having to use the user token that resets every 24 - 48hours. **Describe alternatives you've considered** None at the moment. Token automatically resets every 24 - 48hours. Only way i can see around this for now is to automatically login and fetch the new token
kerem 2026-02-26 06:36:15 +03:00
Author
Owner

@Festeazy commented on GitHub (Dec 6, 2021):

You can api post the logins to get a new token, if you post {secret and identity} to ...api/tokens it'll return a new token

I added it as part of my script

BUT api keys would be cool too

<!-- gh-comment-id:987050692 --> @Festeazy commented on GitHub (Dec 6, 2021): You can api post the logins to get a new token, if you post {secret and identity} to ...api/tokens it'll return a new token I added it as part of my script BUT api keys would be cool too
Author
Owner

@crazyaccess commented on GitHub (Dec 17, 2021):

Do anyone have an example on this matter/issue ?
Like lets say i have the npm running locally on my machine and just then i wanna make a local call to the npm to change a proxy and stuff.

<!-- gh-comment-id:996435283 --> @crazyaccess commented on GitHub (Dec 17, 2021): Do anyone have an example on this matter/issue ? Like lets say i have the npm running locally on my machine and just then i wanna make a local call to the npm to change a proxy and stuff.
Author
Owner

@kmanwar89 commented on GitHub (Sep 4, 2022):

Do anyone have an example on this matter/issue ? Like lets say i have the npm running locally on my machine and just then i wanna make a local call to the npm to change a proxy and stuff.

Not sure if you're monitoring this issue still, but I'd be happy to show you how the API can be used. I'm working on expanding the documentation on it, since the developer hasn't responded to the multiple issue requests for API documentation.

I'm not a web developer, however, so it may be a slow venture..

<!-- gh-comment-id:1236425142 --> @kmanwar89 commented on GitHub (Sep 4, 2022): > Do anyone have an example on this matter/issue ? Like lets say i have the npm running locally on my machine and just then i wanna make a local call to the npm to change a proxy and stuff. Not sure if you're monitoring this issue still, but I'd be happy to show you how the API can be used. I'm working on expanding the documentation on it, since the developer hasn't responded to the *multiple* issue requests for API documentation. I'm not a web developer, however, so it may be a slow venture..
Author
Owner

@suparagroup commented on GitHub (Sep 10, 2022):

Do anyone have an example on this matter/issue ? Like lets say i have the npm running locally on my machine and just then i wanna make a local call to the npm to change a proxy and stuff.

Not sure if you're monitoring this issue still, but I'd be happy to show you how the API can be used. I'm working on expanding the documentation on it, since the developer hasn't responded to the multiple issue requests for API documentation.

I'm not a web developer, however, so it may be a slow venture..

Thats great! if you started something you can share it with the contributors...

<!-- gh-comment-id:1242593034 --> @suparagroup commented on GitHub (Sep 10, 2022): > > Do anyone have an example on this matter/issue ? Like lets say i have the npm running locally on my machine and just then i wanna make a local call to the npm to change a proxy and stuff. > > Not sure if you're monitoring this issue still, but I'd be happy to show you how the API can be used. I'm working on expanding the documentation on it, since the developer hasn't responded to the _multiple_ issue requests for API documentation. > > I'm not a web developer, however, so it may be a slow venture.. Thats great! if you started something you can share it with the contributors...
Author
Owner

@danielpmc commented on GitHub (Sep 10, 2022):

I did manage to get this working. but API tokens are temp. so i must fetch a new one every x hours to make sure it stays updated. Would be nice to have a perm API key that could be generated once logged in, maybe under the user section.
I'd be happy helping with API Docs too. as iv played a ton with NPM and know a lot about how to use the API :)

<!-- gh-comment-id:1242593433 --> @danielpmc commented on GitHub (Sep 10, 2022): I did manage to get this working. but API tokens are temp. so i must fetch a new one every x hours to make sure it stays updated. Would be nice to have a perm API key that could be generated once logged in, maybe under the user section. I'd be happy helping with API Docs too. as iv played a ton with NPM and know a lot about how to use the API :)
Author
Owner

@kmanwar89 commented on GitHub (Sep 11, 2022):

Do anyone have an example on this matter/issue ? Like lets say i have the npm running locally on my machine and just then i wanna make a local call to the npm to change a proxy and stuff.

Not sure if you're monitoring this issue still, but I'd be happy to show you how the API can be used. I'm working on expanding the documentation on it, since the developer hasn't responded to the multiple issue requests for API documentation.
I'm not a web developer, however, so it may be a slow venture..

Thats great! if you started something you can share it with the contributors...

I've never submitted a PR, so I may do that, but the gist of it is this (I use ThunderClient within Visual Studio Code instead of Postman). At this point, really what I've discovered is just:

  1. Using basic auth, send a GET to /api/tokens to get a Bearer Auth token
  2. Using the token in the next request, perform whatever commands you want to do

Unfortunately, not all functions are documented - for instance, once you click on a host and want to, say, modify some advanced settings, I don't see anywhere in the API docs where that endpoint is exposed. If I find time, I may end up reading through the source code and figuring it out myself, but I see the author (@jc21) is still active/contributing to other projects. Perhaps they can chime in and help us along in this endeavour?

<!-- gh-comment-id:1242994083 --> @kmanwar89 commented on GitHub (Sep 11, 2022): > > > Do anyone have an example on this matter/issue ? Like lets say i have the npm running locally on my machine and just then i wanna make a local call to the npm to change a proxy and stuff. > > > > > > Not sure if you're monitoring this issue still, but I'd be happy to show you how the API can be used. I'm working on expanding the documentation on it, since the developer hasn't responded to the _multiple_ issue requests for API documentation. > > I'm not a web developer, however, so it may be a slow venture.. > > Thats great! if you started something you can share it with the contributors... I've never submitted a PR, so I may do that, but the gist of it is this (I use ThunderClient within Visual Studio Code instead of Postman). At this point, really what I've discovered is just: 1) Using basic auth, send a GET to <npm server IP>/api/tokens to get a Bearer Auth token 2) Using the token in the next request, perform whatever commands you want to do Unfortunately, not all functions are documented - for instance, once you click on a host and want to, say, modify some advanced settings, I don't see anywhere in the API docs where that endpoint is exposed. If I find time, I may end up reading through the source code and figuring it out myself, but I see the author (@jc21) is still active/contributing to other projects. Perhaps they can chime in and help us along in this endeavour?
Author
Owner

@hexaaagon commented on GitHub (Apr 10, 2023):

any update?

<!-- gh-comment-id:1501864385 --> @hexaaagon commented on GitHub (Apr 10, 2023): any update?
Author
Owner

@kmanwar89 commented on GitHub (May 23, 2023):

any update?

Assuming this is directed at me - afraid not, life got in the way as it always does :) No promises to make here - maybe one day myself or someone else will get around to documenting it. Hopefully the author of the program does it before the community does!

<!-- gh-comment-id:1558255461 --> @kmanwar89 commented on GitHub (May 23, 2023): > any update? Assuming this is directed at me - afraid not, life got in the way as it always does :) No promises to make here - maybe one day myself or someone else will get around to documenting it. Hopefully the author of the program does it before the community does!
Author
Owner

@github-actions[bot] commented on GitHub (Mar 1, 2024):

Issue is now considered stale. If you want to keep it open, please comment 👍

<!-- gh-comment-id:1972305582 --> @github-actions[bot] commented on GitHub (Mar 1, 2024): Issue is now considered stale. If you want to keep it open, please comment :+1:
Author
Owner

@github-actions[bot] commented on GitHub (Apr 14, 2025):

Issue was closed due to inactivity.

<!-- gh-comment-id:2800301951 --> @github-actions[bot] commented on GitHub (Apr 14, 2025): Issue was closed due to inactivity.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#1218
No description provided.