---
title: "Import a CSV of usage events"
method: POST
path: "/tasks"
tags: ["Tasks"]
---

# Import a CSV of usage events

`POST /tasks`

Use to submit a CSV of usage events for async ingestion. The CSV must already have been uploaded to the Flexprice-managed imports bucket (currently via CSV Box) — pass the upload_id and the backend fetches the file from S3 and streams rows into ClickHouse. Returns the task ID and Temporal workflow IDs for polling.

## Request body

- CreateTaskRequest
  - `entity_type` 'EVENTS' | 'PRICES' | 'CUSTOMERS' | 'FEATURES', required
  - `file_name` string
  - `file_provider` string, required
  - `file_type` 'CSV' | 'JSON', required
  - `metadata` object
  - `task_type` 'IMPORT' | 'EXPORT', required
  - `upload_id` string, required

## Response `200`

OK

- ModelsTemporalWorkflowResult
  - `message` string
  - `run_id` string
  - `workflow_id` string

## Other responses

- `400` — Invalid request
- `500` — Server error

## Changes

- **2026-09-01** `e1d4e27b5677` — 1 info
  - endpoint added
- **2026-08-14** `29f14678f58f` — 1 breaking
  - api removed without deprecation
- **2026-07-15** `f8ecf435d25d` — 2 warning
  - added the new `not_implemented` enum value to the `code` response property for the response status `400`
  - added the new `not_implemented` enum value to the `code` response property for the response status `500`
- **2026-07-09** `7d57386313c7` — 8 breaking, 11 warning, 4 info
  - request property `file_type` was restricted to a list of enum values
  - request property `task_type` was restricted to a list of enum values
  - the `file_type` request property type/format changed from ``/`` to `string`/``
  - the `task_type` request property type/format changed from ``/`` to `string`/``
  - …19 more
- **2026-07-09** `4b1a811c4179` — 15 breaking, 11 info
  - removed the enum value `CSV` of the request property `file_type`
  - removed the enum value `EXPORT` of the request property `task_type`
  - removed the enum value `IMPORT` of the request property `task_type`
  - removed the enum value `JSON` of the request property `file_type`
  - …22 more

[Full history](https://skmtc.dev/flexprice/apis/flexprice-api/changes/tasks/post.md)

---

[API](https://skmtc.dev/flexprice/apis/flexprice-api.md) · [All operations](https://skmtc.dev/flexprice/apis/flexprice-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/flexprice/flexprice-api/revisions/fd7112159d0a/schema)
