---
title: "POST /api/v1.0/maildomains/"
method: POST
path: "/api/v1.0/maildomains/"
tags: ["maildomains"]
---

# POST /api/v1.0/maildomains/

`POST /api/v1.0/maildomains/`

ViewSet for listing MailDomains the user administers.
Provides a top-level entry for mail domain administration.
Endpoint: /maildomains/<maildomain_pk>/

## Request body

- MailDomainAdminWriteRequest — Serialize mail domains for creating / editing admin view.
  - `name` string, required
  - `oidc_autojoin` boolean — Create mailboxes automatically based on OIDC emails.
  - `identity_sync` boolean — Sync mailboxes to an identity provider.
  - `custom_attributes` unknown

## Response `201`

- MailDomainAdminWrite — Serialize mail domains for creating / editing admin view.
  - `id` string, uuid, required — primary key for the record as UUID
  - `name` string, required
  - `created_at` string, date-time, required — date and time at which a record was created
  - `updated_at` string, date-time, required — date and time at which a record was last updated
  - `oidc_autojoin` boolean — Create mailboxes automatically based on OIDC emails.
  - `identity_sync` boolean — Sync mailboxes to an identity provider.
  - `custom_attributes` unknown

## Changes

- **2026-08-28** `ba0c140b76dd` — 2 warning, 1 info
  - changed the pattern of the request property `name` from `^[a-z0-9][a-z0-9.-]*[a-z0-9]$` to `^(?=.{2,253}$)(?=[a-z0-9-]{1,63}(?:\.|$))[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\.(?=[a-z0-9-]{1,63}(?:\.|$))[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)*$` (media type: application/json)
  - changed the pattern of the request property `name` from `^[a-z0-9][a-z0-9.-]*[a-z0-9]$` to `^(?=.{2,253}$)(?=[a-z0-9-]{1,63}(?:\.|$))[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\.(?=[a-z0-9-]{1,63}(?:\.|$))[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)*$` (media type: multipart/form-data)
  - the `name` response's property pattern was changed from `^[a-z0-9][a-z0-9.-]*[a-z0-9]$` to `^(?=.{2,253}$)(?=[a-z0-9-]{1,63}(?:\.|$))[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\.(?=[a-z0-9-]{1,63}(?:\.|$))[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)*$` for the status `201`

[Change history](https://skmtc.dev/betagouv/apis/messages-api/changes/api/v1.0/maildomains/post.md)

---

[API](https://skmtc.dev/betagouv/apis/messages-api.md) · [All operations](https://skmtc.dev/betagouv/apis/messages-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/betagouv/messages-api/revisions/ba0c140b76dd/schema)
