List user's subscriptions in an organization he is member of


I’d like to list the organisation subscriptions I am a member of and change their notification settings programmatically.

~$ curl -s -H "Authorization: token ${token}" \
"${user}/subscriptions?type=all" | jq -c .[] | wc -l

Returns only my subscriptions and not my organisation’s.

I was not able to find anything in the API documentation on how to achieve what I need.

My goal is to list subscriptions and to change the notification setting from “watching” to “releases only”.

Thanks for any help.


:wave: Hey @biro70! That’s interesting behavior to report. Would you mind also sharing the response that you get for that request?

When I run that request for your account, I’m able to see a subscription to an organization-owned repositories:

curl -v -H "Authorization: token $TOKEN" ""

  // ...
    "id": 239826107,
    "node_id": "MDEwOlJlcG9zaXRvcnkyMzk4MjYxMDc=",
    "name": "irules-toolbox",
    "full_name": "f5devcentral/irules-toolbox",
    "private": false,
  // ...

Similarly, I’m able to see subscriptions for my user account for both user-owned and organization-owned repositories:

curl -v ""

I’d like to mention that this endpoint doesn’t have any documented input, so ?type=all will be ignored here. Also, this only considers subscriptions to public repositories.

If you’re interested in fetching subscriptions for both public and private repositories, it may be worth trying the endpoint for fetching a list of repositories watched by the authenticated user.

1 Like

Hi @francisfuzz. Thank you for your reply.
I am quite a novice when it comes to use GitHub API calls.
It was my own fault I couldn’t list the company’s private repositories.
The auth token I generated didn’t have the flag set to access subscriptions.
Anyway all sorted now, also with the help of GitHub support member called Robert.


1 Like