XMatters API authentication using api key and secrets

Not Yet Reviewed

Hi Team,


I am trying to connect to xmatters api using api key and secrete but not able to authenticate.

Error is:

"message": "User could not be authenticated because the username or password is incorrect, the user does not exist in the targeted Company, or the Company does not exist."
However, I am able to connect using basic auth with user name and password.
Did anyone faced similar issue?


Date Votes

Please sign in to leave a comment.

  • Hi there! I see you also posted this to our Support team and I will look into this with you there. I will post the same questions I asked you then:

    > Are you testing code or via a command line or tool like CURL or PostMan?
    > How are you verifying the API key you are testing with? Which screen is it coming from?
    > Which API endpoints have you tested with?

  • Many thanks for your response!

    I am trying to invoke XMatters api to notify the roster users when there is any downtime in my custom application. As part of it, I am writing a python code where invoking the xmatter api.


    auth = HTTPBasicAuth("user-name", "password")

    headers = {"Content-Type": "application/json"}

    headers = {"Content-Type": "application/json"}

    data = {
    "properties": {
    "Summary": "Summary - python",
    "Details": "post details"
    "recipients": [
    "targetName": "test-group"

    data_string = json.dumps(data)

    response = requests.post(base_URL, headers=headers, data=data_string, auth=auth)
    For user-name and password, I am trying to use API-Key/secrete key which I generated from XMatters (https://help.xmatters.com/ondemand/user/apikeys.htm) but when I use it, getting authentication failure error.
    Sample API Key/ Secret: x-api-key-eae4595f-a5a6-23423-8038-83f975454bd04/dummy-5a17-55d6-8c87-4b1773229def0
    However, I am able to connect to the api when I use my XMatters login user-name and password instead of API key/secrete.

Didn't find what you were looking for?

New post