Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

ExportConfiguration Resource


The Export Configuration for a resource has two uses:

  1. setting automatic generation of files by setting "enabled" to true (in the case of Editions customers)
  2. setting the callback method for when the automatic generation of the file has been completed

You can send this via:

  • webhook
  • email

The webhook_method must be either GET or POST, and webhook_url should be the URL of the service you want to call when the file is available. For email, the email parameter should be an email address.


ExportConfiguration Properties

exportconfiguration-properties page anchor
Property nameTypePIIDescription
enabledboolean
Not PII

If true, Twilio will automatically generate every day's file when the day is over.


webhook_urlstring<uri>

Stores the URL destination for the method specified in webhook_method.


webhook_methodstring

Sets whether Twilio should call a webhook URL when the automatic generation is complete, using GET or POST. The actual destination is set in the webhook_url


resource_typestring

The type of communication – Messages, Calls, Conferences, and Participants


urlstring<uri>

The URL of this resource.


Fetch an ExportConfiguration resource

fetch-an-exportconfiguration-resource page anchor
GET https://bulkexports.twilio.com/v1/Exports/{ResourceType}/Configuration

Path parameters

path-parameters page anchor
Property nameTypeRequiredPIIDescription
ResourceTypestringrequired

The type of communication – Messages, Calls, Conferences, and Participants

Fetch an Export Configuration for Messages

fetch-an-export-configuration-for-messages page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_18
// Download the helper library from https://www.twilio.com/docs/node/install
_18
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18
_18
// Find your Account SID and Auth Token at twilio.com/console
_18
// and set the environment variables. See http://twil.io/secure
_18
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18
const authToken = process.env.TWILIO_AUTH_TOKEN;
_18
const client = twilio(accountSid, authToken);
_18
_18
async function fetchExportConfiguration() {
_18
const exportConfiguration = await client.bulkexports.v1
_18
.exportConfiguration("Messages")
_18
.fetch();
_18
_18
console.log(exportConfiguration.enabled);
_18
}
_18
_18
fetchExportConfiguration();

Output

_10
{
_10
"url": "https://bulkexports.twilio.com/v1/Exports/Messages/Configuration",
_10
"enabled": true,
_10
"webhook_url": "",
_10
"webhook_method": "",
_10
"resource_type": "Messages"
_10
}

Fetch a Export Configuration for Calls

fetch-a-export-configuration-for-calls page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_18
// Download the helper library from https://www.twilio.com/docs/node/install
_18
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18
_18
// Find your Account SID and Auth Token at twilio.com/console
_18
// and set the environment variables. See http://twil.io/secure
_18
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18
const authToken = process.env.TWILIO_AUTH_TOKEN;
_18
const client = twilio(accountSid, authToken);
_18
_18
async function fetchExportConfiguration() {
_18
const exportConfiguration = await client.bulkexports.v1
_18
.exportConfiguration("Calls")
_18
.fetch();
_18
_18
console.log(exportConfiguration.enabled);
_18
}
_18
_18
fetchExportConfiguration();

Output

_10
{
_10
"url": "https://bulkexports.twilio.com/v1/Exports/Messages/Configuration",
_10
"enabled": true,
_10
"webhook_url": "",
_10
"webhook_method": "",
_10
"resource_type": "Calls"
_10
}


Update an ExportConfiguration resource

update-an-exportconfiguration-resource page anchor
POST https://bulkexports.twilio.com/v1/Exports/{ResourceType}/Configuration

Property nameTypeRequiredPIIDescription
ResourceTypestringrequired

The type of communication – Messages, Calls, Conferences, and Participants

Property nameTypeRequiredPIIDescription
EnabledbooleanOptional

If true, Twilio will automatically generate every day's file when the day is over.


WebhookUrlstring<uri>Optional

Stores the URL destination for the method specified in webhook_method.


WebhookMethodstringOptional

Sets whether Twilio should call a webhook URL when the automatic generation is complete, using GET or POST. The actual destination is set in the webhook_url

Update Export Configuration

update-export-configuration page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_21
// Download the helper library from https://www.twilio.com/docs/node/install
_21
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_21
_21
// Find your Account SID and Auth Token at twilio.com/console
_21
// and set the environment variables. See http://twil.io/secure
_21
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_21
const authToken = process.env.TWILIO_AUTH_TOKEN;
_21
const client = twilio(accountSid, authToken);
_21
_21
async function updateExportConfiguration() {
_21
const exportConfiguration = await client.bulkexports.v1
_21
.exportConfiguration("Messages")
_21
.update({
_21
webhookMethod: "GET",
_21
webhookUrl: "https://api.your-infrastructure.com/receive-messages/",
_21
});
_21
_21
console.log(exportConfiguration.enabled);
_21
}
_21
_21
updateExportConfiguration();

Output

_10
{
_10
"url": "https://bulkexports.twilio.com/v1/Exports/Messages/Configuration",
_10
"enabled": true,
_10
"webhook_url": "https://api.your-infrastructure.com/receive-messages/",
_10
"resource_type": "Messages",
_10
"webhook_method": "GET"
_10
}


Rate this page: