Download Audience Template
Download a blank Excel (.xlsx) template whose columns are derived from an agent’s metadata input fields, an existing audience’s saved input variables, or explicitly chosen input-variable IDs. mobile_no must be among the resolved columns.
Endpoint
GET/audience/download-template
Authentication: Required (workspace auth)
Query Parameters
agent_id is checked first, then audience_id, then variable_id/variable_ids.
Passing multiple variable_ids
Any of these forms work — the resulting columns follow the order the IDs were given in:
- Repeat the param:
?variable_id=12&variable_id=15 - Comma-separated string:
?variable_id=12,15 - JSON-encoded array:
?variable_id=%5B12%2C15%5D(i.e.[12,15], URL-encoded)
Response
Returns a downloadable Excel file (.xlsx).
- Content-Type:
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet - Filename:
<audience_name>.xlsx(sanitized; falls back toaudience_template.xlsx)
Template Columns
One column per resolved variable key, in the order resolved.mobile_no must be among them (see Error Cases).
Behavior
- Duplicate keys (case-insensitive) are removed while preserving the first occurrence’s order.
- When using
variable_id/variable_ids, only variables owned by the caller’s workspace or global System variables resolve; unmatched IDs are silently dropped.
Error Cases
Example cURL
From an existing audience
From multiple chosen input variables
Headers
API token for authentication
Query Parameters
Derive columns from this agent's configured metadata input fields. mobile_no is force-added first if missing. Checked before audience_id and variable_id.
Derive columns from an existing audience's saved input variables.
Input-variable registry ID(s) to use as columns, in the order given. Pass multiple by repeating the param (variable_id=12&variable_id=15) or as a comma-separated string (variable_id=12,15). Also accepted as variable_ids.
Overrides the downloaded file's base name. Defaults to the audience's name (audience_id mode) or audience_template.
Response
Excel file download
The response is of type file.

