Skip to content

Skill: Export File

The Export File skill converts structured JSON data into a downloadable CSV or JSON file and sends a download link directly to the user’s conversation. Agents use this skill when users need to take data out of Horizon — for import into spreadsheets, further analysis in external tools, or sharing with colleagues.

ParameterTypeRequiredDescription
dataarrayYesAn array of objects to export. Each object represents a row (for CSV) or an element (for JSON). All objects should have a consistent set of keys.
formatstringYesThe output file format: "csv" or "json".
filenamestringYesThe name for the exported file, including the file extension (e.g., sales-report.csv, customer-list.json).

After pulling a financial report, a user might say:

“Export that profit and loss data as a CSV file I can open in Excel.”

The agent takes the data it received from the Profit & Loss Report skill and invokes Export File with:

  • data: (array of row objects from the P&L report)
  • format: "csv"
  • filename: profit-and-loss-q1-2026.csv

The skill generates the file and returns a download link that the agent shares in the conversation.

“Give me a JSON file of all our customers with outstanding balances.”

After querying the data, the agent invokes Export File with:

  • data:
    [
    { "name": "Acme Corp", "balance": 15000.00, "email": "billing@acme.com" },
    { "name": "Globex Inc", "balance": 7500.50, "email": "ap@globex.com" }
    ]
  • format: "json"
  • filename: customers-outstanding-balances.json

An agent could combine List Sites with Export File:

“Export a list of all my websites as a spreadsheet.”

The agent calls List Sites, then passes the results to Export File with format: "csv".

The skill returns a JSON object with the download link:

{
"filename": "profit-and-loss-q1-2026.csv",
"format": "csv",
"download_url": "https://files.horizon.app/exports/abc123/profit-and-loss-q1-2026.csv",
"row_count": 45,
"file_size_bytes": 3200,
"expires_at": "2026-03-25T16:00:00Z"
}
  • filename — the name of the generated file.
  • format — the output format that was used.
  • download_url — a temporary, pre-signed URL for downloading the file.
  • row_count — the number of data rows in the exported file.
  • file_size_bytes — the size of the generated file in bytes.
  • expires_at — ISO 8601 timestamp after which the download link expires.

When exporting as CSV:

  • Headers — the first row contains column headers derived from the keys of the first object in the data array.
  • Column order — columns appear in the order that keys appear in the first data object.
  • Quoting — values containing commas, double quotes, or newlines are automatically quoted per RFC 4180.
  • Nested objects — nested objects and arrays are serialized as JSON strings within the CSV cell. For best results, flatten your data before exporting.
  • Encoding — the file is encoded as UTF-8 with a BOM (byte order mark) for compatibility with Excel.

When exporting as JSON:

  • Structure — the file contains the data array as-is, pretty-printed with 2-space indentation.
  • Encoding — the file is encoded as UTF-8.
  • Nested data — nested objects and arrays are preserved in their original structure.
  • Data size limit — the data array is limited to 50,000 rows. Larger datasets should be broken into multiple exports.
  • File size limit — generated files are capped at 25 MB. If the data exceeds this limit, the skill returns an error suggesting the user narrow the dataset.
  • Consistent keys — for CSV exports, all objects in the data array should have the same set of keys. Missing keys in some objects will result in empty cells for those columns.
  • Conversation delivery — the download link is automatically rendered as a clickable file attachment in the user’s conversation interface. The user does not need to copy-paste URLs.
  • No overwrite — each export generates a unique file. Exporting with the same filename creates a new file rather than overwriting a previous one.

POST /api/platform/v1.0/export-file

See the Skill Execution API for details on authentication and request format.


Related skills: Get Skill | Create Skill