Rotate a Jira webhook secret
Replaces a connection’s webhook secret; the old one stops working at once.
No authentication: anyone can call this.
POST
/
v1
/
integrations
/
jira
/
rotate_secret
Rotate a Jira webhook secret
curl --request POST \
--url https://{host}/v1/integrations/jira/rotate_secret \
--header 'Content-Type: application/json' \
--data '
{
"realm_id": "5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b",
"workspace_id": "1a2b3c4d-acme-cloud"
}
'import requests
url = "https://{host}/v1/integrations/jira/rotate_secret"
payload = {
"realm_id": "5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b",
"workspace_id": "1a2b3c4d-acme-cloud"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
realm_id: '5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b',
workspace_id: '1a2b3c4d-acme-cloud'
})
};
fetch('https://{host}/v1/integrations/jira/rotate_secret', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/v1/integrations/jira/rotate_secret",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'realm_id' => '5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b',
'workspace_id' => '1a2b3c4d-acme-cloud'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{host}/v1/integrations/jira/rotate_secret"
payload := strings.NewReader("{\n \"realm_id\": \"5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b\",\n \"workspace_id\": \"1a2b3c4d-acme-cloud\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{host}/v1/integrations/jira/rotate_secret")
.header("Content-Type", "application/json")
.body("{\n \"realm_id\": \"5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b\",\n \"workspace_id\": \"1a2b3c4d-acme-cloud\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/v1/integrations/jira/rotate_secret")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"realm_id\": \"5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b\",\n \"workspace_id\": \"1a2b3c4d-acme-cloud\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"secret": "whsec_1b7d…"
}
}{
"ok": false,
"error": "invalid api_token",
"code": "unauthorized"
}{
"ok": false,
"error": "No Jira binding for this realm and workspace",
"code": "not_found"
}{
"ok": false,
"error": "realm_id: Required",
"code": "invalid_params"
}{
"ok": false,
"error": "Internal server error",
"code": "internal_error"
}Body
application/json
⌘I
Rotate a Jira webhook secret
curl --request POST \
--url https://{host}/v1/integrations/jira/rotate_secret \
--header 'Content-Type: application/json' \
--data '
{
"realm_id": "5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b",
"workspace_id": "1a2b3c4d-acme-cloud"
}
'import requests
url = "https://{host}/v1/integrations/jira/rotate_secret"
payload = {
"realm_id": "5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b",
"workspace_id": "1a2b3c4d-acme-cloud"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
realm_id: '5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b',
workspace_id: '1a2b3c4d-acme-cloud'
})
};
fetch('https://{host}/v1/integrations/jira/rotate_secret', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/v1/integrations/jira/rotate_secret",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'realm_id' => '5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b',
'workspace_id' => '1a2b3c4d-acme-cloud'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{host}/v1/integrations/jira/rotate_secret"
payload := strings.NewReader("{\n \"realm_id\": \"5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b\",\n \"workspace_id\": \"1a2b3c4d-acme-cloud\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{host}/v1/integrations/jira/rotate_secret")
.header("Content-Type", "application/json")
.body("{\n \"realm_id\": \"5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b\",\n \"workspace_id\": \"1a2b3c4d-acme-cloud\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/v1/integrations/jira/rotate_secret")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"realm_id\": \"5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b\",\n \"workspace_id\": \"1a2b3c4d-acme-cloud\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"secret": "whsec_1b7d…"
}
}{
"ok": false,
"error": "invalid api_token",
"code": "unauthorized"
}{
"ok": false,
"error": "No Jira binding for this realm and workspace",
"code": "not_found"
}{
"ok": false,
"error": "realm_id: Required",
"code": "invalid_params"
}{
"ok": false,
"error": "Internal server error",
"code": "internal_error"
}