# Add SSO connection domain

> Source: https://truto.one/docs/api-reference/admin/sso-connections/create/

`POST /sso-connection/{id}/domains`

Resource: **SSO Connections**

## Path parameters

- **`id`** _(string, required)_
  The ID of the SSO connection to add the domain to.

## Request body

- **`domain`** _(string)_
  The email domain to associate with the connection.
- **`verified`** _(boolean)_
  Pre-mark the domain verified. Honoured only for Truto staff; ignored for regular team admins (who must use the DNS TXT challenge).

## Response body

- **`team_id`** _(string)_
  The ID of the team that owns this domain.
- **`domain`** _(string)_
  The email domain associated with the SSO connection.
- **`sso_connection_id`** _(string)_
  The ID of the SSO connection this domain belongs to.
- **`verified`** _(boolean)_
  Whether this domain has been verified via the DNS TXT challenge.
- **`verification_token`** _(string)_
  The DNS TXT challenge token. Publish a TXT record `truto-domain-verification=<verification_token>` on the domain, then call the verify endpoint.
- **`created_at`** _(string)_
  The date and time when the domain was added.
- **`updated_at`** _(string)_
  The date and time when the domain was last updated.
- **`verification_record`** _(string)_
  The exact DNS TXT value to publish on the domain to prove ownership.

## Code examples

### curl

```bash
curl -X POST 'https://api.truto.one/sso-connection/{id}/domains' \
  -H 'Authorization: Bearer <your_api_token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "domain": "example.com",
  "verified": false
}'
```

### JavaScript

```javascript
const body = {
  "domain": "example.com",
  "verified": false
};

const response = await fetch('https://api.truto.one/sso-connection/{id}/domains', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer <your_api_token>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(body),
});

const data = await response.json();
console.log(data);
```

### Python

```python
import requests

url = "https://api.truto.one/sso-connection/{id}/domains"
headers = {
    "Authorization": "Bearer <your_api_token>",
    "Content-Type": "application/json",
}
params = {
}
payload = {
    "domain": "example.com",
    "verified": False
}

response = requests.post(url, headers=headers, params=params, json=payload)
print(response.json())
```
