---
title: "Create a data stream"
method: POST
path: "/data_streams"
---

# Create a data stream

`POST /data_streams`

## Request body

- object
  - `key` string, required — Unique immutable identifier
  - `name` string, required — Human readable name
  - `type` 'api' | 'bank_feed' — The type of data stream to create
  - `bank_account_id` string — Required when type is bank_feed. The ID of the bank account to link.

## Response `201`

Data stream created

- DataStream
  - `id` integer — Unique numeric identifier
  - `key` string, required — Unique immutable identifier
  - `name` string, required — Human readable name
  - `description` string — Optional description of the data stream
  - `type` string — The type of data stream (e.g. api, csv, stripe, bank_feed)
  - `program_id` integer, nullable
  - `records_count` integer — Record count from the ClickHouse mirror

## Other responses

- `422` — Validation error (e.g. missing required fields, duplicate key, bank_account_id not found)

## Changes

> 5 revisions in range; 1 could not be searched.

- **2026-08-14** `fb02f944f95e` — 2 info
  - added the optional property `program_id` to the response with the `201` status
  - added the optional property `records_count` to the response with the `201` status

[Change history](https://skmtc.dev/endclose/apis/end-close-api/changes/data_streams/post.md)

---

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