Skip to contentSkip to navigationSkip to topbar
On this page
Looking for more inspiration?Visit the
(information)
You're in the right place! Segment documentation is now part of Twilio Docs. The content you are used to is still here—just in a new home with a refreshed look.

Batch (Actions) Destination


Destination Info
  • Accepts Page, Alias, Group, Identify and Track calls.
  • Refer to it as Batch (Actions) in the Integrations object
  • This integration is partner owned. Please reach out to the partner's support for any issues.
  • This destination is in Beta

Batch(link takes you to an external page) is a customer engagement platform for personalized, timely notifications and messages that boost retention and drive growth.

This destination is maintained by Batch. For any issues, contact Batch Support.


Getting started

getting-started page anchor
  1. From your workspace's destinations catalog(link takes you to an external page), search for Batch.
  2. Select Batch (Actions) and click Add Destination.
  3. Choose the source you want to connect to Batch (Actions).
  4. In the Batch dashboard(link takes you to an external page), copy your Project Key and REST API Key.
  5. Paste the Project Key and REST API Key into the Batch destination settings in Segment.
  6. Toggle Enable Destination. Segment will start sending data to Batch according to your Mappings.
Screenshot of the Braze destination Basic Settings page in Segment app.

Property nameTypeRequiredDescription
REST API Keypassword
required

Token used to authorize sending data to the Destination platform


Project Keystring
required

The unique project key identifying your project in the Destination platform


Batch (Actions) has the following presets

Preset NameTriggerDefault Action
Update ProfileEvent type = "identify", Event type = "track"Update User Profile

Build your own Mappings. Combine supported triggers with the following Batch-supported actions:

(information)

Mapping limits per destination

Individual destination instances have support a maximum of 50 mappings.

Update User Profile

update-user-profile page anchor

Sends user events or creates and updates user profiles in Batch.

Update User Profile is a Cloud action. The default Trigger is type = "identify" or type = "track"

Property nameTypeRequiredDescription
IdentifiersOBJECT
required

User identifiers


Profile attributesOBJECT

Optional

Attributes for the user profile. Batch can accept up to 50 attributes per user.


Event NameSTRING

Optional

The name of the event.


Event AttributesOBJECT

Optional

An object containining the event's attributes


Profile attributes mapping

profile-attributes-mapping page anchor
(information)

Info

If you're new to the Identify call, see the Segment spec for more details.

When you call Identify, Segment maps userId to identifiers.custom_id and writes traits into attributes.

Example Identify call (Segment input)

example-identify-call-segment-input page anchor
1
analytics.identify("97980cfea0067", {
2
name: "Peter Gibbons",
3
email: "peter@example.com",
4
phone: "+33600000000",
5
email_marketing: "subscribed",
6
sms_marketing: "unsubscribed",
7
plan: "premium",
8
logins: 5
9
}, {
10
context: {
11
timezone: "Europe/Paris",
12
locale: "fr-FR"
13
}
14
});

Auto-mapped fields (native)

auto-mapped-fields-native page anchor
Segment fieldBatch field
userIdidentifiers.custom_id
traits.emailattributes.$email_address
traits.phoneattributes.$phone_number
traits.email_marketingattributes.$email_marketing
traits.sms_marketingattributes.$sms_marketing
context.timezoneattributes.$timezone
context.locale → language (for example: fr)attributes.$language
context.locale → region (for example: FR)attributes.$region

Notes

  • $email_marketing / $sms_marketing: use subscribed / unsubscribed.
  • A locale like fr-FR is split into language (fr) and region (FR).
  • All other non‑reserved fields become custom attributes under attributes (strings, numbers, booleans, arrays of strings). Avoid arbitrary nested objects.
(information)

Info

For more details on the fields to be included, refer to the Batch API Profile documentation(link takes you to an external page).

Resulting Batch profile payload (output)

resulting-batch-profile-payload-output page anchor
1
{
2
"identifiers": {
3
"custom_id": "97980cfea0067"
4
},
5
"attributes": {
6
"$email_address": "peter@example.com",
7
"$phone_number": "+33600000000",
8
"$email_marketing": "subscribed",
9
"$sms_marketing": "unsubscribed",
10
"$language": "fr",
11
"$region": "FR",
12
"$timezone": "Europe/Paris",
13
14
"name": "Peter Gibbons",
15
"plan": "premium",
16
"logins": 5
17
}
18
}

To map additional traits into Batch profile attributes:

  1. Open your destination → MappingsEdit Mapping.

  2. Go to Profile attributesAdd Mapping Field.

  3. Choose a source (for example, traits.plan) and set a target under attributes (for example, attributes.plan).

    Screenshot of mappings setup screen in Segment app with example fields.
  4. In Step 4 – Send test record, you can test your mapping before saving.

    Screenshot of Send test record screen.
  5. Save and enable the mapping.

(information)

Supported types

Strings, numbers, booleans, arrays of strings are supported. Avoid arbitrary nested objects.


Historical backfill request

historical-backfill-request page anchor

If you want to integrate your entire Segment userbase into Batch using the Identify method, you can request a historical backfill from Segment.

To do this:

  1. Contact Segment Support at friends@segment.com.
  2. Request a historical replay of your data.
  3. Provide Segment with the following details:
    • Start date and time
    • End date and time (usually "now")
    • Source: the Segment source you want to replay
    • Destination: Batch (Actions)
    • Events: Identify

Segment will then replay your historical data so Batch can import your full userbase.


When you call Track, Segment uses your userId as Batch's identifiers.custom_id. A userId is required to attribute the event to a profile.

(information)

Info

For more details on the Track call, see the Track spec.

Example Track call (Segment input)

example-track-call-segment-input page anchor
1
analytics.track("User Registered", {
2
plan: "Pro Annual",
3
accountType: "Facebook"
4
}, {
5
userId: "97980cfea0067"
6
});

How Segment maps to Batch

how-segment-maps-to-batch page anchor
SegmentBatch
userIdidentifiers.custom_id
eventevent.name
properties.*event.attributes.*

Resulting Batch event payload (output)

resulting-batch-event-payload-output page anchor
1
{
2
"identifiers": {
3
"custom_id": "97980cfea0067"
4
},
5
"event": {
6
"name": "User Registered",
7
"attributes": {
8
"plan": "Pro Annual",
9
"accountType": "Facebook"
10
}
11
}
12
}

Events are sent to Batch in near real time according to your destination mappings, and all event properties are included under event.attributes.

Partial screenshot of event mappings settings in the Segment app.

  • Always send a stable userId → becomes identifiers.custom_id.
  • Place native profile fields under attributes: $email_address, $email_marketing, $phone_number, $sms_marketing, $language, $region, $timezone.
  • Put everything else under custom attributes in attributes.
  • Format dates using ISO‑8601 UTC (for example: 1989-07-20T00:00:00Z).
  • Configure additional mappings in Mappings → Edit Mapping.
  • Test with a read-back or export to verify types, encodings, and timezones.

Integrating a computed trait

integrating-a-computed-trait page anchor
(information)

Info

For more details on computed traits, see the Segment spec.

To integrate a computed trait with Batch:

  1. Go to your Segment workspace.
  2. Open the Engage tab → Destinations.
    • If your Batch destination is already listed, skip this step.
    • Otherwise, click Add destination and select Batch (Actions).
  3. Open the Engage tab → AudiencesComputed traits.
  4. Click Create computed trait.
  5. Configure your calculation method (for example: count, aggregation, last value).
  6. Click Preview, then Next.
  7. Select your Batch destination.
  8. Choose how to send the data:
    • For an attribute → enable Send Identify in the connection settings.
    • For an event → enable Send Track.
  9. Give your computed trait a clear name.

Segment will then automatically update and forward your computed trait data to Batch.


You can send computed traits and audiences generated using Engage to this destination as a user property. To learn more about Engage, schedule a demo(link takes you to an external page).

For user-property destinations, an identify call is sent to the destination for each user being added and removed. The property name is the snake_cased version of the audience name, with a true/false value to indicate membership. For example, when a user first completes an order in the last 30 days, Engage sends an Identify call with the property order_completed_last_30days: true. When the user no longer satisfies this condition (for example, it's been more than 30 days since their last order), Engage sets that value to false.

When you first create an audience, Engage sends an Identify call for every user in that audience. Later audience syncs only send updates for users whose membership has changed since the last sync.

(information)

Real-time to batch destination sync frequency

Real-time audience syncs to Batch (Actions) may take six or more hours for the initial sync to complete. Upon completion, a sync frequency of two to three hours is expected.


Segment lets you change these destination settings from the Segment app without having to touch any code.

Property nameTypeRequiredDescription
REST API Keypassword
required

Token used to authorize sending data to the Destination platform


Project Keystring
required

The unique project key identifying your project in the Destination platform