# Get id of email providers

**URL:** <https://community.auth0.com/t/get-id-of-email-providers/62387>\
**Category:** Get Help\
**Tags:** terraform\
**Created:** [May 7, 2021, 6:03am UTC](https://community.auth0.com/t/get-id-of-email-providers/62387 "2021-05-07T06:03:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bart4](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/bart4/32/12699_2.png) [@bart4](https://community.auth0.com/u/bart4)\
**Post date:** [May 7, 2021, 6:03am UTC](https://community.auth0.com/t/get-id-of-email-providers/62387/1 "2021-05-07T06:03:09Z")

</div>

Hi!

I hope this is the right place to ask this question.

I’m trying to use terraform to configure an existing auth0 tenant so I can store the e-mail templates. I’m using the community Auth0 provider created by [alexkappa](https://registry.terraform.io/providers/alexkappa/auth0/latest) .

This provider works great and it is possible to create and configure email templates and email providers for new tenants / domains.

But, because I have an existing domain, I need to import these resources into terraform. It’s possible to do so by using their id.

For example, if you would like to import an existing connection you can retrieve the id of the connection by running this:

```
https://{domain}/api/v2/connections?fields=id

```

And by using that id you can import the resources to terraform:

```
terraform import auth0_connection.my_connection con_000000000000000

```

To do the same for the email provider, I need its id. But I struggling to retrieve this id and in the documentation I can’t find anything.

Perhaps it’s a silly question, but does the email template have an id? And if so, how can I retrieve it?

Thanks in advance,

Bart

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [May 7, 2021, 11:35am UTC](https://community.auth0.com/t/get-id-of-email-providers/62387/3 "2021-05-07T11:35:02Z")

</div>

Hi @bart4,

I’m not too familiar with terraform, but I might be able to help you find the data you need 🙂. Unlike connections, email templates are identified by their name instead of an ID.

[GET](https://auth0.com/docs/api/management/v2?_ga=2.246162692.1847387816.1618225160-1595415333.1607347674#!/Email_Templates/get_email_templates_by_templateName)[/api/v2/email-templates/{templateName}](https://auth0.com/docs/api/management/v2?_ga=2.246162692.1847387816.1618225160-1595415333.1607347674#!/Email_Templates/get_email_templates_by_templateName)

Example:

```auto
https://tenant-domain/api/v2/email-templates/verify_email

```

There is only one email provider per tenant, so no identifier is used.  
[GET](https://auth0.com/docs/api/management/v2?_ga=2.246162692.1847387816.1618225160-1595415333.1607347674#!/Emails/get_provider)[/api/v2/emails/provider](https://auth0.com/docs/api/management/v2?_ga=2.246162692.1847387816.1618225160-1595415333.1607347674#!/Emails/get_provider)

Example:

```auto
https://tenant-domain/api/v2/emails/provider

```

It might be helpful to look at the source code of the project you linked and take a look at the data its expecting:

- email provider script: [terraform-provider-auth0/resource\_auth0\_email.go at master · alexkappa/terraform-provider-auth0 · GitHub](https://github.com/alexkappa/terraform-provider-auth0/blob/master/auth0/resource_auth0_email.go)
- email templates: [terraform-provider-auth0/resource\_auth0\_email\_template.go at master · alexkappa/terraform-provider-auth0 · GitHub](https://github.com/alexkappa/terraform-provider-auth0/blob/master/auth0/resource_auth0_email_template.go)

---

<div class="post-metadata">

**Author:** ![bart4](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/bart4/32/12699_2.png) [@bart4](https://community.auth0.com/u/bart4)\
**Post date:** [May 10, 2021, 8:02am UTC](https://community.auth0.com/t/get-id-of-email-providers/62387/4 "2021-05-10T08:02:02Z")

</div>

Hi @stephanie.chamblee

Thanks for your reply and your explanation. Unfortunately your reply confirms what I was afraid of, the terraform provider is not _yet_ capable of importing these resources.

I tried importing the email provider resource by name but it does not work. I will try to dive in the provider source code to see if I missed something there. I will open a request at the provider and perhaps I might be able to contribute this myself.

But thank you for your answer.

Bart

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [May 25, 2021, 8:02am UTC](https://community.auth0.com/t/get-id-of-email-providers/62387/5 "2021-05-25T08:02:58Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
