# Transfer connection ownership

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

`POST /connection/{id}/transfer`

Resource: **Connection** · API: **Connections**

## Path parameters

- **`id`** _(string, required)_
  Resource id

## Request body

- **`owner_scope`** _(string)_
  Allowed: `org`, `team`, `user`
- **`team_id`** _(string)_
- **`owner_user_id`** _(string)_

## Response body

- **`id`** _(string)_
- **`connector_slug`** _(string)_
- **`name`** _(string)_
- **`scope`** _(string)_
  Allowed: `user`, `team`, `org`
- **`team_id`** _(string,null)_
- **`owner_user_id`** _(string)_
- **`saffron_account_id`** _(string,null)_
- **`status`** _(string)_
- **`last_error`** _(string,null)_
- **`created_at`** _(string)_
- **`updated_at`** _(string)_

## Code examples

### curl

```bash
curl -X POST 'https://api.elaichi.ai/connection/<id>/transfer' \
  -H 'Authorization: Bearer $ELAICHI_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"owner_scope":"org","team_id":"your_team_id","owner_user_id":"your_owner_user_id"}'
```

### JavaScript

```javascript
const body = {
  "owner_scope": "org",
  "team_id": "your_team_id",
  "owner_user_id": "your_owner_user_id"
};

const response = await fetch('https://api.elaichi.ai/connection/<id>/transfer', {
  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/connection/<id>/transfer"
headers = {
    "Authorization": f"Bearer {os.environ['ELAICHI_API_TOKEN']}",
    "Content-Type": "application/json",
}
payload = {
    "owner_scope": "org",
    "team_id": "your_team_id",
    "owner_user_id": "your_owner_user_id"
}

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