# Resend works in function test but fails after calls: API key invalid

**URL:** <https://community.retellai.com/t/resend-works-in-function-test-but-fails-after-calls-api-key-invalid/3779>\
**Category:** Support Help\
**Tags:** integrations\
**Created:** [October 28, 2026, 6:30am UTC](https://community.retellai.com/t/resend-works-in-function-test-but-fails-after-calls-api-key-invalid/3779 "2026-10-28T06:30:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![morganlisterjosh](https://yyz2.discourse-cdn.com/flex008/user_avatar/community.retellai.com/morganlisterjosh/32/2967_2.png) [@morganlisterjosh](https://community.retellai.com/u/morganlisterjosh)\
**Post date:** [October 28, 2026, 6:30am UTC](https://community.retellai.com/t/resend-works-in-function-test-but-fails-after-calls-api-key-invalid/3779/1 "2026-10-28T06:30:52Z")

</div>

My agent uses a post-call custom function called send\_call\_summary to POST to [https://api.resend.com/emails](https://api.resend.com/emails).

Entering the Authorization value in the function’s test window successfully sent an email. However, after saving the same value in the main function settings and reopening the test, it fails with HTTP 400: “API key is invalid.”

Actual call logs confirm the function runs and generates the summary, but receives the same error. Publishing the agent didn’t resolve it.

There is one Authorization header, formatted as Bearer followed by a space and the full key. The Resend key has Sending access for the correct domain.

How can I diagnose whether the saved Authorization header is being sent differently from the test override?

---

<div class="post-metadata">

**Author:** ![Shah-Fazal](https://yyz2.discourse-cdn.com/flex008/user_avatar/community.retellai.com/shah-fazal/32/2522_2.png) [@Shah-Fazal](https://community.retellai.com/u/Shah-Fazal)\
**Post date:** [October 28, 2026, 1:12pm UTC](https://community.retellai.com/t/resend-works-in-function-test-but-fails-after-calls-api-key-invalid/3779/2 "2026-10-28T13:12:52Z")

</div>

Hey @morganlisterjosh Could you please share your Agent ID and the relevant Call ID? This will help us investigate the issue further.

Thank You

---

<div class="post-metadata">

**Author:** ![morganlisterjosh](https://yyz2.discourse-cdn.com/flex008/user_avatar/community.retellai.com/morganlisterjosh/32/2967_2.png) [@morganlisterjosh](https://community.retellai.com/u/morganlisterjosh)\
**Post date:** [October 28, 2026, 4:16pm UTC](https://community.retellai.com/t/resend-works-in-function-test-but-fails-after-calls-api-key-invalid/3779/3 "2026-10-28T16:16:46Z")

</div>

AGENT ID; agent\_f1229a78d9086324c241ef9aa4

---

<div class="post-metadata">

**Author:** ![Shah-Fazal](https://yyz2.discourse-cdn.com/flex008/user_avatar/community.retellai.com/shah-fazal/32/2522_2.png) [@Shah-Fazal](https://community.retellai.com/u/Shah-Fazal)\
**Post date:** [October 28, 2026, 4:42pm UTC](https://community.retellai.com/t/resend-works-in-function-test-but-fails-after-calls-api-key-invalid/3779/4 "2026-10-28T16:42:12Z")

</div>

Hey @morganlisterjosh Could you please share any relevant Call IDs related to the issue?

Thank You

---

<div class="post-metadata">

**Author:** ![morganlisterjosh](https://yyz2.discourse-cdn.com/flex008/user_avatar/community.retellai.com/morganlisterjosh/32/2967_2.png) [@morganlisterjosh](https://community.retellai.com/u/morganlisterjosh)\
**Post date:** [October 28, 2026, 4:58pm UTC](https://community.retellai.com/t/resend-works-in-function-test-but-fails-after-calls-api-key-invalid/3779/5 "2026-10-28T16:58:07Z")

</div>

call\_7cc7060c3006815bd5d61149970

---

<div class="post-metadata">

**Author:** ![Shah-Fazal](https://yyz2.discourse-cdn.com/flex008/user_avatar/community.retellai.com/shah-fazal/32/2522_2.png) [@Shah-Fazal](https://community.retellai.com/u/Shah-Fazal)\
**Post date:** [October 28, 2026, 5:03pm UTC](https://community.retellai.com/t/resend-works-in-function-test-but-fails-after-calls-api-key-invalid/3779/6 "2026-10-28T17:03:11Z")

</div>

Hey @morganlisterjosh I’m checking this with the team and will get back to you as soon as I have an update.

Thank You
