> For the complete documentation index, see [llms.txt](https://developers.mobile-text-alerts.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.mobile-text-alerts.com/api-reference/sent-messages/export-sent-messages.md).

# Export Sent Messages

* [#get-sent-messages-export](#get-sent-messages-export "mention")
* [#get-sent-messages-export-status-trackingreportid](#get-sent-messages-export-status-trackingreportid "mention")

### How to Export Sent Messages

To export your sent message data send a request to the [#get-sent-messages-export](#get-sent-messages-export "mention") endpoint. In this request you specify your desired report parameters as query parameters. Depending on the size of the data set identified by your specified parameters, the report will either be generated synchronously or asynchronously.

#### Synchronous Exports

If an export is generated synchronously, the response to the request to generate the export will include a data object with a populated `url` field. This URL points to the hosted location of your export data via signed URL, which is valid for 24 hours.

#### Asynchronous Exports

If an export is generated asynchronously, the response to the request to generate the export will instead include a populated `trackingReportId` field and no `url`. This Tracking Report ID is an identifier you can use to call the [#get-sent-messages-export-status-trackingreportid](#get-sent-messages-export-status-trackingreportid "mention") endpoint.

You can call this endpoint at any time after initiating the export request to determine the status of the exported data. While the report is still being generated, you will receive a status of `pending` (meaning the report request is waiting to be picked up by a processing job) or `in_progress` (meaning the report is actively being generated). When the report is ready, a request to this endpoint will return a `success` status and the `fileUrl` parameter will be populated. As with synchronous requests, this URL points to the generated report via a signed URL. The expiration date/time of this URL is specified in `expirationDate`, after which the export file will no longer be available via the same URL.

## Export Sent Messages

> \# Rate Limiting\
> \
> This endpoint overrides the general rate limit with an account rate limit. Requests are limited by the authenticated account instead of the IP address. This endpoint is limited to \`2\` requests per minute

```json
{"openapi":"3.0.0","info":{"title":"Mobile Text Alerts API","version":"8.0.0"},"servers":[{"url":"https://api.mobile-text-alerts.com/v3"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"apiKey"}},"schemas":{"ExportSentMessages.Response":{"allOf":[{"$ref":"#/components/schemas/IApiResponse"},{"type":"object","properties":{"data":{"oneOf":[{"type":"object","properties":{"url":{"type":"string"},"trackingReportId":{"type":"number"}},"required":["url"]}]}},"required":["data"]}]},"IApiResponse":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"},"message":{"type":"string"},"data":{}}},"SendRequestSource":{"type":"string","enum":["control-panel","php-api","platform","node-api","ios-app","android-app","shopify-app","node-inbox","php-inbox","zipwhip-sync","scheduled","hooks","workflow","webinars","chatbot","hubspot-sync","hubspot-inbox-sync","smpp"]},"ExportFileType":{"type":"string","enum":["csv","xls"]},"MessageReportType":{"type":"string","enum":["inbound","outbound","all"]}},"responses":{"BadRequestError":{"description":"BadRequestError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[400]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["bad_request_error"]},"name":{"type":"string","enum":["MTABadRequestError"]},"requestId":{"type":"string","format":"uuid"}}}}}},"UnauthorizedError":{"description":"UnauthorizedError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[401]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["unauthorized_error"]},"name":{"type":"string","enum":["MTAUnauthorizedError"]},"requestId":{"type":"string","format":"uuid"}}}}}},"ForbiddenError":{"description":"ForbiddenError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[403]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["forbidden_error"]},"name":{"type":"string","enum":["MTAForbiddenError"]},"requestId":{"type":"string","format":"uuid"},"reason":{}}}}}},"RateLimitError":{"description":"RateLimitError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[429]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["rate_limit_error"]},"name":{"type":"string","enum":["MTARateLimitError"]},"requestId":{"type":"string","format":"uuid"}}}}}},"InternalServerError":{"description":"InternalServerError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[500]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["internal_server_error"]},"name":{"type":"string","enum":["MTAInternalServerError"]},"requestId":{"type":"string","format":"uuid"}}}}}}}},"paths":{"/sent-messages/export":{"get":{"tags":["Sent Messages"],"summary":"Export Sent Messages","description":"# Rate Limiting\n\nThis endpoint overrides the general rate limit with an account rate limit. Requests are limited by the authenticated account instead of the IP address. This endpoint is limited to `2` requests per minute","operationId":"sent_messages_export_sent_messages","responses":{"200":{"description":"Success","headers":{"RateLimit-Limit":{"description":"The maximum number of requests that the consumer is permitted to make per window","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"The number of requests remaining in the current rate limit window","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"The remaining window before the rate limit resets in milliseconds","schema":{"type":"integer"}},"Retry-After":{"description":"The number of seconds to wait before retrying the request","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"The maximum number of requests that the consumer is permitted to make per window","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests remaining in the current rate limit window","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"The remaining window before the rate limit resets in milliseconds","schema":{"type":"integer"}},"X-Request-ID":{"description":"A unique identifier for the request","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportSentMessages.Response"}}}},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"$ref":"#/components/responses/ForbiddenError"},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}},"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"number"}},{"name":"pageSize","in":"query","required":false,"schema":{"type":"number"}},{"name":"sortDirection","in":"query","required":false,"schema":{"type":"string","enum":["asc","desc","ASC","DESC"]}},{"name":"query","in":"query","required":false,"schema":{"type":"string"}},{"name":"sortBy","in":"query","required":false,"schema":{"type":"string"}},{"name":"filters","in":"query","required":false,"schema":{"type":"object","properties":{"startDate":{"type":"string"},"endDate":{"type":"string"},"source":{"$ref":"#/components/schemas/SendRequestSource"},"userId":{"type":"number"},"recipientQuery":{"type":"string"},"fromNumber":{"type":"number"}}}},{"name":"type","in":"query","required":false,"schema":{"type":"string"}},{"name":"sentBy","in":"query","required":false,"schema":{"type":"string"}},{"name":"hideAutomatedReplies","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"format","in":"query","required":true,"schema":{"$ref":"#/components/schemas/ExportFileType"}},{"name":"reportType","in":"query","required":true,"schema":{"$ref":"#/components/schemas/MessageReportType"}},{"name":"exportByEmail","in":"query","required":false,"schema":{"type":"boolean"}}]}}}}
```

## Get Sent Messages Report Status

> \# Rate Limiting\
> \
> This endpoint overrides the general rate limit with an account rate limit. Requests are limited by the authenticated account instead of the IP address. This endpoint is limited to \`15\` requests every \`15\` seconds

```json
{"openapi":"3.0.0","info":{"title":"Mobile Text Alerts API","version":"8.0.0"},"servers":[{"url":"https://api.mobile-text-alerts.com/v3"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"apiKey"}},"schemas":{"GetSentMessagesReportStatus.Response":{"allOf":[{"$ref":"#/components/schemas/IApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/IPublicTrackingReport"}},"required":["data"]}]},"IApiResponse":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"},"message":{"type":"string"},"data":{}}},"IPublicTrackingReport":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string","nullable":true},"status":{"$ref":"#/components/schemas/TrackingReportStatus"},"type":{"$ref":"#/components/schemas/TrackingReportType"},"fileUrl":{"type":"string","nullable":true},"lastDeliveryDate":{"oneOf":[{"format":"date-time","type":"string"},{"type":"string"},{"type":"string","nullable":true}]},"expirationDate":{"oneOf":[{"format":"date-time","type":"string"},{"type":"string"},{"type":"string","nullable":true}]},"createdAt":{"oneOf":[{"format":"date-time","type":"string"},{"type":"string"}]}},"required":["id","status","type","createdAt"]},"TrackingReportStatus":{"type":"string","enum":["pending","in_progress","sent","success","failed"]},"TrackingReportType":{"type":"string","enum":["smr","exp_gr_mem","exp_subs"]}},"responses":{"BadRequestError":{"description":"BadRequestError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[400]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["bad_request_error"]},"name":{"type":"string","enum":["MTABadRequestError"]},"requestId":{"type":"string","format":"uuid"}}}}}},"UnauthorizedError":{"description":"UnauthorizedError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[401]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["unauthorized_error"]},"name":{"type":"string","enum":["MTAUnauthorizedError"]},"requestId":{"type":"string","format":"uuid"}}}}}},"ForbiddenError":{"description":"ForbiddenError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[403]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["forbidden_error"]},"name":{"type":"string","enum":["MTAForbiddenError"]},"requestId":{"type":"string","format":"uuid"},"reason":{}}}}}},"RateLimitError":{"description":"RateLimitError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[429]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["rate_limit_error"]},"name":{"type":"string","enum":["MTARateLimitError"]},"requestId":{"type":"string","format":"uuid"}}}}}},"InternalServerError":{"description":"InternalServerError","content":{"application/json":{"schema":{"type":"object","properties":{"httpCode":{"type":"number","enum":[500]},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["internal_server_error"]},"name":{"type":"string","enum":["MTAInternalServerError"]},"requestId":{"type":"string","format":"uuid"}}}}}}}},"paths":{"/sent-messages/export/status/{trackingReportId}":{"get":{"tags":["Sent Messages"],"summary":"Get Sent Messages Report Status","description":"# Rate Limiting\n\nThis endpoint overrides the general rate limit with an account rate limit. Requests are limited by the authenticated account instead of the IP address. This endpoint is limited to `15` requests every `15` seconds","operationId":"sent_messages_get_sent_messages_report_status","responses":{"200":{"description":"Success","headers":{"RateLimit-Limit":{"description":"The maximum number of requests that the consumer is permitted to make per window","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"The number of requests remaining in the current rate limit window","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"The remaining window before the rate limit resets in milliseconds","schema":{"type":"integer"}},"Retry-After":{"description":"The number of seconds to wait before retrying the request","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"The maximum number of requests that the consumer is permitted to make per window","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests remaining in the current rate limit window","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"The remaining window before the rate limit resets in milliseconds","schema":{"type":"integer"}},"X-Request-ID":{"description":"A unique identifier for the request","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetSentMessagesReportStatus.Response"}}}},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/UnauthorizedError"},"403":{"$ref":"#/components/responses/ForbiddenError"},"429":{"$ref":"#/components/responses/RateLimitError"},"500":{"$ref":"#/components/responses/InternalServerError"}},"parameters":[{"name":"trackingReportId","in":"path","required":true,"schema":{"type":"string"}}]}}}}
```


---

# 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://developers.mobile-text-alerts.com/api-reference/sent-messages/export-sent-messages.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.
