# POST /email/configs

**Resource:** [Email](./email.md)  
**Scopes:** `email-config:write`  
**Write operation:** yes

Create an email configuration. Requires from_email_handle, from_name, and staff_email. Pass the local-part only as from_email_handle (e.g. "support") -- the server composes the full address as support@mail.trustpager.net. Passing the legacy from_email field returns error code FROM_EMAIL_NOT_WRITABLE. Invalid handles return INVALID_FROM_EMAIL_HANDLE. gmail_sender_alias must already exist as a "Send mail as" address on the connected Gmail account assigned to this workspace (ALIAS_NOT_CONNECTED otherwise). See GET /email/capabilities for available send_as_aliases.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `from_email_handle` | body | string | yes | Local-part of the Postmark sender address (e.g. "support"). The server appends @mail.trustpager.net. Must be 1-64 lowercase chars (a-z, 0-9, dot, underscore, hyphen), starting with a letter or digit. Error code INVALID_FROM_EMAIL_HANDLE if validation fails. Passing the old from_email field returns FROM_EMAIL_NOT_WRITABLE. |
| `from_name` | body | string | yes | Sender display name |
| `staff_email` | body | string | yes | Staff notification email |
| `config_name` | body | string | no | Config display name |
| `logo_url` | body | string | no | Logo URL for emails |
| `primary_color` | body | string | no | Primary brand color hex |
| `is_default` | body | boolean | no | Set as default config |
| `gmail_sender_user_id` | body | uuid | no | User UUID whose connected Gmail account owns the alias. Required when setting gmail_sender_alias. Error code GMAIL_NOT_CONNECTED if user has no active Gmail connection. |
| `gmail_sender_alias` | body | string | no | Gmail send-as alias for send_gmail_email automations. Must already exist as a "Send mail as" address on the connected Gmail account AND be assigned to this workspace at /settings/email. Error code ALIAS_NOT_CONNECTED if the alias is not found. Error code GMAIL_USER_REQUIRED if gmail_sender_user_id is omitted. |

---
Base URL: `https://api.trustpager.com/functions/v1/api/v1` — Auth: `Authorization: Bearer YOUR_API_KEY`