# Models

Shared parameter shapes used across Hostraha reseller endpoints, with form-encoding examples.

Several endpoints share the same nested parameter shapes. This page documents each model and how to encode it as `application/x-www-form-urlencoded`.

## Form-encoding

All nested parameters use PHP `http_build_query` bracket notation. Objects use named keys, arrays use numeric or empty brackets:

- Object field: `contacts[registrant][firstname]=Jane`
- Array of scalars: `tldsToInclude[]=.com`
- Array of objects: `dnsrecords[0][hostname]=@`

The examples under each model below show the exact keys to send.

## Contact

A single contact. Used inside [Contacts](#contacts) and [Contact details](#contact-details).

<ResponseField name="firstname" type="text" required>First name.</ResponseField>
<ResponseField name="lastname" type="text" required>Last name.</ResponseField>
<ResponseField name="fullname" type="text" required>Full name.</ResponseField>
<ResponseField name="companyname" type="text" required>Company name.</ResponseField>
<ResponseField name="email" type="text" required>Email address.</ResponseField>
<ResponseField name="address1" type="text" required>Street address, line 1.</ResponseField>
<ResponseField name="address2" type="text">Street address, line 2.</ResponseField>
<ResponseField name="city" type="text" required>City.</ResponseField>
<ResponseField name="state" type="text" required>State or province.</ResponseField>
<ResponseField name="postcode" type="text" required>Postal or ZIP code.</ResponseField>
<ResponseField name="country" type="text" required>Two-letter country code.</ResponseField>
<ResponseField name="phonenumber" type="text" required>Phone number.</ResponseField>

## Contacts

The `contacts` parameter used by [register](/api-reference/register) and [transfer](/api-reference/transfer). Each key is a [Contact](#contact) object. Keys are lowercase.

<ParamField body="registrant" type="contact" required>The domain registrant.</ParamField>
<ParamField body="tech" type="contact">Technical contact.</ParamField>
<ParamField body="billing" type="contact">Billing contact.</ParamField>
<ParamField body="admin" type="contact">Administrative contact.</ParamField>

```
contacts[registrant][firstname]=Jane
contacts[registrant][lastname]=Doe
contacts[registrant][email]=you@example.com
contacts[tech][firstname]=Jane
contacts[admin][firstname]=Jane
contacts[billing][firstname]=Jane
```

## Contact details

The `contactdetails` parameter used by `POST /domains/{domain}/contact` in [Contacts](/api-reference/contacts). Each key is a [Contact](#contact) object.

<Warning>
  The keys here are **capitalized** — `Registrant`, `Technical`, `Billing`, `Admin` — and differ from the lowercase `contacts` keys used when ordering. Use the exact casing shown.
</Warning>

<ParamField body="Registrant" type="contact" required>The domain registrant.</ParamField>
<ParamField body="Technical" type="contact" required>Technical contact.</ParamField>
<ParamField body="Billing" type="contact" required>Billing contact.</ParamField>
<ParamField body="Admin" type="contact" required>Administrative contact.</ParamField>

```
contactdetails[Registrant][firstname]=Jane
contactdetails[Registrant][email]=you@example.com
contactdetails[Technical][firstname]=Jane
contactdetails[Billing][firstname]=Jane
contactdetails[Admin][firstname]=Jane
```

## Nameservers

The `nameservers` parameter used by [register](/api-reference/register), [transfer](/api-reference/transfer), and `POST /domains/{domain}/nameservers`. Up to five nameservers; the first two are required.

<ParamField body="ns1" type="text" required>Primary nameserver.</ParamField>
<ParamField body="ns2" type="text" required>Secondary nameserver.</ParamField>
<ParamField body="ns3" type="text">Third nameserver.</ParamField>
<ParamField body="ns4" type="text">Fourth nameserver.</ParamField>
<ParamField body="ns5" type="text">Fifth nameserver.</ParamField>

```
nameservers[ns1]=ns1.hostraha.com
nameservers[ns2]=ns2.hostraha.com
nameservers[ns3]=ns3.hostraha.com
```

## DNS records

The `dnsrecords` parameter used by `POST /domains/{domain}/dns` in [DNS](/api-reference/dns). An array of record objects, indexed from `0`.

<ParamField body="hostname" type="text" required>Record host, for example `@` or `www`.</ParamField>
<ParamField body="type" type="text" required>Record type, for example `A`, `CNAME`, or `MX`.</ParamField>
<ParamField body="address" type="text" required>Record value or target.</ParamField>
<ParamField body="priority" type="numeric" required>Priority, for example `0`. Used by `MX` and `SRV` records.</ParamField>
<ParamField body="recid" type="text">Record ID. Present on existing records; omit when creating a new one.</ParamField>

```
dnsrecords[0][hostname]=@
dnsrecords[0][type]=A
dnsrecords[0][address]=192.0.2.1
dnsrecords[0][priority]=0
dnsrecords[1][hostname]=www
dnsrecords[1][type]=CNAME
dnsrecords[1][address]=example.com
dnsrecords[1][priority]=0
```

## Addons

The `addons` parameter used by [register](/api-reference/register), [transfer](/api-reference/transfer), and [renew](/api-reference/renew). Each field is `1` (on) or `0` (off).

<ParamField body="dnsmanagement" type="numeric">DNS management, `1` or `0`.</ParamField>
<ParamField body="emailforwarding" type="numeric">Email forwarding, `1` or `0`.</ParamField>
<ParamField body="idprotection" type="numeric">ID protection, `1` or `0`.</ParamField>

```
addons[dnsmanagement]=1
addons[emailforwarding]=0
addons[idprotection]=1
```
