---
title: "Generate DKIM keys"
method: POST
path: "/api/mail-service/pvt/providers/{EmailProvider}/dkim"
tags: ["DKIM configuration"]
---

# Generate DKIM keys

`POST /api/mail-service/pvt/providers/{EmailProvider}/dkim`

Create [DKIM keys](https://developers.vtex.com/docs/guides/setting-up-dkim-for-transactional-emails) for a sender that was [set up](https://help.vtex.com/en/tracks/transactional-emails--6IkJwttMw5T84mlY9RifRP/42LVaxtFb2VHX9xTZU58qC) in VTEX mail servers. 

## Permissions

Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint:

| **Product** | **Category** | **Resource** |
| --------------- | ----------------- | ----------------- |
| Message Center | Providers | **Add or edit provider** |

There are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint. To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication).

>❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations.

## Path parameters

- `EmailProvider` string, required

## Response `200`

OK

- object — DKIM key creation response body object.
  - `status` 'emailNotFound' | 'emailNotVerified' | 'created' — DKIM key generating status in string format. For the response `emailNotFound` and `emailNotVerified`, the sender email should be [set up or revised](https://developers.vtex.com/docs/guides/setting-up-dkim-for-transactional-emails).
  - `dkimKeys` string[], nullable — This field returns DKIM keys when they were successfully created, and `null` when they were not.

## Other responses

- `401` — Unauthorized

## Changes

- **2024-06-19** `57bdbbd2b85c` — 1 breaking, 3 info
  - the response's body type/format changed from ``/`` to `object`/`` for status `200`
  - removed `subschema #1, subschema #2, subschema #3` from the response body `oneOf` list for the response status `200`
  - added the optional property `dkimKeys` to the response with the `200` status
  - added the optional property `status` to the response with the `200` status
- **2024-06-19** `2728ab222b9e` — 2 breaking, 2 warning
  - added `subschema #1, subschema #2, subschema #3` to the response body `oneOf` list for the response status `200`
  - the response's body type/format changed from `object`/`` to ``/`` for status `200`
  - removed the optional property `dkimKeys` from the response with the `200` status
  - removed the optional property `status` from the response with the `200` status
- **2024-06-18** `d3f3e1242b42` — 4 breaking, 4 info
  - the response property `status` became optional for the status `401`
  - the response property `title` became optional for the status `401`
  - the response property `traceId` became optional for the status `401`
  - the response property `type` became optional for the status `401`
  - …4 more
- **2024-06-17** `574333b43075` — 1 breaking
  - the response property `status` became optional for the status `200`
- **2024-06-17** `335ed71e189d` — 2 info
  - api tag `DKIM configuration` added
  - api tag `DKIM Configuration` removed

[Full history](https://skmtc.dev/vtex/apis/message-center-api/changes/api/mail-service/pvt/providers/:EmailProvider/dkim/post.md)

---

[API](https://skmtc.dev/vtex/apis/message-center-api.md) · [All operations](https://skmtc.dev/vtex/apis/message-center-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/vtex/message-center-api/revisions/19edf6c24398/schema)
