---
title: "Verify a DNS token for a domain"
method: POST
path: "/domainverification/verifydnstoken"
tags: ["Domain verification"]
---

# Verify a DNS token for a domain

`POST /domainverification/verifydnstoken`

## Request

- Base URL: `https://haveibeenpwned.com/api/v3`
- URL: `https://haveibeenpwned.com/api/v3/domainverification/verifydnstoken`
- Auth: API key in header `hibp-api-key`

Available on Pro subscriptions. Checks the hibp-verify TXT record on the requested domain and, if it matches the previously generated token, marks the domain as verified for domain search.

## Headers

- `user-agent` string, required

## Request body

- DomainVerificationRequest
  - `DomainName` string, required: Domain name to generate or verify a domain-verification token for.

## Response `200`

The domain was successfully verified.

## Other responses

- `400`: Bad request - the request body was invalid, the domain was invalid, or the domain cannot be verified.
- `401`: Unauthorized - the hibp-api-key header was missing, malformed, or invalid.
- `403`: Forbidden - no user agent has been specified in the request, or the current subscription does not include permission to add domains via the API.
- `404`: Not found - no matching hibp-verify TXT record was found on the domain.

## Changes

- **2026-11-16** `7bd47da8c4f3`: 5 breaking, 3 info
  - the response's body type changed from `object` to no type for status `401`
  - the response's body type changed from `object` to no type for status `403`
  - removed the required property `message` from the response with the `401` status
  - removed the required property `message` from the response with the `403` status
  - …4 more
- **2026-09-11** `1bb60b713979`: 2 info
  - api operation id `verifyDomainDnsToken` was added
  - api tag `Domain verification` added
- **2026-07-13** `88f801b9a10d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/haveibeenpwned/apis/have-i-been-pwned-api-v3/changes/domainverification/verifydnstoken/post.md)

---

[API](https://skmtc.dev/haveibeenpwned/apis/have-i-been-pwned-api-v3.md) - [All operations](https://skmtc.dev/haveibeenpwned/apis/have-i-been-pwned-api-v3/llms.txt) - [OpenAPI document](https://skmtc.dev/haveibeenpwned/apis/have-i-been-pwned-api-v3/revisions/52f578954670?raw)
