---
title: "Creates a new flow item for the specified flow."
method: POST
path: "/flow/ranking/{flowId}/item"
tags: ["RankingFlowItem"]
---

# Creates a new flow item for the specified flow.

`POST /flow/ranking/{flowId}/item`

## Path parameters

- `flowId` string, required

## Request body

- CreateFlowItemEndpointInput
  - `datasetId` string, required — The ID of the dataset to use for this flow item.
  - `context` string, nullable — Optional context to provide additional ranking guidance.
  - `contextAsset` union
    - object
      - `_t` 'ExistingAssetInput', required
      - `name` string, required
      - `metadata` object, nullable
      - `identifier` string, nullable
    - object
      - `_t` 'MultiAssetInput', required
      - `assets` IAssetInput[], required
      - `metadata` object, nullable
      - `identifier` string, nullable
    - object
      - `_t` 'TextAssetInput', required
      - `text` string, required
      - `metadata` object, nullable
      - `identifier` string, nullable
  - `timeToLiveInSeconds` integer, nullable — Optional time-to-live in seconds before the flow item expires. Must be between 45 seconds and 1 hour; defaults to 4 minutes when omitted.
  - `drainDurationInSeconds` integer, nullable — Optional drain duration in seconds. When set, rapids are paused this many seconds before TTL expiry to allow in-flight responses to complete.

## Response `200`

OK

- CreateFlowItemEndpointOutput
  - `flowItemId` string, required — The ID of the created flow item.

## Other responses

- `400` — Bad Request
- `401` — Unauthenticated
- `403` — Forbidden

---

[API](https://skmtc.net/rapidata/apis/rapidata-api.md) · [All operations](https://skmtc.net/rapidata/apis/rapidata-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/rapidata/rapidata-api/revisions/d779de93a5ee/schema)
