---
title: "Validate domain's DKIM keys"
method: GET
path: "/ensure_dkim_keys_exist"
tags: ["Mail", "Mail DNS Settings"]
---

# Validate domain's DKIM keys

`GET /ensure_dkim_keys_exist`

This function confirms the validity of a DomainKeys Identified Mail (DKIM) key for one or more domains.

**Note:**

* If an existing DKIM key does **not** meet the server's security requirements, the system replaces the existing DKIM key.
* If no DKIM key exists, the system creates a new key for the domain.

## Query parameters

- `domain` string, required

## Response `200`

HTTP Request was successful.

- object
  - `data` object
    - `payload` object[] — An array of objects containing information about the domain's DKIM key validity.
      - `domain` string, domain — The domain for which the system confirmed that a valid DKIM key exists.
      - `msg` string — The domain's DKIM key status message.
      - `status` 0 | 1 — Whether the system verified that the domain's DKIM key exists. * `1` — The system verified the existence of the domain's DKIM key. * `0` — The system did **not** verify the existence of the domain's DKIM key.
  - `metadata` object
    - `command` string — The method name called.
    - `reason` string — The reason the API function failed when the `metadata.result` field is `0`. This field may display a success message when a function succeeds.
    - `result` 0 | 1 — * `1` — Success. * `0` — Failed: Check the `reason` field for more details.
    - `version` integer — The version of the API function.

---

[API](https://skmtc.net/cpanel/apis/whm-api.md) · [All operations](https://skmtc.net/cpanel/apis/whm-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cpanel/whm-api/revisions/3da41671c02c/schema)
