(Sorry I'm not really sure where to look for this info)
Will v6 have a "full" API, meaning that it will be possible to perform all tasks, including creating e.g. DNS records and CNAME records through it eventually? I would see a great use case for that for adding those records through automation (e.g. Ansible)
Ah great, though that looks like a difficult to use API endpoint. This way, DNS record management (and DHCP lease management) is almost hidden away in a corner of the general settings API endpoint.
I had hoped it would be more like
/dns/A/${host}/${ip} and /dns/CNAME/${alias}/${host} or something like that, that would be a lot easier to do CRUD on, and DNS records would be a first class object that way
Any idea on whether you can GET a single record (/api/config/dns/hosts/test or /api/config/dns/hosts/10.10.10.10)? How do you DELETE a record? Send a DELETE to /api/config/dns/hosts/test or send the whole JSON structure with all records, minus the one I want to delete, to /api/config/dns/hosts?
You said you already found the API documentation. It is abstract but it is this only to be generic and complete. Whenever you click on the individual endpoints, you will see examples.
In general, the API really follows the REST principle so, when you create an item using
yous should be able to undo this with DELETE localhost/api/config/dns/hosts/10.10.10.10%20test
As the HTTP standard does not allow DELETE to have any payload, you can see the result based on the returned HTTP status code. All possible codes are described in the API documentation:
This is not available. The reason is that you'd have to know the exact entry (in the example we're using here that'd be "10.10.10.10%20test") and - in case you know that - the entire GET request is pointless. Usually, all config endpoints are manipulated only through PATCH (like editing the file), Pi-hole adds the PUT and DELETE options for you pure convenience to those config options which are of type "array of strings" to ease handling from external scripts (no JSON parsing required).