# How share stream using rest api

**URL:** <https://community.graylog.org/t/how-share-stream-using-rest-api/18808>\
**Category:** Graylog Central (peer support)\
**Created:** [February 15, 2021, 11:13pm UTC](https://community.graylog.org/t/how-share-stream-using-rest-api/18808 "2021-02-15T23:13:05Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![shoothub](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/shoothub/32/6412_2.png) [@shoothub](https://community.graylog.org/u/shoothub)\
**Post date:** [February 16, 2021, 10:51am UTC](https://community.graylog.org/t/how-share-stream-using-rest-api/18808/3 "2021-02-16T10:51:24Z")

</div>

If you want to only add new user, you can use API `/api/authz/shares/entities/grn::::stream:STREAM_ID/prepare` with request `{}` and use it to return already assigned permissions for other users. Then use it as input, concatenate with new NEW\_USER\_ID using jq:

`curl -s 'http://172.28.128.15/api/authz/shares/entities/grn::::stream:STREAM_D/prepare' -H 'Accept: application/json' -H 'Authorization: Basic BASE64' -H 'Content-Type: application/json' --data-raw '{}' | jq --arg user_id NEW_USER_ID '{selected_grantee_capabilities}|. * {"selected_grantee_capabilities": {("grn::::user:" + $user_id): "view"}}'`

Then you can use as input for previous api `/api/authz/shares/entities/grn::::stream:STREAM_ID`

---

_[View the full topic](https://community.graylog.org/t/how-share-stream-using-rest-api/18808)._
