Introducing Bulk Export for accessing final SMS and MMS states

August 30, 2017
Written by
Tom Tobin

  • Get a flat file of message activity for a day—starting with yesterday.
  • Bulk Export access is free.
  • Available in developer preview.

We’re excited to announce a new feature called Bulk Export, which lets you access and download a flat file containing records of all your incoming and outgoing messages. It’s available in developer preview starting today. Using Bulk Export, you can now:

  • Load a data warehouse with the state of all your messages, so you can query and aggregate on it
  • Check the status of messages without going back to the Twilio API
  • Archive your usage if you have a regulatory or compliance mandate

If you’ve started using Programmable SMS, you might ask yourself…“What happened to all those messages we sent?”. Or, somebody paying for the messages is going to come and stand behind you, and when you least expect it, ask you that. Either way, now you’ll be to have the answer to that question from the Bulk Export files.

Today, you may be currently archiving the states from the callback service, or keeping the return of the API state. With the Bulk Export file, you have a easy way of getting the final state of all the messages on your account. Bulk Export allows you to get a single gzipped JSON file with an entry for each message you’ve sent or received on a given day. Once you enable Bulk Export, you’ll get a file a day, including the messages from the previous day, ordered by time in that day, available to download.

Bulk Export is useful if you’re:

  • Checking the delivery status of your messages
  • Loading message data into a data store
  • Checking how many messages were sent and received
  • Want to archive your activity somewhere else

Now you can get the Bulk Export file, look through the set of messages in it, and load that into another system.

To use it, you just have to fetch the resulting file from the Twilio API. There is one file per day, per type of communication, with the date as the name of the file.

Here’s an example of a Bulk Export JSON block.

  "date_updated": "2017-08-03T03:57:34Z",
  "date_sent": "2017-08-03T03:57:33Z",
  "date_created": "2017-08-03T03:57:32Z",
  "body": "Sent from your Twilio trial account - woot woot!!!!",
  "num_segments": 1,
  "sid": "SMandtherestofthemessagesid",
  "num_media": 0,
  "messaging_service_sid": "MGandtherestofthemessagesid",
  "account_sid": "ACandtherestoftheaccountsid",
  "from": "+14155551212",
  "error_code": null,
  "to": "+14155552389",
  "status": "delivered",
  "direction": "outbound-api"
// a lot of other messages

Now, you could load that into a database, store the files and archive them in long-term storage, or put them on a USB drive and leave that in the left luggage locker of a european train station like you are some kind of Jason Bourne.

How to Get Started

Bulk Export is generally available. You can try it here

We can’t wait to see what you build!