Skip to contentSkip to navigationSkip to topbar
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.


Configuration Properties

configuration-properties page anchor
Property nameTypeRequiredDescriptionChild properties
enabledboolean

Optional

Not PII

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


webhook_urlstring<uri>

Optional

Stores the URL destination for the method specified in webhook_method.


webhook_methodstring

Optional

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

Optional

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


urlstring<uri>

Optional

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 MessagesLink to code sample: Fetch an Export Configuration for Messages
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function fetchExportConfiguration() {
11
const exportConfiguration = await client.bulkexports.v1
12
.exportConfiguration("Messages")
13
.fetch();
14
15
console.log(exportConfiguration.enabled);
16
}
17
18
fetchExportConfiguration();

Output

1
{
2
"url": "https://bulkexports.twilio.com/v1/Exports/Messages/Configuration",
3
"enabled": true,
4
"webhook_url": "",
5
"webhook_method": "",
6
"resource_type": "Messages"
7
}
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function fetchExportConfiguration() {
11
const exportConfiguration = await client.bulkexports.v1
12
.exportConfiguration("Calls")
13
.fetch();
14
15
console.log(exportConfiguration.enabled);
16
}
17
18
fetchExportConfiguration();

Output

1
{
2
"url": "https://bulkexports.twilio.com/v1/Exports/Messages/Configuration",
3
"enabled": true,
4
"webhook_url": "",
5
"webhook_method": "",
6
"resource_type": "Calls"
7
}

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

Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
Enabledboolean

Optional

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.


WebhookMethodstring

Optional

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

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function updateExportConfiguration() {
11
const exportConfiguration = await client.bulkexports.v1
12
.exportConfiguration("Messages")
13
.update({
14
webhookMethod: "GET",
15
webhookUrl: "https://api.your-infrastructure.com/receive-messages/",
16
});
17
18
console.log(exportConfiguration.enabled);
19
}
20
21
updateExportConfiguration();

Output

1
{
2
"url": "https://bulkexports.twilio.com/v1/Exports/Messages/Configuration",
3
"enabled": true,
4
"webhook_url": "https://api.your-infrastructure.com/receive-messages/",
5
"resource_type": "Messages",
6
"webhook_method": "GET"
7
}

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.