# DKIM signing

> Whether the primary domain also signs mail from the team's other domains.

Every message is signed with the DKIM key of the domain it is sent from. By default, mail from the team's other domains also gets a second signature from the primary domain. Set sign_with_primary_domain to false to sign each message only with its own domain. The primary domain can still appear in the From header either way. Only a key created by a Team Administrator can read or change it. Other keys get 404.

## GET /api/v1/teams/:obfuscated_team_id/dkim_signing

Get the team's DKIM signing setting and its primary domain.

```bash request.sh
curl -sS -X GET \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  https://app.postshiba.com/api/v1/teams/KjkAJW/dkim_signing
```

```json response.json
{
  "sign_with_primary_domain": true,
  "primary_domain": "mail.example.com"
}
```

## PATCH /api/v1/teams/:obfuscated_team_id/dkim_signing

Set sign_with_primary_domain to true or false. Any other value returns 422.

```bash request.sh
curl -sS -X PATCH \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"team":{"sign_with_primary_domain":false}}' \
  https://app.postshiba.com/api/v1/teams/KjkAJW/dkim_signing
```

```json response.json
{
  "sign_with_primary_domain": false,
  "primary_domain": "mail.example.com"
}
```
