Docs

Manage records with the API

Updated 10 Nov 2026 · 1 min read · Also in Հայերեն, Русский

Anything you do with records in the panel you can also do through the API, which is handy for deployments, CI pipelines and scripts. You need an API token stored in the HIMK_TOKEN environment variable.

1. Create a record

Send a POST request to the zone’s records:

bash
curl -X POST https://api.himk.am/v1/zones/example.am/records \
  -H "Authorization: Bearer $HIMK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"type": "A", "name": "www", "content": "203.0.113.10", "ttl": 300}'

The request body has four fields:

  • type — one of A, AAAA, MX, TXT, CNAME.
  • name — the name relative to the zone, for example www.
  • content — the value, for example an IP address or a host name.
  • ttl — how long resolvers may cache the record, in seconds.

2. Read the response

The API returns the new record:

json
{"id": "rec_8f2k1q", "name": "www.example.am", "type": "A", "ttl": 300}

Save the id if a script needs to change or delete the record later.

3. Run it from CI

Store the token as a secret variable named HIMK_TOKEN in your CI system, never in the repository. Use a separate token for each pipeline, so you can revoke it on its own.

Next steps