> 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-delivery-import.md).

# CM.com delivery import

## Get the progress of a message's import

> The latest import of the message in the last day. An import that stopped reporting is answered as failed with\
> the code \`stopped\`.

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"CmComSync"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.cmcom.sync: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":{"CmComSyncProgress":{"required":["messageId","runId","startedAt","state","updatedAt"],"type":"object","properties":{"runId":{"type":"string","description":"Identifies the import; a new import of the same message gets a new one."},"messageId":{"type":"string","description":"CM.com's identifier of the message read."},"campaignId":{"type":["null","string"],"description":"The campaign the events are written into, found from the recipients' links; null until found."},"campaignName":{"type":["null","string"],"description":"The name of that campaign; null until found."},"dryRun":{"type":"boolean","description":"Whether this run is a dry run: true when the run only counted what it would add; Neo.Extensions.CmCom.Sync.CmComSyncProgress.Emitted then counts\nevents that would have been recorded."},"state":{"description":"Where the import stands.","$ref":"#/components/schemas/CmComSyncState"},"phase":{"description":"What the import is doing; null unless it is queued or running.","$ref":"#/components/schemas/CmComSyncPhase"},"startedAt":{"type":"string","description":"When the import was started.","format":"date-time"},"updatedAt":{"type":"string","description":"When the import last reported.","format":"date-time"},"totalRows":{"type":["null","integer"],"description":"How many recipients CM.com reports for the message; null when it reports none.","format":"int64"},"rowsRead":{"type":"integer","description":"Rows read from CM.com: a recipient is one row in each export it appears in.","format":"int64"},"emitted":{"type":"integer","description":"Events written.","format":"int64"},"alreadyKnown":{"type":"integer","description":"Events left out because the campaign already holds them.","format":"int64"},"skipped":{"type":"integer","description":"Events and rows left out for another reason: the event happened outside the last 90 days or before the campaign\nwas created, the row's link is not a link of the campaign, or its status cannot be read.","format":"int64"},"estimatedTime":{"type":"integer","description":"Rows whose export gives no processing time and whose events were dated from the message's scheduled time instead;\n0 for an import that did not count them.","format":"int64"},"noProcessedTime":{"type":"integer","description":"Rows left out, within Neo.Extensions.CmCom.Sync.CmComSyncProgress.Skipped, because the export gives no processing time and the message has no\nscheduled time to use instead; 0 for an import that did not count them.","format":"int64"},"errorCode":{"type":["null","string"],"description":"Why the import failed, as a stable code: `targetRefused`, `noLinks`, `campaignMissing`,\n`campaignBusy`, `cmcomUnavailable`, `telemetryUnavailable`, `lockLost`, `stopped` or\n`unexpected`. Null unless it failed."},"error":{"type":["null","string"],"description":"What went wrong, in words for the administrator; null unless it failed."}},"additionalProperties":false,"description":"The progress of the latest import of the deliveries of one CM.com message. Events written before an import stops\nstay written, so the counters always describe what was written."},"CmComSyncState":{"enum":["queued","running","completed","failed","cancelled"],"type":"string","description":"Where an import of CM.com deliveries stands."},"CmComSyncPhase":{"enum":["waiting","loading","undelivered","delivered"],"type":"string","description":"What a running import is doing."},"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/extensions/cmcom/sync":{"get":{"tags":["CmComSync"],"summary":"Get the progress of a message's import","description":"The latest import of the message in the last day. An import that stopped reporting is answered as failed with\nthe code `stopped`.","parameters":[{"name":"messageId","in":"query","description":"CM.com's identifier of the message.","required":true,"schema":{"type":"string"}},{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Progress returned.","content":{"text/plain":{"schema":{"description":"The progress of the latest import of the deliveries of one CM.com message. Events written before an import stops\nstay written, so the counters always describe what was written.","$ref":"#/components/schemas/CmComSyncProgress"}},"application/json":{"schema":{"description":"The progress of the latest import of the deliveries of one CM.com message. Events written before an import stops\nstay written, so the counters always describe what was written.","$ref":"#/components/schemas/CmComSyncProgress"}},"text/json":{"schema":{"description":"The progress of the latest import of the deliveries of one CM.com message. Events written before an import stops\nstay written, so the counters always describe what was written.","$ref":"#/components/schemas/CmComSyncProgress"}}}},"400":{"description":"The message id is missing.","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.cmcom.sync:read` scope.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"404":{"description":"The message had no import in the last day, or the tenant does not exist.","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"}]}}}}}}}}}
```

## Start an import of a message's deliveries

> Plans an import that finds the campaign of the message's links, reads its recipients and writes their delivery\
> events, then answers at once with its progress. One import per campaign at a time; an import that follows\
> another one into the same campaign waits a few minutes before it starts. With \`dryRun\`, the import reads and\
> checks everything but writes nothing: its \`emitted\` counts the events a real import would write, and a webhook\
> receiving delivery events does not refuse it.

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"CmComSync"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.cmcom.sync: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":{"StartCmComSyncRequest":{"required":["messageId"],"type":"object","properties":{"messageId":{"maxLength":100,"minLength":1,"type":"string","description":"CM.com's identifier of the message, as the message list returns it."},"dryRun":{"type":"boolean","description":"When true, the import only counts the events it would write and writes nothing, so its result can be checked\nbefore a real import. Defaults to false."}},"additionalProperties":false,"description":"Request body to start an import of a message's deliveries."},"CmComSyncProgress":{"required":["messageId","runId","startedAt","state","updatedAt"],"type":"object","properties":{"runId":{"type":"string","description":"Identifies the import; a new import of the same message gets a new one."},"messageId":{"type":"string","description":"CM.com's identifier of the message read."},"campaignId":{"type":["null","string"],"description":"The campaign the events are written into, found from the recipients' links; null until found."},"campaignName":{"type":["null","string"],"description":"The name of that campaign; null until found."},"dryRun":{"type":"boolean","description":"Whether this run is a dry run: true when the run only counted what it would add; Neo.Extensions.CmCom.Sync.CmComSyncProgress.Emitted then counts\nevents that would have been recorded."},"state":{"description":"Where the import stands.","$ref":"#/components/schemas/CmComSyncState"},"phase":{"description":"What the import is doing; null unless it is queued or running.","$ref":"#/components/schemas/CmComSyncPhase"},"startedAt":{"type":"string","description":"When the import was started.","format":"date-time"},"updatedAt":{"type":"string","description":"When the import last reported.","format":"date-time"},"totalRows":{"type":["null","integer"],"description":"How many recipients CM.com reports for the message; null when it reports none.","format":"int64"},"rowsRead":{"type":"integer","description":"Rows read from CM.com: a recipient is one row in each export it appears in.","format":"int64"},"emitted":{"type":"integer","description":"Events written.","format":"int64"},"alreadyKnown":{"type":"integer","description":"Events left out because the campaign already holds them.","format":"int64"},"skipped":{"type":"integer","description":"Events and rows left out for another reason: the event happened outside the last 90 days or before the campaign\nwas created, the row's link is not a link of the campaign, or its status cannot be read.","format":"int64"},"estimatedTime":{"type":"integer","description":"Rows whose export gives no processing time and whose events were dated from the message's scheduled time instead;\n0 for an import that did not count them.","format":"int64"},"noProcessedTime":{"type":"integer","description":"Rows left out, within Neo.Extensions.CmCom.Sync.CmComSyncProgress.Skipped, because the export gives no processing time and the message has no\nscheduled time to use instead; 0 for an import that did not count them.","format":"int64"},"errorCode":{"type":["null","string"],"description":"Why the import failed, as a stable code: `targetRefused`, `noLinks`, `campaignMissing`,\n`campaignBusy`, `cmcomUnavailable`, `telemetryUnavailable`, `lockLost`, `stopped` or\n`unexpected`. Null unless it failed."},"error":{"type":["null","string"],"description":"What went wrong, in words for the administrator; null unless it failed."}},"additionalProperties":false,"description":"The progress of the latest import of the deliveries of one CM.com message. Events written before an import stops\nstay written, so the counters always describe what was written."},"CmComSyncState":{"enum":["queued","running","completed","failed","cancelled"],"type":"string","description":"Where an import of CM.com deliveries stands."},"CmComSyncPhase":{"enum":["waiting","loading","undelivered","delivered"],"type":"string","description":"What a running import is doing."},"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/extensions/cmcom/sync":{"post":{"tags":["CmComSync"],"summary":"Start an import of a message's deliveries","description":"Plans an import that finds the campaign of the message's links, reads its recipients and writes their delivery\nevents, then answers at once with its progress. One import per campaign at a time; an import that follows\nanother one into the same campaign waits a few minutes before it starts. With `dryRun`, the import reads and\nchecks everything but writes nothing: its `emitted` counts the events a real import would write, and a webhook\nreceiving delivery events does not refuse it.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"description":"Request body to start an import of a message's deliveries.","$ref":"#/components/schemas/StartCmComSyncRequest"}},"text/json":{"schema":{"description":"Request body to start an import of a message's deliveries.","$ref":"#/components/schemas/StartCmComSyncRequest"}},"application/*+json":{"schema":{"description":"Request body to start an import of a message's deliveries.","$ref":"#/components/schemas/StartCmComSyncRequest"}}},"required":true},"responses":{"202":{"description":"Import planned; its progress is returned.","content":{"text/plain":{"schema":{"description":"The progress of the latest import of the deliveries of one CM.com message. Events written before an import stops\nstay written, so the counters always describe what was written.","$ref":"#/components/schemas/CmComSyncProgress"}},"application/json":{"schema":{"description":"The progress of the latest import of the deliveries of one CM.com message. Events written before an import stops\nstay written, so the counters always describe what was written.","$ref":"#/components/schemas/CmComSyncProgress"}},"text/json":{"schema":{"description":"The progress of the latest import of the deliveries of one CM.com message. Events written before an import stops\nstay written, so the counters always describe what was written.","$ref":"#/components/schemas/CmComSyncProgress"}}}},"400":{"description":"The message id is missing or over 100 characters, or no button of the message opens a link field.","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.cmcom.sync:write` scope.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"404":{"description":"CM.com is not configured for this tenant, the platform holds no account of that name, or the message was not sent over the tenant's channels.","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"}]}}}},"409":{"description":"An import of the message is in progress, or an enabled webhook receives delivery events.","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":"CM.com did not answer the request."}}}}}}
```

## Cancel a message's import

> Asks the import of the message to stop; it stops within seconds. The events it wrote stay. Nothing happens when\
> no import is in progress.

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"CmComSync"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.cmcom.sync: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":{"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/extensions/cmcom/sync":{"delete":{"tags":["CmComSync"],"summary":"Cancel a message's import","description":"Asks the import of the message to stop; it stops within seconds. The events it wrote stay. Nothing happens when\nno import is in progress.","parameters":[{"name":"messageId","in":"query","description":"CM.com's identifier of the message.","required":true,"schema":{"type":"string"}},{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Cancel requested, or no import in progress."},"400":{"description":"The message id is missing.","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.cmcom.sync:write` scope.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"404":{"description":"The tenant does not exist, or the endpoint is not available to it.","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"}]}}}}}}}}}
```


---

# 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-delivery-import.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.
