Unable to create webhook through API

Hi

We are unable to create webhook through below api

https://developer.github.com/v3/orgs/hooks/#create-a-hook

var hook = {'name': 'web', 'active': true, 'config': {'url': 'http://my/payload/destination'}}

var t = encodeURI(hook);

options_create_hook = {
method:'POST',
data: t,
url: 'https://api.github.com/orgs/appflujo/hooks',
headers: {
'content-type': 'application/json',
'Authorization': 'token ' + jb.access_token, 
"User-Agent":bo.name,
"Accept": 'application/vnd.github.v3+json'
}
}

The reply we are getting is

{"message":"Not Found","documentation_url":"https://developer.github.com/v3/orgs/hooks/#create-a-hook"}

Please let know what went wrong and provide suggestions accordingly.

Thanks in advance

I would suspect that either there is something wrong with the payload you’re using or that the token you’ve created either doesn’t have the proper scopes or wasn’t granted access to the organization. If you can reproduce the problem using cURL or httpie, please post the exact command-line that you used to reproduce the problem.

Let us know if you have more questions.