Skip to main content
GET
Download audience template
Use this endpoint to download a blank Excel template whose columns match an agent’s, an existing audience’s, or a chosen set of input variables — ready to fill in and upload via Create Audience.

Endpoint

GET /audience/download-template Authentication: Required (workspace auth)

Query Parameters

Only one source is used to resolve columns — 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 to audience_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

token
string
required

API token for authentication

Query Parameters

agent_id
integer

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.

audience_id
integer

Derive columns from an existing audience's saved input variables.

variable_id

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.

audience_name
string

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.