# Send a test notification

> Source: https://truto.one/docs/api-reference/admin/notification-destinations/test/

`POST /notification-destination/test`

Resource: **Notification destinations**

Sends a test notification to the destination and waits for the result. A `200` means Slack or the mail service accepted it; a `502` means it refused it.

## Request body

- **`id`** _(string)_
  The notification destination to test.

## Response body

- **`success`** _(boolean)_

## Errors

| Status | Description |
| :----- | :---------- |
| `400` | `id` is missing. |
| `404` | Notification destination not found |
| `502` | The test notification was not delivered. For Slack, `message` carries the status Slack returned plus at most the first 200 characters of its response. For email, `message` is a fixed text; the mail service's own error is not returned. |

## Code examples

### curl

```bash
curl -X POST 'https://api.truto.one/notification-destination/test' \
  -H 'Authorization: Bearer <your_api_token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "id": "your_id"
}'
```

### JavaScript

```javascript
const body = {
  "id": "your_id"
};

const response = await fetch('https://api.truto.one/notification-destination/test', {
  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/notification-destination/test"
headers = {
    "Authorization": "Bearer <your_api_token>",
    "Content-Type": "application/json",
}
params = {
}
payload = {
    "id": "your_id"
}

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