# 1 Zones API: How to create a zone

<span>*This is a series of articles dedicated to demonstrating how to get acquainted with Openprovider DNS Zones API methods.* </span>

*This is a first article in a series in which we are going to cover DNS zone creation. To get more information about our API in general, please use our [documentation portal](http://docs.openprovider.com) as your reference.*

While being a domain registrar Openprovider also provides DNS hosting for which we have an extensive API.

Zones represent the DNS zone for a domain. Each domain usually have a zone, however zones may also exist without a domain. Zones have at least 1 (but oftentimes more) records. All zones represent a combination of system records, which are records that are created automatically by us, such as SOA and NS records, as well as custom records, which are records created by users.

<span>Once you have an Openprovider account you can use the Zones API methods which will allow you to list records for a zone, as well as add, edit, and remove zone records.</span>

<span>However, first things first. Let's focus on creating a zone as our starting point.</span>

<div id="bkmrk-use-endpoint-path-be">![Entering Geo Fence icon](https://openprovider.help/uploads/images/gallery/2026-08/embedded-image-ys8iaszz.png)Use endpoint path below. Base URL is determined by both the target environment and API version.</div><div id="bkmrk-post-%7Bbase_url%7D%2Fdns%2F">```
<span><strong>POST</strong> <a href="http://docs.openprovider.com/#operation/UpdateApproverEmailAddress"><strong>{base_url}</strong></a>/dns/zones</span>
```

</div><div id="bkmrk-request-values-name-"><details><summary>REQUEST VALUES</summary>

<table><tbody><tr><td>**<span>Name</span>**</td><td>**<span>Type</span>**</td><td>**<span>Description</span>**</td></tr><tr><td>domain</td><td>string</td><td>**Required**<span>. name of a zone (domain name)</span></td></tr><tr><td>type</td><td>string</td><td>**Required.** <span>master or slave</span></td></tr><tr><td>master\_ip</td><td>string</td><td><span>Optional. required for type = slave</span></td></tr><tr><td>records</td><td>array of data</td><td>**Required** <span>for master zones</span></td></tr><tr><td>template\_name</td><td>string</td><td><span>Optional.</span></td></tr><tr><td>is\_spamexpert\_enabled</td><td>boolean</td><td><span>Optional. Enable SE subscription for a zone</span></td></tr><tr><td>secured</td><td>boolean</td><td><span>Optional. Enable DNSSEC</span></td></tr></tbody></table>

</details>  
<div id="bkmrk-request-examplecurl-"><div><details><summary>REQUEST EXAMPLE</summary>

```
curl -X POST \<br></br> 'https://api.openprovider.eu/v1beta/dns/zones' \<br></br> -H 'Authorization: ,Bearer 2831a37fb8*******90b5aac822' \<br></br> -H 'Content-Type: application/json' \<br></br> -d '{<br></br> "domain": {<br></br> "extension": "nl",<br></br> "name": "op-demozone"<br></br> },<br></br> "type": "master",<br></br> "records": [<br></br> {<br></br> "name": "acmelab0",<br></br> "ttl": "900",<br></br> "type": "TXT",<br></br> "value": "test value 0"<br></br> },<br></br> {<br></br> "name": "acmelab1",<br></br> "ttl": "900",<br></br> "type": "TXT",<br></br> "value": "test value 1"<br></br> }<br></br> ]<br></br>}'
```

</details></div><details><summary>RESPONSE EXAMPLE</summary>

  
  
  
  
  
  
</details><span>Once you have decided on the </span>[records](https://doc.openprovider.eu/API_Format_Records)<span> that your zone should store(or the absence of the latter), you can use our API endpoint, </span>`api.openprovider.eu`<span>, to send a request.</span>

<span>The 0 code that we received indicates that the zone has been successfully created.</span>  
<span>Now let's try to </span>[retrieve it](https://confluence.openprovider.nl/display/2L/How+to+create+a+zone+via+API)<span> from the API to make sure of that and change some of its records.</span>

</div></div>