# Share a toolbox

> Source: https://elaichi.ai/docs/api-reference/toolboxes/toolbox/sharetoolbox/

`POST /toolbox/{id}/share`

Resource: **Toolbox** · API: **Toolboxes**

## Path parameters

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

## Request body

- **`grantee_type`** _(string)_
  Allowed: `user`, `team`, `org`
- **`grantee_id`** _(string)_
- **`permission`** _(string)_
  Allowed: `view`, `use`, `edit`

## Code examples

### curl

```bash
curl -X POST 'https://api.elaichi.ai/toolbox/<id>/share' \
  -H 'Authorization: Bearer $ELAICHI_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"grantee_type":"user","grantee_id":"your_grantee_id","permission":"view"}'
```

### JavaScript

```javascript
const body = {
  "grantee_type": "user",
  "grantee_id": "your_grantee_id",
  "permission": "view"
};

const response = await fetch('https://api.elaichi.ai/toolbox/<id>/share', {
  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/toolbox/<id>/share"
headers = {
    "Authorization": f"Bearer {os.environ['ELAICHI_API_TOKEN']}",
    "Content-Type": "application/json",
}
payload = {
    "grantee_type": "user",
    "grantee_id": "your_grantee_id",
    "permission": "view"
}

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