unable to create ticket with api v2 with python or postman

  • 11 August 2021
  • 1 reply

I am trying to create tickets using postman or python , but i get back this error as follows

    "message""You are not authorized to perform this action."
from http.client import HTTPSConnection
import json
from base64 import b64encode
#This sets up the https connection
c = HTTPSConnection("")
#we need to base 64 encode it
#and then decode it to acsii as python 3 stores it as a byte string
userAndPass = b64encode(b"!").decode("ascii")
headers = {"Content-type": "application/json",
"Accept": "application/json", 'Authorization' : 'Basic %s' % userAndPass }
"name" : "Taz",
"email": "",
json_data = json.dumps(data)
#then connect
c.request('POST', '/api/v2/tickets',json_data, headers=headers)
#get the response back
res = c.getresponse()
# at this point you could check the status etc
# this gets the page text
data =



1 reply

Userlevel 5
Badge +12

Hello @tazeen_86, apologies for not getting back to you sooner on this. As far as we’ve seen, the error would be thrown when you have insufficient previleges to perform an action.

Can you try using the account admin API key with password as X and see if that helps? If the issue persists, can you share a request ID of the call that’s failing so that we can have a look at it in the backend?