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

# SendGrid accounts

## GET /api/admin/sendGridAccounts

> List SendGrid accounts

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"SendGridAccounts"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"paths":{"/api/admin/sendGridAccounts":{"get":{"tags":["SendGridAccounts"],"summary":"List SendGrid accounts","responses":{"200":{"description":"The accounts, by label. API keys are never returned.","content":{"text/plain":{"schema":{"type":"array","items":{"description":"A SendGrid account whose key the platform holds.","$ref":"#/components/schemas/SendGridAccountResponse"}}},"application/json":{"schema":{"type":"array","items":{"description":"A SendGrid account whose key the platform holds.","$ref":"#/components/schemas/SendGridAccountResponse"}}},"text/json":{"schema":{"type":"array","items":{"description":"A SendGrid account whose key the platform holds.","$ref":"#/components/schemas/SendGridAccountResponse"}}}}},"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"}]}}}}}}}},"components":{"schemas":{"SendGridAccountResponse":{"required":["defaultSenderEmail","id","label","partnerId"],"type":"object","properties":{"id":{"type":"string","description":"Identifier of the account."},"label":{"type":"string","description":"Name shown in the admin console."},"partnerId":{"type":"string","description":"The partner the account belongs to; `twc` is The Wallet Crew."},"defaultSenderEmail":{"type":"string","description":"Address mail leaves from unless a tenant has its own."},"defaultSenderName":{"type":["null","string"],"description":"Display name mail leaves under; null when the address alone is shown."}},"additionalProperties":false,"description":"A SendGrid account whose key the platform holds."},"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":{}}}}}
```

## Add or change a SendGrid account

> SendGrid checks the key can create API keys before it is kept.

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"SendGridAccounts"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"paths":{"/api/admin/sendGridAccounts/{accountId}":{"put":{"tags":["SendGridAccounts"],"summary":"Add or change a SendGrid account","description":"SendGrid checks the key can create API keys before it is kept.","parameters":[{"name":"accountId","in":"path","description":"Identifier of the account: 2 to 32 lowercase letters, digits and dashes, starting with a letter.","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"The account and its key.","content":{"application/json":{"schema":{"description":"Request body to add or change a SendGrid account.","$ref":"#/components/schemas/PutSendGridAccountRequest"}},"text/json":{"schema":{"description":"Request body to add or change a SendGrid account.","$ref":"#/components/schemas/PutSendGridAccountRequest"}},"application/*+json":{"schema":{"description":"Request body to add or change a SendGrid account.","$ref":"#/components/schemas/PutSendGridAccountRequest"}}},"required":true},"responses":{"200":{"description":"Account kept; the body is the account without its key.","content":{"text/plain":{"schema":{"description":"A SendGrid account whose key the platform holds.","$ref":"#/components/schemas/SendGridAccountResponse"}},"application/json":{"schema":{"description":"A SendGrid account whose key the platform holds.","$ref":"#/components/schemas/SendGridAccountResponse"}},"text/json":{"schema":{"description":"A SendGrid account whose key the platform holds.","$ref":"#/components/schemas/SendGridAccountResponse"}}}},"400":{"description":"The identifier or sender is not valid, no key was given the first time, or SendGrid rejected the 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"}]}}}},"502":{"description":"SendGrid did not answer."}}}}},"components":{"schemas":{"PutSendGridAccountRequest":{"required":["defaultSenderEmail","label"],"type":"object","properties":{"label":{"maxLength":100,"minLength":1,"type":"string","description":"Name shown in the admin console, at most 100 characters."},"partnerId":{"pattern":"^[a-z][a-z0-9-]{1,31}$","type":"string","description":"The partner the account belongs to. Omit it for The Wallet Crew's own account."},"defaultSenderEmail":{"minLength":1,"type":"string","description":"Address mail leaves from unless a tenant has its own.","format":"email"},"defaultSenderName":{"maxLength":200,"type":["null","string"],"description":"Display name mail leaves under, up to 200 characters."},"apiKey":{"type":["null","string"],"description":"A SendGrid API key allowed to create API keys. Omit it to keep the stored key; required the first time."}},"additionalProperties":false,"description":"Request body to add or change a SendGrid account."},"SendGridAccountResponse":{"required":["defaultSenderEmail","id","label","partnerId"],"type":"object","properties":{"id":{"type":"string","description":"Identifier of the account."},"label":{"type":"string","description":"Name shown in the admin console."},"partnerId":{"type":"string","description":"The partner the account belongs to; `twc` is The Wallet Crew."},"defaultSenderEmail":{"type":"string","description":"Address mail leaves from unless a tenant has its own."},"defaultSenderName":{"type":["null","string"],"description":"Display name mail leaves under; null when the address alone is shown."}},"additionalProperties":false,"description":"A SendGrid account whose key the platform holds."},"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":{}}}}}
```

## Remove a SendGrid account

> Does nothing when the account is unknown. API keys already created from it keep working until they are revoked in SendGrid.

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"SendGridAccounts"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"paths":{"/api/admin/sendGridAccounts/{accountId}":{"delete":{"tags":["SendGridAccounts"],"summary":"Remove a SendGrid account","description":"Does nothing when the account is unknown. API keys already created from it keep working until they are revoked in SendGrid.","parameters":[{"name":"accountId","in":"path","description":"Identifier of the account.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Account removed."},"400":{"description":"The identifier is not valid.","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"}]}}}}}}}},"components":{"schemas":{"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":{}}}}}
```


---

# 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/sendgrid-accounts.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.
