# Create an SSO connection

> Source: https://elaichi.ai/docs/api-reference/sso-connections/sso-connection/createssoconnection/

`POST /sso-connection`

Resource: **Sso Connection** · API: **SSO connections**

## Request body

- **`name`** _(string)_
- **`protocol`** _(string)_
  Allowed: `oidc`, `saml`
- **`domains`** _(array<string>)_
- **`default_role_id`** _(string,null)_
- **`is_active`** _(boolean)_
- **`config`** _(object)_

## Code examples

### curl

```bash
curl -X POST 'https://api.elaichi.ai/sso-connection' \
  -H 'Authorization: Bearer $ELAICHI_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name":"your_name","protocol":"oidc","domains":[],"is_active":true,"config":{}}'
```

### JavaScript

```javascript
const body = {
  "name": "your_name",
  "protocol": "oidc",
  "domains": [],
  "is_active": true,
  "config": {}
};

const response = await fetch('https://api.elaichi.ai/sso-connection', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer ' + process.env.ELAICHI_API_TOKEN,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(body),
});

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

### Python

```python
import os
import requests

url = "https://api.elaichi.ai/sso-connection"
headers = {
    "Authorization": f"Bearer {os.environ['ELAICHI_API_TOKEN']}",
    "Content-Type": "application/json",
}
payload = {
    "name": "your_name",
    "protocol": "oidc",
    "domains": [],
    "is_active": True,
    "config": {}
}

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