---
title: "Log a sent email (internal use)"
method: POST
path: "/webhooks/email-sent"
tags: ["Webhooks"]
---

# Log a sent email (internal use)

`POST /webhooks/email-sent`

## Request

- Base URL: `https://api.production.yourmedley.com`
- URL: `https://api.production.yourmedley.com/webhooks/email-sent`
- Auth: API key in header `x-api-key`

Internal endpoint called by the communications service to log emails
after they are sent via Resend. Requires x-api-key header authentication.

## Request body

- object
  - `resend_id` string: Resend's email ID (null if send failed)
  - `email_type` string, required: Type of email (invitation, welcome, etc.)
  - `from_email` string, required
  - `to_email` string, required
  - `subject` string, required
  - `user_id` string, uuid
  - `metadata` object
  - `status` 'sent' | 'failed'
  - `error_message` string

## Response `201`

Email logged successfully

## Other responses

- `400`: Invalid request - missing required fields
- `401`: Invalid or missing API key

---

[API](https://skmtc.dev/withmedley/apis/medley-api.md) - [All operations](https://skmtc.dev/withmedley/apis/medley-api/llms.txt) - [OpenAPI document](https://skmtc.dev/withmedley/apis/medley-api/revisions/40aaac5ca6bd?raw)
