Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


How can I create a new Policy using the Opsgenie API?

I am following the API documentation for Sample Request. Essentially a copy + paste and changing out the API key.

curl -X POST '' \
-H "Authorization: GenieKey $ATLASSIAN_API_TOKEN" \
-H 'Content-Type: application/json' \
-d @policy.json

Where policy.json is:

"policyDescription":"notification policy description ",
"name":"Notification with Delay and Restart Actions",

The response I get is:

{"message":"Key format is not valid!","took":0.001,"requestId":"fa1fd745-b9e4-4404-869f-2df7ac132939"}%

2 answers

1 accepted

0 votes
Answer accepted
Nick H
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Oct 17, 2023

Hi @Benjamin Lush ,

Are you using the API key from an Opsgenie API integration, or API key from the API key management tab?

Or are you using an Atlassian token as shown above in your request?


For the request above, you will need to use either an API integration's key or an API key from the API key management tab. 


You may also want to be consistent with the headers as I noticed one is using single quotes while the other using double quotes.

Looks like this message is regarding the use of an Integration Key. Once I used the Integration Key vs my Personal Access Token, I started getting new errors regarding formatting of Duration and the lack of teamId in Query params. This means the documentation is broken, but at-least I got it to eventually work!

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events