> 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/internal/enrolment-and-messaging/email-provider.md). Agents can also search and read this documentation through its [MCP server](https://docs.thewalletcrew.io/~gitbook/mcp).

# Email Provider

## Get e-mail provider

> Provider settings and script content. A tenant with no provider gets a null \`type\`. \`hasApiKey\` says whether a key is set; omit \`apiKey\` on \`PUT\` to keep it.

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"EmailProvider"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","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: `sendgrid`, `mailchimp`, `script`, or another type configured outside this API. Null when none is configured."},"from":{"description":"Sender identity. Null for `script` or when nothing is configured.","$ref":"#/components/schemas/FromDefinition"},"hasApiKey":{"type":"boolean","description":"Whether an API key is set. Always false for `script`."},"customDomain":{"description":"Custom sending domain. Null unless the provider is `sendgrid` with a custom domain.","$ref":"#/components/schemas/CustomDomainDefinition"},"script":{"type":["null","string"],"description":"Provider script content; null when none yet."},"starterScript":{"type":"string","description":"Starter implementation to seed a new script with."}},"additionalProperties":false,"description":"E-mail provider settings. The API key is never returned."},"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."},"CustomDomainDefinition":{"required":["dnsRecords","domain"],"type":"object","properties":{"domain":{"type":"string","description":"Domain mail is sent from."},"dnsRecords":{"type":"array","items":{"description":"A DNS record the customer creates at their own provider.","$ref":"#/components/schemas/EmailDnsRecord"},"description":"Records the customer must create at their DNS provider."}},"additionalProperties":false,"description":"Custom domain mail is sent from, with the DNS records it needs."},"EmailDnsRecord":{"required":["name","purpose","type","value"],"type":"object","properties":{"type":{"type":"string","description":"Record type, `CNAME` or `TXT`."},"name":{"type":"string","description":"Record name, fully qualified."},"value":{"type":"string","description":"Value to set."},"purpose":{"description":"What the record is for.","$ref":"#/components/schemas/EmailDnsRecordPurpose"}},"additionalProperties":false,"description":"A DNS record the customer creates at their own provider."},"EmailDnsRecordPurpose":{"enum":["sendgridValidation","dkimPrimary","dkimSecondary","dmarc"],"type":"string","description":"What a DNS record of the custom sending domain is for."},"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":{"get":{"tags":["EmailProvider"],"summary":"Get e-mail provider","description":"Provider settings and script content. A tenant with no provider gets a null `type`. `hasApiKey` says whether a key is set; omit `apiKey` on `PUT` to keep it.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Settings returned.","content":{"text/plain":{"schema":{"description":"E-mail provider settings. The API key is never returned.","$ref":"#/components/schemas/EmailProviderDefinition"}},"application/json":{"schema":{"description":"E-mail provider settings. The API key is never returned.","$ref":"#/components/schemas/EmailProviderDefinition"}},"text/json":{"schema":{"description":"E-mail provider settings. The API key is never returned.","$ref":"#/components/schemas/EmailProviderDefinition"}}}},"401":{"description":"The caller is not authenticated.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"403":{"description":"The caller lacks the `tenant.configuration.email:read` scope.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"404":{"description":"The tenant does not exist.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"429":{"description":"Over 1200 requests per minute to this endpoint for the tenant (default limit); retry after `Retry-After`.","headers":{"Retry-After":{"description":"Seconds to wait before retrying. Sent when the limiter knows it.","schema":{"type":"integer"}}},"content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}}}}}}}
```

## Update e-mail provider

> Replaces the provider. The script is saved only when \`type\` is \`script\`, so it survives a switch to another provider. A different provider type drops the previous API key and custom sending domain.\
> Example: \`{ "type": "sendgrid", "from": { "email": "<no-reply@brand.com>", "name": "Brand" }, "apiKey": "..." }\`.

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"EmailProvider"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","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. Changing it drops the previous provider's settings (API key, custom sending domain).","$ref":"#/components/schemas/EmailProviderType"},"from":{"description":"Sender identity. Required for `sendgrid` and `mailchimp`; not used by `script`.","$ref":"#/components/schemas/FromRequest"},"apiKey":{"type":["null","string"],"description":"Provider API key. Omit or leave empty to keep the current key (only if the type is unchanged). Not used by `script`."},"script":{"type":["null","string"],"description":"Script content, saved when `type` is `script`; omit or leave empty to keep the current script."}},"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. Must be a syntactically valid address, else 400.","format":"email"},"name":{"maxLength":200,"type":["null","string"],"description":"Display name, up to 200 characters, else 400. Omitted or blank means the address alone is shown."}},"additionalProperties":false,"description":"Request body to configure the sender identity."},"EmailProviderDefinition":{"required":["hasApiKey","starterScript"],"type":"object","properties":{"type":{"type":["null","string"],"description":"Provider type: `sendgrid`, `mailchimp`, `script`, or another type configured outside this API. Null when none is configured."},"from":{"description":"Sender identity. Null for `script` or when nothing is configured.","$ref":"#/components/schemas/FromDefinition"},"hasApiKey":{"type":"boolean","description":"Whether an API key is set. Always false for `script`."},"customDomain":{"description":"Custom sending domain. Null unless the provider is `sendgrid` with a custom domain.","$ref":"#/components/schemas/CustomDomainDefinition"},"script":{"type":["null","string"],"description":"Provider script content; null when none yet."},"starterScript":{"type":"string","description":"Starter implementation to seed a new script with."}},"additionalProperties":false,"description":"E-mail provider settings. The API key is never returned."},"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."},"CustomDomainDefinition":{"required":["dnsRecords","domain"],"type":"object","properties":{"domain":{"type":"string","description":"Domain mail is sent from."},"dnsRecords":{"type":"array","items":{"description":"A DNS record the customer creates at their own provider.","$ref":"#/components/schemas/EmailDnsRecord"},"description":"Records the customer must create at their DNS provider."}},"additionalProperties":false,"description":"Custom domain mail is sent from, with the DNS records it needs."},"EmailDnsRecord":{"required":["name","purpose","type","value"],"type":"object","properties":{"type":{"type":"string","description":"Record type, `CNAME` or `TXT`."},"name":{"type":"string","description":"Record name, fully qualified."},"value":{"type":"string","description":"Value to set."},"purpose":{"description":"What the record is for.","$ref":"#/components/schemas/EmailDnsRecordPurpose"}},"additionalProperties":false,"description":"A DNS record the customer creates at their own provider."},"EmailDnsRecordPurpose":{"enum":["sendgridValidation","dkimPrimary","dkimSecondary","dmarc"],"type":"string","description":"What a DNS record of the custom sending domain is for."},"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":"Update e-mail provider","description":"Replaces the provider. The script is saved only when `type` is `script`, so it survives a switch to another provider. A different provider type drops the previous API key and custom sending domain.\nExample: `{ \"type\": \"sendgrid\", \"from\": { \"email\": \"no-reply@brand.com\", \"name\": \"Brand\" }, \"apiKey\": \"...\" }`.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Provider type, sender and credentials; see the fields for what each type needs.","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; the body is the new state.","content":{"text/plain":{"schema":{"description":"E-mail provider settings. The API key is never returned.","$ref":"#/components/schemas/EmailProviderDefinition"}},"application/json":{"schema":{"description":"E-mail provider settings. The API key is never returned.","$ref":"#/components/schemas/EmailProviderDefinition"}},"text/json":{"schema":{"description":"E-mail provider settings. The API key is never returned.","$ref":"#/components/schemas/EmailProviderDefinition"}}}},"400":{"description":"Unknown `type`, invalid sender address or name, or a missing sender, API key or script with none 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"}]}}}},"401":{"description":"The caller is not authenticated.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"403":{"description":"The caller lacks the `tenant.configuration.email:write` scope.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"404":{"description":"The tenant does not exist.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"429":{"description":"Over 1200 requests per minute to this endpoint for the tenant (default limit); retry after `Retry-After`.","headers":{"Retry-After":{"description":"Seconds to wait before retrying. Sent when the limiter knows it.","schema":{"type":"integer"}}},"content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}}}}}}}
```

## Get the e-mail provider with its API key

> Global administrators only. For a global administrator who sets up the same tenant in another environment with the same\
> e-mail account. The response is never cached.

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"EmailProvider"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"security":[{"admin-bearer":[]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}}},"schemas":{"EmailProviderSecrets":{"type":"object","properties":{"type":{"type":["null","string"],"description":"Provider type: `sendgrid`, `mailchimp`, `script`, or another type configured outside this API."},"from":{"description":"Sender identity. Null for `script`.","$ref":"#/components/schemas/FromDefinition"},"apiKey":{"type":["null","string"],"description":"API key of the provider; null when none is set."}},"additionalProperties":false,"description":"E-mail provider settings with their API key."},"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/secrets":{"get":{"tags":["EmailProvider"],"summary":"Get the e-mail provider with its API key","description":"Global administrators only. For a global administrator who sets up the same tenant in another environment with the same\ne-mail account. The response is never cached.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Settings returned, with the API key.","content":{"text/plain":{"schema":{"description":"E-mail provider settings with their API key.","$ref":"#/components/schemas/EmailProviderSecrets"}},"application/json":{"schema":{"description":"E-mail provider settings with their API key.","$ref":"#/components/schemas/EmailProviderSecrets"}},"text/json":{"schema":{"description":"E-mail provider settings with their API key.","$ref":"#/components/schemas/EmailProviderSecrets"}}}},"401":{"description":"The caller is not authenticated.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"403":{"description":"The caller does not hold the required role.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"404":{"description":"The tenant has no e-mail provider.","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"}]}}}},"429":{"description":"Over 1200 requests per minute to this endpoint for the tenant (default limit); retry after `Retry-After`.","headers":{"Retry-After":{"description":"Seconds to wait before retrying. Sent when the limiter knows it.","schema":{"type":"integer"}}},"content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}}}}}}}
```

## Send the tenant's mail through a SendGrid account of the platform

> Global administrators only. Creates an API key that can only send mail, from the account the platform holds, and\
> configures the SendGrid provider with it and the account's default sender. Refused while the tenant has a\
> provider with an API key, so a key is never replaced and left active in SendGrid without anyone knowing.

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"EmailProvider"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"security":[{"admin-bearer":[]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}}},"schemas":{"IssueSendGridKeyRequest":{"required":["accountId"],"type":"object","properties":{"accountId":{"minLength":1,"pattern":"^[a-z][a-z0-9-]{1,31}$","type":"string","description":"Identifier of the SendGrid account the key is created from."},"senderName":{"maxLength":200,"type":["null","string"],"description":"Display name mail is sent from, up to 200 characters. Omit it for the account's default sender name."}},"additionalProperties":false,"description":"Request body to send the tenant's mail through a SendGrid account of the platform."},"EmailProviderDefinition":{"required":["hasApiKey","starterScript"],"type":"object","properties":{"type":{"type":["null","string"],"description":"Provider type: `sendgrid`, `mailchimp`, `script`, or another type configured outside this API. Null when none is configured."},"from":{"description":"Sender identity. Null for `script` or when nothing is configured.","$ref":"#/components/schemas/FromDefinition"},"hasApiKey":{"type":"boolean","description":"Whether an API key is set. Always false for `script`."},"customDomain":{"description":"Custom sending domain. Null unless the provider is `sendgrid` with a custom domain.","$ref":"#/components/schemas/CustomDomainDefinition"},"script":{"type":["null","string"],"description":"Provider script content; null when none yet."},"starterScript":{"type":"string","description":"Starter implementation to seed a new script with."}},"additionalProperties":false,"description":"E-mail provider settings. The API key is never returned."},"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."},"CustomDomainDefinition":{"required":["dnsRecords","domain"],"type":"object","properties":{"domain":{"type":"string","description":"Domain mail is sent from."},"dnsRecords":{"type":"array","items":{"description":"A DNS record the customer creates at their own provider.","$ref":"#/components/schemas/EmailDnsRecord"},"description":"Records the customer must create at their DNS provider."}},"additionalProperties":false,"description":"Custom domain mail is sent from, with the DNS records it needs."},"EmailDnsRecord":{"required":["name","purpose","type","value"],"type":"object","properties":{"type":{"type":"string","description":"Record type, `CNAME` or `TXT`."},"name":{"type":"string","description":"Record name, fully qualified."},"value":{"type":"string","description":"Value to set."},"purpose":{"description":"What the record is for.","$ref":"#/components/schemas/EmailDnsRecordPurpose"}},"additionalProperties":false,"description":"A DNS record the customer creates at their own provider."},"EmailDnsRecordPurpose":{"enum":["sendgridValidation","dkimPrimary","dkimSecondary","dmarc"],"type":"string","description":"What a DNS record of the custom sending domain is for."},"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/sendGridKey":{"post":{"tags":["EmailProvider"],"summary":"Send the tenant's mail through a SendGrid account of the platform","description":"Global administrators only. Creates an API key that can only send mail, from the account the platform holds, and\nconfigures the SendGrid provider with it and the account's default sender. Refused while the tenant has a\nprovider with an API key, so a key is never replaced and left active in SendGrid without anyone knowing.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"The account to create the key from.","content":{"application/json":{"schema":{"description":"Request body to send the tenant's mail through a SendGrid account of the platform.","$ref":"#/components/schemas/IssueSendGridKeyRequest"}},"text/json":{"schema":{"description":"Request body to send the tenant's mail through a SendGrid account of the platform.","$ref":"#/components/schemas/IssueSendGridKeyRequest"}},"application/*+json":{"schema":{"description":"Request body to send the tenant's mail through a SendGrid account of the platform.","$ref":"#/components/schemas/IssueSendGridKeyRequest"}}},"required":true},"responses":{"200":{"description":"Provider configured; the body is the new state.","content":{"text/plain":{"schema":{"description":"E-mail provider settings. The API key is never returned.","$ref":"#/components/schemas/EmailProviderDefinition"}},"application/json":{"schema":{"description":"E-mail provider settings. The API key is never returned.","$ref":"#/components/schemas/EmailProviderDefinition"}},"text/json":{"schema":{"description":"E-mail provider settings. The API key is never returned.","$ref":"#/components/schemas/EmailProviderDefinition"}}}},"400":{"description":"No such account, or SendGrid rejected the account's key.","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"}]}}}},"401":{"description":"The caller is not authenticated.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"403":{"description":"The caller does not hold the required role.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"404":{"description":"The tenant does not exist.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"409":{"description":"The tenant already has an e-mail provider with an API key.","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"}]}}}},"429":{"description":"Over 1200 requests per minute to this endpoint for the tenant (default limit); retry after `Retry-After`.","headers":{"Retry-After":{"description":"Seconds to wait before retrying. Sent when the limiter knows it.","schema":{"type":"integer"}}},"content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"502":{"description":"SendGrid did not answer."}}}}}}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.thewalletcrew.io/api-reference/internal/enrolment-and-messaging/email-provider.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
