Connect a Jira workspace
Connects a Jira workspace to a realm. The first time, the reply has the webhook_secret the Jira app signs its calls with (shown once); connecting again keeps the existing secret.
No authentication: anyone can call this.
POST
/
v1
/
integrations
/
jira
/
register_workspace
Connect a Jira workspace
curl --request POST \
--url https://{host}/v1/integrations/jira/register_workspace \
--header 'Content-Type: application/json' \
--data '
{
"realm_id": "5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b",
"workspace_id": "1a2b3c4d-acme-cloud",
"workspace_url": "https://acme.atlassian.net",
"webhook_url": "https://acme.atlassian.net/x/webhook"
}
'import requests
url = "https://{host}/v1/integrations/jira/register_workspace"
payload = {
"realm_id": "5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b",
"workspace_id": "1a2b3c4d-acme-cloud",
"workspace_url": "https://acme.atlassian.net",
"webhook_url": "https://acme.atlassian.net/x/webhook"
}
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',
workspace_url: 'https://acme.atlassian.net',
webhook_url: 'https://acme.atlassian.net/x/webhook'
})
};
fetch('https://{host}/v1/integrations/jira/register_workspace', 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/register_workspace",
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',
'workspace_url' => 'https://acme.atlassian.net',
'webhook_url' => 'https://acme.atlassian.net/x/webhook'
]),
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/register_workspace"
payload := strings.NewReader("{\n \"realm_id\": \"5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b\",\n \"workspace_id\": \"1a2b3c4d-acme-cloud\",\n \"workspace_url\": \"https://acme.atlassian.net\",\n \"webhook_url\": \"https://acme.atlassian.net/x/webhook\"\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/register_workspace")
.header("Content-Type", "application/json")
.body("{\n \"realm_id\": \"5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b\",\n \"workspace_id\": \"1a2b3c4d-acme-cloud\",\n \"workspace_url\": \"https://acme.atlassian.net\",\n \"webhook_url\": \"https://acme.atlassian.net/x/webhook\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/v1/integrations/jira/register_workspace")
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 \"workspace_url\": \"https://acme.atlassian.net\",\n \"webhook_url\": \"https://acme.atlassian.net/x/webhook\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"subscription_id": "7b8c9d0e-1f2a-4b3c-8d4e-5f6a7b8c9d0e",
"webhook_secret": "whsec_9f2c…",
"realm_id": "5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b",
"workspace_id": "1a2b3c4d-acme-cloud",
"cliq_user": {
"id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"username": "sshah",
"email": "[email protected]"
}
}
}{
"ok": false,
"error": "invalid api_token",
"code": "unauthorized"
}{
"ok": false,
"error": "realm '5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b' not found",
"code": "not_found"
}{
"ok": false,
"error": "realm_id: Required",
"code": "invalid_params"
}{
"ok": false,
"error": "Internal server error",
"code": "internal_error"
}Body
application/json
Realm to bind the workspace to
Minimum string length:
1Jira webhook delivery URL
Atlassian workspace/cloud ID
Required string length:
1 - 128Base URL of the Jira workspace (e.g. https://acme.atlassian.net)
Forge headless PAT; ignored when session Bearer is present
Minimum string length:
1⌘I
Connect a Jira workspace
curl --request POST \
--url https://{host}/v1/integrations/jira/register_workspace \
--header 'Content-Type: application/json' \
--data '
{
"realm_id": "5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b",
"workspace_id": "1a2b3c4d-acme-cloud",
"workspace_url": "https://acme.atlassian.net",
"webhook_url": "https://acme.atlassian.net/x/webhook"
}
'import requests
url = "https://{host}/v1/integrations/jira/register_workspace"
payload = {
"realm_id": "5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b",
"workspace_id": "1a2b3c4d-acme-cloud",
"workspace_url": "https://acme.atlassian.net",
"webhook_url": "https://acme.atlassian.net/x/webhook"
}
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',
workspace_url: 'https://acme.atlassian.net',
webhook_url: 'https://acme.atlassian.net/x/webhook'
})
};
fetch('https://{host}/v1/integrations/jira/register_workspace', 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/register_workspace",
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',
'workspace_url' => 'https://acme.atlassian.net',
'webhook_url' => 'https://acme.atlassian.net/x/webhook'
]),
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/register_workspace"
payload := strings.NewReader("{\n \"realm_id\": \"5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b\",\n \"workspace_id\": \"1a2b3c4d-acme-cloud\",\n \"workspace_url\": \"https://acme.atlassian.net\",\n \"webhook_url\": \"https://acme.atlassian.net/x/webhook\"\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/register_workspace")
.header("Content-Type", "application/json")
.body("{\n \"realm_id\": \"5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b\",\n \"workspace_id\": \"1a2b3c4d-acme-cloud\",\n \"workspace_url\": \"https://acme.atlassian.net\",\n \"webhook_url\": \"https://acme.atlassian.net/x/webhook\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/v1/integrations/jira/register_workspace")
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 \"workspace_url\": \"https://acme.atlassian.net\",\n \"webhook_url\": \"https://acme.atlassian.net/x/webhook\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"subscription_id": "7b8c9d0e-1f2a-4b3c-8d4e-5f6a7b8c9d0e",
"webhook_secret": "whsec_9f2c…",
"realm_id": "5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b",
"workspace_id": "1a2b3c4d-acme-cloud",
"cliq_user": {
"id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"username": "sshah",
"email": "[email protected]"
}
}
}{
"ok": false,
"error": "invalid api_token",
"code": "unauthorized"
}{
"ok": false,
"error": "realm '5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b' not found",
"code": "not_found"
}{
"ok": false,
"error": "realm_id: Required",
"code": "invalid_params"
}{
"ok": false,
"error": "Internal server error",
"code": "internal_error"
}