# Domains

Domain verification lets you prove ownership of an email domain so you can create users directly within your tenant — without sending invitation emails. Once a domain is verified, any user with a matching email address can be created via the [Create user](/apis/platform/iam/guides/user-management#create-a-user-directly) endpoint.

## How it works

1. Register your domain in Aritma IAM — you receive a DNS TXT verification token
2. Publish the token as a DNS TXT record at your domain registrar
3. Aritma checks for the record and marks the domain as `Confirmed`
4. You can now create users directly for email addresses on that domain


## List verified domains

```shell curl
curl -i -X GET \
  https://api.aritma.io/core/iam/v1/domains \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'
```

## Register a domain for verification

```shell curl
curl -i -X POST \
  https://api.aritma.io/core/iam/v1/domains \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "domain": "string"
  }'
```

The response includes a `verificationToken` — a DNS TXT record value you must publish at your domain registrar:

```json
{
  "domain": "example.com",
  "status": "Pending",
  "verificationToken": "aritma-verify-00000000-0000-0000-0000-000000000000"
}
```

Add a TXT record to your DNS with the value of `verificationToken`. The record name is typically `@` (root) or a subdomain specified by your registrar.

DNS propagation
DNS changes can take up to 48 hours to propagate. The verification token is removed from the response once the domain is confirmed.

## Check domain status

Poll this endpoint to check whether verification has completed:

```shell curl
curl -i -X GET \
  https://api.aritma.io/core/iam/v1/domains/status \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'
```

| Status | Description |
|  --- | --- |
| `Pending` | The domain is registered but the DNS TXT record has not been verified yet |
| `Confirmed` | The domain is verified — you can now create users directly |
| `NotRegistered` | The domain is not registered on this tenant |


## Unregister a domain

```shell curl
curl -i -X DELETE \
  https://api.aritma.io/core/iam/v1/domains \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'
```

Warning
Unregistering a domain does not affect existing users. However, you will no longer be able to create new users directly for email addresses on that domain until you re-register and re-verify it.