> For the complete documentation index, see [llms.txt](https://docs.thewalletcrew.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.thewalletcrew.io/api-reference/advanced/email-provider.md).

# Email Provider

## Get email provider settings

> Returns \`server/emails.yml\` together with the content of \`server/scripts/email.provider.js\`.\
> A tenant with no email provider configured yet gets a definition with a null \`type\`.\
> The API key is never returned; \`hasApiKey\` indicates whether one is currently set. Omit\
> \`apiKey\` on \`PUT\` to keep the currently configured key.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"EmailProvider"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.configuration.email:read"]},{"apiKey":[]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"EmailProviderDefinition":{"required":["hasApiKey","starterScript"],"type":"object","properties":{"type":{"type":["null","string"],"description":"Provider type as stored in `server/emails.yml`. Usually one of the values of\nNeo.Web.Api.Admin.Controllers.Settings.EmailProviderController.EmailProviderType, but a tenant configured by hand may hold any other value.\nNull when this tenant has no email provider configured yet."},"from":{"description":"Sender identity. Null for the `script` provider and when nothing is configured.","$ref":"#/components/schemas/FromDefinition"},"hasApiKey":{"type":"boolean","description":"Whether an API key is currently set."},"script":{"type":["null","string"],"description":"Content of `server/scripts/email.provider.js`. Null when the tenant has no script file yet."},"starterScript":{"type":"string","description":"Starter implementation to seed a new script with."}},"additionalProperties":false,"description":"Email provider settings, with the API key redacted."},"FromDefinition":{"required":["email"],"type":"object","properties":{"email":{"type":"string","description":"Email address mail is sent from."},"name":{"type":["null","string"],"description":"Display name mail is sent from."}},"additionalProperties":false,"description":"Sender identity used by the SendGrid and Mailchimp providers."}}},"paths":{"/api/{tenantId}/admin/emailProvider":{"get":{"tags":["EmailProvider"],"summary":"Get email provider settings","description":"Returns `server/emails.yml` together with the content of `server/scripts/email.provider.js`.\nA tenant with no email provider configured yet gets a definition with a null `type`.\nThe API key is never returned; `hasApiKey` indicates whether one is currently set. Omit\n`apiKey` on `PUT` to keep the currently configured key.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Settings returned.","content":{"text/plain":{"schema":{"description":"Email provider settings, with the API key redacted.","$ref":"#/components/schemas/EmailProviderDefinition"}},"application/json":{"schema":{"description":"Email provider settings, with the API key redacted.","$ref":"#/components/schemas/EmailProviderDefinition"}},"text/json":{"schema":{"description":"Email provider settings, with the API key redacted.","$ref":"#/components/schemas/EmailProviderDefinition"}}}}}}}}}
```

## Configure email provider settings

> Replaces the provider section of \`server/emails.yml\`, leaving the resource folders untouched (or\
> defaulted to \`/locales/emails/\` when the file is being created for this tenant).\
> &#x20;           \
> The script file is only written when \`type\` is \`script\`, so switching to another provider\
> keeps the current script available to switch back to.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"EmailProvider"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.configuration.email:write"]},{"apiKey":[]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"UpdateEmailProviderRequest":{"required":["type"],"type":"object","properties":{"type":{"description":"Provider used to send mail.","$ref":"#/components/schemas/EmailProviderType"},"from":{"description":"Sender identity. Required for `sendgrid` and `mailchimp`, ignored for `script`.","$ref":"#/components/schemas/FromRequest"},"apiKey":{"type":["null","string"],"description":"API key of the provider. Omit or leave empty to keep the currently configured key, which is only\npossible when the provider type is left unchanged. Ignored for `script`."},"script":{"type":["null","string"],"description":"Content of `server/scripts/email.provider.js`. Only written when Neo.Web.Api.Admin.Controllers.Settings.EmailProviderController.UpdateEmailProviderRequest.Type is\n`script`; omit or leave empty to keep the currently configured script. Ignored for the other\nprovider types, which leave the script file untouched."}},"additionalProperties":false,"description":"Request body to configure the email provider."},"EmailProviderType":{"enum":["sendgrid","mailchimp","script"],"type":"string","description":"Email provider supported by this endpoint."},"FromRequest":{"required":["email"],"type":"object","properties":{"email":{"minLength":1,"type":"string","description":"Email address mail is sent from.","format":"email"},"name":{"type":["null","string"],"description":"Display name mail is sent from."}},"additionalProperties":false,"description":"Request body to configure the sender identity."},"EmailProviderDefinition":{"required":["hasApiKey","starterScript"],"type":"object","properties":{"type":{"type":["null","string"],"description":"Provider type as stored in `server/emails.yml`. Usually one of the values of\nNeo.Web.Api.Admin.Controllers.Settings.EmailProviderController.EmailProviderType, but a tenant configured by hand may hold any other value.\nNull when this tenant has no email provider configured yet."},"from":{"description":"Sender identity. Null for the `script` provider and when nothing is configured.","$ref":"#/components/schemas/FromDefinition"},"hasApiKey":{"type":"boolean","description":"Whether an API key is currently set."},"script":{"type":["null","string"],"description":"Content of `server/scripts/email.provider.js`. Null when the tenant has no script file yet."},"starterScript":{"type":"string","description":"Starter implementation to seed a new script with."}},"additionalProperties":false,"description":"Email provider settings, with the API key redacted."},"FromDefinition":{"required":["email"],"type":"object","properties":{"email":{"type":"string","description":"Email address mail is sent from."},"name":{"type":["null","string"],"description":"Display name mail is sent from."}},"additionalProperties":false,"description":"Sender identity used by the SendGrid and Mailchimp providers."},"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/admin/emailProvider":{"put":{"tags":["EmailProvider"],"summary":"Configure email provider settings","description":"Replaces the provider section of `server/emails.yml`, leaving the resource folders untouched (or\ndefaulted to `/locales/emails/` when the file is being created for this tenant).\n            \nThe script file is only written when `type` is `script`, so switching to another provider\nkeeps the current script available to switch back to.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"description":"Request body to configure the email provider.","$ref":"#/components/schemas/UpdateEmailProviderRequest"}},"text/json":{"schema":{"description":"Request body to configure the email provider.","$ref":"#/components/schemas/UpdateEmailProviderRequest"}},"application/*+json":{"schema":{"description":"Request body to configure the email provider.","$ref":"#/components/schemas/UpdateEmailProviderRequest"}}},"required":true},"responses":{"200":{"description":"Settings updated.","content":{"text/plain":{"schema":{"description":"Email provider settings, with the API key redacted.","$ref":"#/components/schemas/EmailProviderDefinition"}},"application/json":{"schema":{"description":"Email provider settings, with the API key redacted.","$ref":"#/components/schemas/EmailProviderDefinition"}},"text/json":{"schema":{"description":"Email provider settings, with the API key redacted.","$ref":"#/components/schemas/EmailProviderDefinition"}}}},"400":{"description":"The sender identity, the API key, or the script is missing and none is currently configured.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.thewalletcrew.io/api-reference/advanced/email-provider.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
