Menu

Expand
Rate this page:

Export Custom Job Resource

Custom Jobs allow you to create exports for any date range. If the date range spans multiple days, they will generate separate output days. Jobs can be deleted with the Job resource. When a Job completes successfully, the results are visible as days in the Day resource.

ExportCustomJob properties

Resource Properties in REST API format
friendly_name
string Not PII

The friendly name specified when creating the job

resource_type
string Not PII

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

start_day
string Not PII

The start day for the custom export specified when creating the job

end_day
string Not PII

The end day for the export specified when creating the job

webhook_url
string Not PII

The optional webhook url called on completion of the job. If this is supplied, WebhookMethod must also be supplied.

webhook_method
string Not PII

This is the method used to call the webhook on completion of the job. If this is supplied, WebhookUrl must also be supplied.

email
string Not PII

The optional email to send the completion notification to

job_sid
sid<JS> Not PII

The unique job_sid returned when the custom export was created

details
object Not PII

The details of a job which is an object that contains an array of status grouped by status state. Each status object has a status string, a count which is the number of days in that status, and list of days in that status. The day strings are in the format yyyy-MM-dd. As an example, a currently running job may have a status object for COMPLETED and a status object for SUBMITTED each with its own count and list of days.

job_queue_position
string Not PII

This is the job position from the 1st in line. Your queue position will never increase. As jobs ahead of yours in the queue are processed, the queue position number will decrease

estimated_completion_time
string Not PII

this is the time estimated until your job is complete. This is calculated each time you request the job list. The time is calculated based on the current rate of job completion (which may vary) and your job queue position

ENUM:STATUS possible values in REST API format
ErrorDuringRun

The Job was attempted, but an error prevented completion. This is not a final status, the job will be retried.

Submitted

The Job has been successfully submitted and is in the queue to execute.

Running

The job is currently running. The output should be available shortly. Multiple Jobs may run at the same time. You can use the ‘estimated_completion_time’ to get a sense of when your job will be complete.

CompletedEmptyRecords

The Job has completed, however, no records for the requested resource have been found. An empty file will be available at the Day endpoint.

Completed

The Job is successfully completed, and the result files are available at the Day endpoint.

Failed

The Job was attempted, but an error prevented completion. This is a final status, as the job has already been tried multiple times and has not been successful. Try submitting the job again, or reach out to your Twilio support team if problem continues to persist.

RunningToBeDeleted

The Job is currently running, but it has been marked for deletion, and will be deleted soon.

DeletedByUserRequest

The Job has been marked for deletion. So system will not attempt to run it.

Create an ExportCustomJob resource

post
https://bulkexports.twilio.com/v1/Exports/{ResourceType}/Jobs
Parameters
Parameters in REST API format
resource_type
Path
post string Not PII

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

start_day
Required
post string Not PII

The start day for the custom export specified as a string in the format of yyyy-mm-dd

end_day
Required
post string Not PII

The end day for the custom export specified as a string in the format of yyyy-mm-dd. End day is inclusive and must be 2 days earlier than the current UTC day.

friendly_name
Required
post string Not PII

The friendly name specified when creating the job

webhook_url
Optional
post string Not PII

The optional webhook url called on completion of the job. If this is supplied, WebhookMethod must also be supplied. If you set neither webhook nor email, you will have to check your job's status manually.

webhook_method
Optional
post string Not PII

This is the method used to call the webhook on completion of the job. If this is supplied, WebhookUrl must also be supplied.

email
Optional
post string Not PII

The optional email to send the completion notification to. You can set both webhook, and email, or one or the other. If you set neither, the job will run but you will have to query to determine your job's status.

Example 1
Loading Code Sample...
        
        

        Create a new BulkExport custom job

        Read multiple ExportCustomJob resources

        get
        https://bulkexports.twilio.com/v1/Exports/{ResourceType}/Jobs
        Parameters
        Parameters in REST API format
        resource_type
        Path
        get string Not PII

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

        Example 1
        Loading Code Sample...
              
              

              Read the current list of export jobs for this resource type

              Rate this page:

              Need some help?

              We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

              Loading Code Sample...
                    
                    
                    

                    Thank you for your feedback!

                    Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

                    Sending your feedback...
                    🎉 Thank you for your feedback!
                    Something went wrong. Please try again.

                    Thanks for your feedback!

                    thanks-feedback-gif