# Actions Triggers: custom-phone-provider Event Object: organization is undefined

**URL:** <https://community.auth0.com/t/actions-triggers-custom-phone-provider-event-object-organization-is-undefined/184863>\
**Category:** Get Help\
**Tags:** passwordless-sms-connection, connections\
**Created:** [April 1, 2025, 2:53pm UTC](https://community.auth0.com/t/actions-triggers-custom-phone-provider-event-object-organization-is-undefined/184863 "2025-04-01T14:53:08Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![shurel](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shurel/32/74021_2.png) [@shurel](https://community.auth0.com/u/shurel)\
**Post date:** [April 1, 2025, 2:53pm UTC](https://community.auth0.com/t/actions-triggers-custom-phone-provider-event-object-organization-is-undefined/184863/1 "2025-04-01T14:53:08Z")

</div>

When using custom phone provider, in the trigger, the event object always have an organization set to `undefined`, context:

- documentation explicitly says the organization field should be present (given an organization is sent to the `/authorize` endpoint) : `https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers/configure-a-custom-phone-provider/actions-triggers-custom-phone-provider-event-object`
- i’m using new universal login experience
- client is set with the following terraform config:

```auto
  organization_usage = "require"
  organization_require_behavior = "no_prompt"

```

- organization name is send to the `/authorize` endpoint (and `allow_organization_name_in_authentication_api` is enabled for the tenant)
- i’ve tried using the organization id for the `/authorize` endpoint without more success
- org login works well with other auth method (email, username/password, social, …) on the same client

---

<div class="post-metadata">

**Author:** ![shurel](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shurel/32/74021_2.png) [@shurel](https://community.auth0.com/u/shurel)\
**Post date:** [April 1, 2025, 2:58pm UTC](https://community.auth0.com/t/actions-triggers-custom-phone-provider-event-object-organization-is-undefined/184863/2 "2025-04-01T14:58:19Z")

</div>

Trigger action code is dead simple:

```auto
exports.onExecuteCustomPhoneProvider = async (event, api) => {
  console.log(event);
};

```

then in “Actions Logs” `event.organization` is undefined (as well as `event.connection`… which might be a related bug 🤔)

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [April 1, 2025, 9:02pm UTC](https://community.auth0.com/t/actions-triggers-custom-phone-provider-event-object-organization-is-undefined/184863/4 "2025-04-01T21:02:57Z")

</div>

Hi @shurel

Welcome to the Auth0 Community!

I want to clarify some things before moving forward:

- Inside the custom phone provider action settings, have you not configured the action with the provider’s settings or is the code provided above an example of how are you logging the event?
- Are you trying to log in using SMS as an MFA factor?
- The organization and connection details should be available in the CustomPhoneProvider action since it is being executed, however they should also show up whenever you trigger an send-phone-message action (which needsa to be set up with a custom phone provider)
- Does the console log appear after the successfull login or during the Test on the custom phone provider page

Kind Regards,  
Nik

---

<div class="post-metadata">

**Author:** ![shurel](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shurel/32/74021_2.png) [@shurel](https://community.auth0.com/u/shurel)\
**Post date:** [April 2, 2025, 6:55am UTC](https://community.auth0.com/t/actions-triggers-custom-phone-provider-event-object-organization-is-undefined/184863/5 "2025-04-02T06:55:27Z")

</div>

hello @nik.baleca  
thanks for your reply

> Inside the custom phone provider action settings, have you not configured the action with the provider’s settings or is the code provided above an example of how are you logging the event?

i have configured Twillo inside the action handler (roughly the same as the example given in auth0’s documentation here: `https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers/configure-a-custom-phone-provider/configure-a-custom-phone-provider-with-twilio-verify`)

> Are you trying to log in using SMS as an MFA factor?

no, i’m trying to use passwordless authentication with SMS

> The organization and connection details should be available in the CustomPhoneProvider action since it is being executed, however they should also show up whenever you trigger an send-phone-message action (which needsa to be set up with a custom phone provider)

passwordless auth works properly, the action is executed, i receive the SMS with the OTP code and can login properly, just the organization details are missing in the event received in the action

> Does the console log appear after the successfull login or during the Test on the custom phone provider page

yes, the `console.log` given in my example successfully appears in the dashboard “Monitoring \> Action logs (beta)”

Let me know if you need more details 🙂

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [April 2, 2025, 6:24pm UTC](https://community.auth0.com/t/actions-triggers-custom-phone-provider-event-object-organization-is-undefined/184863/6 "2025-04-02T18:24:43Z")

</div>

Hi again!

> [@shurel](#):
>
> passwordless auth works properly, the action is executed, i receive the SMS with the OTP code and can login properly, just the organization details are missing in the event received in the action

Just to make sure we are on the same page.  
What action are you talking about?  
Are you talking about the send-phone-message action? If yes, that action does not contain the `event.organization` or `event.connection` parameters

If you are talking about the code window when setting up the custom phone provider via **Branding → Phone Provider → Custom** , then this is the action window which will have event.connection and event.organization available, as mentioned in the documentation you have linked.

Otherwise, if you indeed log them inside the custom phone provider action window and they appear to be empty, could you please provide me through a DM the tenant name on which you have configured it so I can take a look for myself on the configuration?

Kind Regards,  
Nik

---

<div class="post-metadata">

**Author:** ![shurel](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shurel/32/74021_2.png) [@shurel](https://community.auth0.com/u/shurel)\
**Post date:** [April 3, 2025, 9:05am UTC](https://community.auth0.com/t/actions-triggers-custom-phone-provider-event-object-organization-is-undefined/184863/7 "2025-04-03T09:05:12Z")

</div>

Hello,  
sorry, I thought the `exports.onExecuteCustomPhoneProvider` code was explicit enough, yes i’m referring to the **Branding → Phone Provider → Custom** code section page, i send you a dm right now

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [April 7, 2025, 5:32pm UTC](https://community.auth0.com/t/actions-triggers-custom-phone-provider-event-object-organization-is-undefined/184863/8 "2025-04-07T17:32:52Z")

</div>

Hi again @shurel

I am very sorry about the delayed response to your inquiry on the matter!

I was able to fully reproduce the issue at hand on my personal tenant. Indeed, it appears that even though the documentation states that those properties are available, they seem to be returned as undefined.

I will reach out internally regarding this matter to get some additional information on the behaviour at hand, for the time being, if you wish to return those properties during a login, I would advise to create a `PostLogin Trigger` where you console log those properties and they should be visible.

In the case of the sms connection, it should contain only a `connection_id`, `name` and `strategy`, the latter two should be `sms`. In conclusion, these properties are available after the login is completed, however, the action window for the custom sms provider is not able to access them.

If you have any other questions on the matter, feel free to let me know!

Kind Regards,  
Nik

---

<div class="post-metadata">

**Author:** ![shurel](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shurel/32/74021_2.png) [@shurel](https://community.auth0.com/u/shurel)\
**Post date:** [April 8, 2025, 6:41am UTC](https://community.auth0.com/t/actions-triggers-custom-phone-provider-event-object-organization-is-undefined/184863/9 "2025-04-08T06:41:42Z")

</div>

Thanks for getting back to me,  
The plan was to select different phone provider based on the organization to send the SMS OTP, so post-login action seems to be too late in the auth flow for that. Anyways, let me know if this is an issue that will be fixed or if the documention is misleading.

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [April 8, 2025, 3:12pm UTC](https://community.auth0.com/t/actions-triggers-custom-phone-provider-event-object-organization-is-undefined/184863/10 "2025-04-08T15:12:14Z")

</div>

Got it. For your use case and for the time being, I would advise to set the orgnaization name or id inside the user metadata so that it can be accessed inside the `event.user` object. Let me know if the proposed solution is a valid workaround.

Currently, I am still waiting for the matter to be investigated, in case this topic is closed by that time (hopefully not), I will send you a DM with the update or open the topic again and post it here.

Kind Regards,  
Nik

---

<div class="post-metadata">

**Author:** ![shurel](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shurel/32/74021_2.png) [@shurel](https://community.auth0.com/u/shurel)\
**Post date:** [April 11, 2025, 7:37am UTC](https://community.auth0.com/t/actions-triggers-custom-phone-provider-event-object-organization-is-undefined/184863/11 "2025-04-11T07:37:55Z")

</div>

hello, given a not yet registered user trying to login with sms for the first time, the user does not exists, so I can’t use its metadata during the action 😕

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [April 11, 2025, 6:33pm UTC](https://community.auth0.com/t/actions-triggers-custom-phone-provider-event-object-organization-is-undefined/184863/12 "2025-04-11T18:33:07Z")

</div>

I see, I completely overlooked that. 😅

Currently, I am still waiting for an update regarding the custom provider action window, I am sorry for the delay!

Kind Regards,  
Nik

---

<div class="post-metadata">

**Author:** ![shurel](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shurel/32/74021_2.png) [@shurel](https://community.auth0.com/u/shurel)\
**Post date:** [June 17, 2025, 7:15am UTC](https://community.auth0.com/t/actions-triggers-custom-phone-provider-event-object-organization-is-undefined/184863/13 "2025-06-17T07:15:01Z")

</div>

Hello @nik.baleca  
Is there any update on the topic ?

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [June 24, 2025, 5:41pm UTC](https://community.auth0.com/t/actions-triggers-custom-phone-provider-event-object-organization-is-undefined/184863/14 "2025-06-24T17:41:34Z")

</div>

Hi again @shurel

I am sorry about the delayed response, I will be reaching out again regarding an update, I will let you know as soon as possible!

Kind Regards,  
Nik
