---
title: "Send a SendGrid test email"
description: "Sends a one-off test email for the current workspace's active SendGrid configuration. Builder merge fields are not contact-resolved in this test path, but unsubscribe placeholders are converted into a safe test link so raw tokens are not delivered."
---

> Documentation Index
> Fetch the complete documentation index at: https://developer.channelautomations.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Channel Automation API › Notifications

`POST /api/sendgrid/send-test-email`

Sends a one-off test email for the current workspace's active SendGrid configuration. Builder merge fields are not contact-resolved in this test path, but unsubscribe placeholders are converted into a safe test link so raw tokens are not delivered.

## Header parameters

- `x-workspace-id` (`post/api/sendgrid/send-test-email.header.x-workspace-id`; string, required) — Workspace id whose SendGrid configuration should be used.

## Request body

_Required._

- `to_email` (`post/api/sendgrid/send-test-email.to_email`; string, required)
  - format `email`
- `subject` (`post/api/sendgrid/send-test-email.subject`; string, optional)
- `html` (`post/api/sendgrid/send-test-email.html`; string, optional)

## Example request

```json
{
  "to_email": "user@example.com",
  "subject": "string",
  "html": "string"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://api.channelautomation.com/api/sendgrid/send-test-email \
  --header 'Content-Type: application/json' \
  --header 'x-workspace-id: string' \
  --data '
{
  "to_email": "user@example.com",
  "subject": "string",
  "html": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://api.channelautomation.com/api/sendgrid/send-test-email';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', 'x-workspace-id': 'string'},
  body: JSON.stringify({to_email: 'user@example.com', subject: 'string', html: 'string'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.channelautomation.com/api/sendgrid/send-test-email"

payload = {
    "to_email": "user@example.com",
    "subject": "string",
    "html": "string"
}
headers = {
    "Content-Type": "application/json",
    "x-workspace-id": "string"
}

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

print(response.text)
```

## Responses

### 200

Test email sent successfully.

### 400

Missing recipient or SendGrid is not configured.

### 500

Failed to send test email.


Source: https://developer.channelautomations.com/api/post-api-sendgrid-send-test-email/index.md
