> 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/extensions/marketing-automation/cm.com-accounts.md).

# CM.com accounts

## GET /api/admin/cmComAccounts

> List CM.com accounts

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"CmComAccounts"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"paths":{"/api/admin/cmComAccounts":{"get":{"tags":["CmComAccounts"],"summary":"List CM.com accounts","responses":{"200":{"description":"The accounts, by label. Product tokens are never returned.","content":{"text/plain":{"schema":{"type":"array","items":{"description":"A CM.com account the platform holds.","$ref":"#/components/schemas/CmComAccountResponse"}}},"application/json":{"schema":{"type":"array","items":{"description":"A CM.com account the platform holds.","$ref":"#/components/schemas/CmComAccountResponse"}}},"text/json":{"schema":{"type":"array","items":{"description":"A CM.com account the platform holds.","$ref":"#/components/schemas/CmComAccountResponse"}}}}},"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":{"CmComAccountResponse":{"required":["accountId","id","label","partnerId"],"type":"object","properties":{"id":{"type":"string","description":"The name tenants select the account by."},"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."},"accountId":{"type":"string","description":"The account's GUID at CM.com."}},"additionalProperties":false,"description":"A CM.com account 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 CM.com account

> CM.com is asked for the account's channels before the account is kept, so a wrong id or token is refused.

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"CmComAccounts"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"paths":{"/api/admin/cmComAccounts/{id}":{"put":{"tags":["CmComAccounts"],"summary":"Add or change a CM.com account","description":"CM.com is asked for the account's channels before the account is kept, so a wrong id or token is refused.","parameters":[{"name":"id","in":"path","description":"The name tenants select the account by: lowercase letters, digits and dashes, up to 64 characters.","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"The account and its token.","content":{"application/json":{"schema":{"description":"Request body to add or change a CM.com account.","$ref":"#/components/schemas/PutCmComAccountRequest"}},"text/json":{"schema":{"description":"Request body to add or change a CM.com account.","$ref":"#/components/schemas/PutCmComAccountRequest"}},"application/*+json":{"schema":{"description":"Request body to add or change a CM.com account.","$ref":"#/components/schemas/PutCmComAccountRequest"}}},"required":true},"responses":{"200":{"description":"Account kept; the body is the account without its token.","content":{"text/plain":{"schema":{"description":"A CM.com account the platform holds.","$ref":"#/components/schemas/CmComAccountResponse"}},"application/json":{"schema":{"description":"A CM.com account the platform holds.","$ref":"#/components/schemas/CmComAccountResponse"}},"text/json":{"schema":{"description":"A CM.com account the platform holds.","$ref":"#/components/schemas/CmComAccountResponse"}}}},"400":{"description":"The id is not valid, no token was given the first time, or CM.com rejected the account id or token.","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":"CM.com did not answer."}}}}},"components":{"schemas":{"PutCmComAccountRequest":{"required":["accountId","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."},"accountId":{"type":"string","description":"The account's GUID, shown on the Authentication page of the CM.com Channels app.","format":"uuid"},"productToken":{"type":["null","string"],"description":"The account's product token. Omit it to keep the stored token; required the first time."}},"additionalProperties":false,"description":"Request body to add or change a CM.com account."},"CmComAccountResponse":{"required":["accountId","id","label","partnerId"],"type":"object","properties":{"id":{"type":"string","description":"The name tenants select the account by."},"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."},"accountId":{"type":"string","description":"The account's GUID at CM.com."}},"additionalProperties":false,"description":"A CM.com account 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 CM.com account

> Does nothing when the account is unknown. A tenant still set to use it can no longer list its messages.

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"CmComAccounts"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"paths":{"/api/admin/cmComAccounts/{id}":{"delete":{"tags":["CmComAccounts"],"summary":"Remove a CM.com account","description":"Does nothing when the account is unknown. A tenant still set to use it can no longer list its messages.","parameters":[{"name":"id","in":"path","description":"The name of the account.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Account removed."},"400":{"description":"The id 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/extensions/marketing-automation/cm.com-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.
