# How to update DHCP with API?

**URL:** <https://discourse.pi-hole.net/t/how-to-update-dhcp-with-api/34773>\
**Category:** Help\
**Created:** [June 23, 2020, 7:05am UTC](https://discourse.pi-hole.net/t/how-to-update-dhcp-with-api/34773 "2020-06-23T07:05:43Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Zac\_Clifton](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/zac_clifton/32/16830_2.png) [@Zac\_Clifton](https://discourse.pi-hole.net/u/Zac_Clifton)\
**Post date:** [June 23, 2020, 7:05am UTC](https://discourse.pi-hole.net/t/how-to-update-dhcp-with-api/34773/1 "2020-06-23T07:05:43Z")

</div>

I have a unique use case for this request.

Let me start out with I live out in the middle of nowhere and only have 1 option in provider for internet. Recently, I have been going over our allotment and decided to purchase another hot spot to decrease our internet cost. I am working to create a program, that when triggered, would change the gateway in piholes dhcp settings to the other router. How could I do this with the current api?

I know there is a RESTapi on the way but unfortunately it is not here right now.

> <https://github.com/pi-hole/FTL/pull/659/files>
>
> \*\*By submitting this pull request, I confirm the following (please check boxes, …eg \[X\]) \_Failure to fill the template will close your PR\_:\*\*
> 
> \*\*\*Please submit all pull requests against the \`development\` branch. Failure to do so will delay or deny your request\*\*\*
> 
> \- \[X\] I have read and understood the \[contributors guide\](https://github.com/pi-hole/pi-hole/blob/master/CONTRIBUTING.md).
> \- \[X\] I have checked that \[another pull request\](https://github.com/pi-hole/FTL/pulls) for this purpose does not exist.
> \- \[X\] I have considered, and confirmed that this submission will be valuable to others.
> \- \[X\] I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
> \- \[X\] I give this submission freely, and claim no ownership to its content.
> 
> \*\*How familiar are you with the codebase?:\*\*
> 
> \## 10
> 
> \---
> 
> This PR adds a fully-fledged HTTP server and JSON API to FTL.
> It will replace \`lighttpd\` and serve both the API and the next-gen web interface.
> 
> More detail is to be added here once this feature advances further.

Any help would be appreciated.

My plan B is to get a pfsense ([https://www.netgate.com/solutions/pfsense/sg-1100.html](https://www.netgate.com/solutions/pfsense/sg-1100.html)) router and have the pihole point to it and use the pfsense api to change which router the LAN is using instead of the pihole.

Thanks!!!

---

_[View the full topic](https://discourse.pi-hole.net/t/how-to-update-dhcp-with-api/34773)._
