I am trying to  create a job using the python api. I have created my own config, but the authentication fails. It produces an error message: 
File "/usr/lib/python2.7/dist-packages/jenkins/__init__.py", line 415, in create_job
    self.server + CREATE_JOB % locals(), config_xml, headers))
  File "/usr/lib/python2.7/dist-packages/jenkins/__init__.py", line 236, in jenkins_open
    'Possibly authentication failed [%s]' % (e.code)
jenkins.JenkinsException: Error in request.Possibly authentication failed [403]
The config file I have created was copied from another job config file as it was the easiest way to build it: 
I am using the import jenkins module.

The server instance I create is using these credentials: 
server = jenkins.Jenkins(jenkins_url, username = 'my_username', password = 'my_APITOKEN')
Any help will be greatly appreciated.
Error 403 is basically issued when the user is not allowed to access the resource. Are you able to access the resource manually using the same credentials? If there are some other admin credentials, then you can try using those.
Also, I am not sure but may be you can try running the python script with admin rights.
Authentication failed with Jenkins using python API