# What happens to an open Ledger API stream upon token expiry?

**URL:** <https://forum.canton.network/t/what-happens-to-an-open-ledger-api-stream-upon-token-expiry/4573>\
**Category:** App Development\
**Tags:** ledger-api\
**Created:** [May 19, 2022, 3:16pm UTC](https://forum.canton.network/t/what-happens-to-an-open-ledger-api-stream-upon-token-expiry/4573 "2022-05-19T15:16:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Darko](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/darko/32/42_2.png) [@Darko](https://forum.canton.network/u/Darko)\
**Post date:** [May 19, 2022, 3:16pm UTC](https://forum.canton.network/t/what-happens-to-an-open-ledger-api-stream-upon-token-expiry/4573/1 "2022-05-19T15:16:24Z")

</div>

Assuming that I subscribe to a stream on the Ledger API using a token that expires, what will happen upon expiry?

1. Will the stream will be closed server-side with a descriptive error, or
2. is the auth checked only when establishing the stream, which would result in the stream remaining open, while only a new connection would be rejected?

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [May 19, 2022, 5:00pm UTC](https://forum.canton.network/t/what-happens-to-an-open-ledger-api-stream-upon-token-expiry/4573/2 "2022-05-19T17:00:56Z")

</div>

The streams are interrupted as the token expires. I believe it’s `PERMISSION_DENIED` but I haven’t double checked the error code you get in that case.
