# Advance a stream

> API reference for the stream advance endpoint, including required permissions and example curl requests.

![docs image](https://dev-assets.cms.uipath.com/assets/images/ixp/ixp-docs-image-321839-e2523966.webp)

```
/api/v1/datasets/<project>/<dataset_name>/streams/<stream_name>/advance
```

Permissions required: **Consume streams, View labels**.

* Bash
  ```
  curl -X POST 'https://<my_api_endpoint>/api/v1/datasets/project1/collateral/streams/dispute/advance' \
      -H "Authorization: Bearer $REINFER_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
    "sequence_id": "qs8QcHIBAADJ1p3W2FtmBB3QiOJsCJlR"
  }'
  ```
* Node
  ```
  const request = require("request");

  request.post(
    {
      url: "https://<my_api_endpoint>/api/v1/datasets/project1/collateral/streams/dispute/advance",
      headers: {
        Authorization: "Bearer " + process.env.REINFER_TOKEN,
      },
      json: true,
      body: { sequence_id: "qs8QcHIBAADJ1p3W2FtmBB3QiOJsCJlR" },
    },
    function (error, response, json) {
      // digest response
      console.log(JSON.stringify(json, null, 2));
    }
  );
  ```
* Python
  ```

  response = requests.post(
      "https://<my_api_endpoint>/api/v1/datasets/project1/collateral/streams/dispute/advance",
      headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]},
      json={"sequence_id": "qs8QcHIBAADJ1p3W2FtmBB3QiOJsCJlR"},
  )

  print(json.dumps(response.json(), indent=2, sort_keys=True))
  ```
* Response
  ```
  {
    "sequence_id": "qs8QcHIBAADJ1p3W2FtmBB3QiOJsCJlR",
    "status": "ok"
  }
  ```

Each [fetch](https://developers.reinfer.io/api/reference/streams#fetch-comments-from-a-stream) request returns a `sequence_id` , which represents the position it has fetched up to. Passing that same `sequence_id` to the advance api will make sure that next time a fetch is performed on the stream, it will start from this position. You can advance to the next batch by using the current batch's `sequence_id`. Alternatively, you can advance to the next comment by using the current comment's `sequence_id`.

Since an application can successfully process a comment but fail at the advance step, it is important to handle a comment that appears multiple times on the client application side.

| NAME | TYPE | REQUIRED | DESCRIPTION |
| --- | --- | --- | --- |
| `sequence_id` | string | yes | The sequence ID to advance the stream to. |
