Variables
Global variables are reusable values — brand name, tone, CTA, target audience — that can be referenced in generation prompts and cell content. Variables are managed per-sheet via an XLSX upload.
Get variables
Section titled “Get variables”Returns the global variables sheet for a given sheet.
GET /v1/autocontentengine/{id}/global_variables?agent_id={agent_id}Path parameters
Section titled “Path parameters”| Parameter | Type | Description |
|---|---|---|
id | integer | The sheet ID. |
Response
Section titled “Response”Returns the variables sheet object, or null if no variables have been imported.
{ "id": 600, "variables": [ { "key": "brand_name", "value": "Acme Corp" }, { "key": "tone", "value": "casual and friendly" }, { "key": "cta", "value": "Link in bio!" } ]}Example
Section titled “Example”curl "https://api.gen.pro/v1/autocontentengine/101/global_variables?agent_id=42" \ -H "X-API-Key: your-api-key"Import variables
Section titled “Import variables”Uploads an XLSX file to set (or replace) the global variables for a sheet. Use multipart/form-data with the file in the file field.
POST /v1/autocontentengine/{id}/import_global_variables?agent_id={agent_id}Path parameters
Section titled “Path parameters”| Parameter | Type | Description |
|---|---|---|
id | integer | The sheet ID. |
Request body (multipart/form-data)
Section titled “Request body (multipart/form-data)”| Field | Type | Required | Description |
|---|---|---|---|
file | file | Yes | An XLSX file matching the variables template format. |
Response
Section titled “Response”Returns the updated variables sheet.
Example
Section titled “Example”curl -X POST "https://api.gen.pro/v1/autocontentengine/101/import_global_variables?agent_id=42" \ -H "X-API-Key: your-api-key" \ -F "file=@variables.xlsx"Errors
Section titled “Errors”| Status | Error code | Description |
|---|---|---|
422 | validation_error | Invalid file format or missing required columns. |
Download variables template
Section titled “Download variables template”Returns a blank XLSX template with the expected column headers. Use this as a starting point for your variables file.
GET /v1/autocontentengine/global_variables_templateResponse
Section titled “Response”Returns the XLSX file as a binary download (Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet).
Example
Section titled “Example”curl -o template.xlsx "https://api.gen.pro/v1/autocontentengine/global_variables_template" \ -H "X-API-Key: your-api-key"