---
title: "Export accounts to CSV"
method: POST
path: "/accounts/export"
tags: ["Account Analytics"]
---

# Export accounts to CSV

`POST /accounts/export`

## Request

- Base URL: `https://viral.app/api/v1`
- URL: `https://viral.app/api/v1/accounts/export`
- Auth: API key in header `x-api-key`

Exports accounts data as CSV with presigned download URL. Includes profile data, analytics metrics, tracking metadata, and computed performance indicators. Respects all filtering options (search, platforms, tags, legacy projects, date ranges). Returns secure download URL valid for 5 minutes.

## Request body

- object: Filtering options for accounts export (excludes pagination)
  - `search` string: Account username on the platform
  - `platforms` string[], nullable: Social media platforms (facebook, instagram, tiktok, youtube, snapchat)
  - `accounts` string[], nullable: Organization account IDs
  - `projects` string[], nullable: Organization project IDs
  - `tags` string[], nullable: Tag IDs. Custom and project tags must all match (intersection); country tags and `continent:<CODE>` values combine into one geographic group satisfied by any of them. `none:<category>` values (custom/project/country/continent) match entities WITHOUT any tag of the category. Ignored when `tagGroups` is provided.
  - `tagGroups` object[], nullable: Advanced tag filter: groups combine with AND; within a group `any` matches videos carrying at least one of the tags, `all` requires every tag. `none:<category>` ids match videos without any tag of the category. Takes precedence over `tags` when provided. Also accepts the compact string form `all:orgtag_a,orgtag_b;any:systag_de,continent:EU`.
    - `mode` 'any' | 'all', required: How the group's tags combine: `any` = OR, `all` = intersection.
    - `ids` string[], required: Tag IDs, including `continent:<CODE>` and `none:<category>` values.
  - `tagsMatch` 'rules' | 'videos': How the tag filter targets rows: `rules` (default) matches entity-level tag rules only; `videos` matches rows with at least one video satisfying the whole filter.
  - `dateRange` object: Date range filter for analytics queries
    - `from` string, required: Start date in ISO format (YYYY-MM-DD)
    - `to` string, required: End date in ISO format (YYYY-MM-DD)
  - `contentTypes` string[], nullable: Content types (video, slideshow)
  - `viewMode` 'internal' | 'competitors' | 'all'

## Response `200`

OK

- object: Export file download information with presigned URL and metadata
  - `downloadUrl` string, uri, required: Presigned download URL for the CSV export file
  - `expiresAt` string, date-time, required: Expiration timestamp for the download URL (typically 5 minutes)
  - `rowCount` number, required: Total number of data rows included in the export file
  - `fileName` string, required: Generated filename for the export (includes timestamp)

## Other responses

- `400`: 400
- `401`: 401
- `402`: 402
- `404`: 404
- `408`: 408
- `429`: 429
- `500`: 500

---

[API](https://skmtc.dev/viral/apis/viral-app-api.md) · [All operations](https://skmtc.dev/viral/apis/viral-app-api/llms.txt) · [OpenAPI document](https://skmtc.dev/viral/apis/viral-app-api/revisions/31e97fa79ef1?raw)
