Update Slack configuration
curl --request PUT \
--url http://localhost:3001/api/v1/slack/config \
--header 'Content-Type: application/json' \
--cookie nut-session= \
--data '
{
"enabled": true,
"botToken": "xoxb-...",
"signingSecret": "<string>",
"channelId": "C0123456789",
"channelName": "#coconut-notifications",
"siteUrl": "https://my-coconut.example.com",
"notifications": {
"proposals": {
"created": true,
"statusChange": true
},
"jobs": {
"completed": true,
"failed": true
},
"git": {
"push": true,
"merge": true
}
}
}
'import requests
url = "http://localhost:3001/api/v1/slack/config"
payload = {
"enabled": True,
"botToken": "xoxb-...",
"signingSecret": "<string>",
"channelId": "C0123456789",
"channelName": "#coconut-notifications",
"siteUrl": "https://my-coconut.example.com",
"notifications": {
"proposals": {
"created": True,
"statusChange": True
},
"jobs": {
"completed": True,
"failed": True
},
"git": {
"push": True,
"merge": True
}
}
}
headers = {
"cookie": "nut-session=",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {cookie: 'nut-session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
enabled: true,
botToken: 'xoxb-...',
signingSecret: '<string>',
channelId: 'C0123456789',
channelName: '#coconut-notifications',
siteUrl: 'https://my-coconut.example.com',
notifications: {
proposals: {created: true, statusChange: true},
jobs: {completed: true, failed: true},
git: {push: true, merge: true}
}
})
};
fetch('http://localhost:3001/api/v1/slack/config', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3001",
CURLOPT_URL => "http://localhost:3001/api/v1/slack/config",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => true,
'botToken' => 'xoxb-...',
'signingSecret' => '<string>',
'channelId' => 'C0123456789',
'channelName' => '#coconut-notifications',
'siteUrl' => 'https://my-coconut.example.com',
'notifications' => [
'proposals' => [
'created' => true,
'statusChange' => true
],
'jobs' => [
'completed' => true,
'failed' => true
],
'git' => [
'push' => true,
'merge' => true
]
]
]),
CURLOPT_COOKIE => "nut-session=",
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 := "http://localhost:3001/api/v1/slack/config"
payload := strings.NewReader("{\n \"enabled\": true,\n \"botToken\": \"xoxb-...\",\n \"signingSecret\": \"<string>\",\n \"channelId\": \"C0123456789\",\n \"channelName\": \"#coconut-notifications\",\n \"siteUrl\": \"https://my-coconut.example.com\",\n \"notifications\": {\n \"proposals\": {\n \"created\": true,\n \"statusChange\": true\n },\n \"jobs\": {\n \"completed\": true,\n \"failed\": true\n },\n \"git\": {\n \"push\": true,\n \"merge\": true\n }\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("cookie", "nut-session=")
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.put("http://localhost:3001/api/v1/slack/config")
.header("cookie", "nut-session=")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"botToken\": \"xoxb-...\",\n \"signingSecret\": \"<string>\",\n \"channelId\": \"C0123456789\",\n \"channelName\": \"#coconut-notifications\",\n \"siteUrl\": \"https://my-coconut.example.com\",\n \"notifications\": {\n \"proposals\": {\n \"created\": true,\n \"statusChange\": true\n },\n \"jobs\": {\n \"completed\": true,\n \"failed\": true\n },\n \"git\": {\n \"push\": true,\n \"merge\": true\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3001/api/v1/slack/config")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["cookie"] = 'nut-session='
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true,\n \"botToken\": \"xoxb-...\",\n \"signingSecret\": \"<string>\",\n \"channelId\": \"C0123456789\",\n \"channelName\": \"#coconut-notifications\",\n \"siteUrl\": \"https://my-coconut.example.com\",\n \"notifications\": {\n \"proposals\": {\n \"created\": true,\n \"statusChange\": true\n },\n \"jobs\": {\n \"completed\": true,\n \"failed\": true\n },\n \"git\": {\n \"push\": true,\n \"merge\": true\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"enabled": true,
"channelId": "C0123456789",
"channelName": "#coconut-notifications",
"siteUrl": "https://my-coconut.example.com",
"notifications": {
"proposals": {
"created": true,
"statusChange": true
},
"jobs": {
"completed": true,
"failed": true
},
"git": {
"push": true,
"merge": true
}
},
"hasBotToken": true,
"hasSigningSecret": true
}
}{
"success": true,
"error": {
"code": "<string>",
"message": "<string>"
}
}Slack
Update Slack configuration
Updates Slack configuration. Only provided fields are updated.
PUT
/
api
/
v1
/
slack
/
config
Update Slack configuration
curl --request PUT \
--url http://localhost:3001/api/v1/slack/config \
--header 'Content-Type: application/json' \
--cookie nut-session= \
--data '
{
"enabled": true,
"botToken": "xoxb-...",
"signingSecret": "<string>",
"channelId": "C0123456789",
"channelName": "#coconut-notifications",
"siteUrl": "https://my-coconut.example.com",
"notifications": {
"proposals": {
"created": true,
"statusChange": true
},
"jobs": {
"completed": true,
"failed": true
},
"git": {
"push": true,
"merge": true
}
}
}
'import requests
url = "http://localhost:3001/api/v1/slack/config"
payload = {
"enabled": True,
"botToken": "xoxb-...",
"signingSecret": "<string>",
"channelId": "C0123456789",
"channelName": "#coconut-notifications",
"siteUrl": "https://my-coconut.example.com",
"notifications": {
"proposals": {
"created": True,
"statusChange": True
},
"jobs": {
"completed": True,
"failed": True
},
"git": {
"push": True,
"merge": True
}
}
}
headers = {
"cookie": "nut-session=",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {cookie: 'nut-session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
enabled: true,
botToken: 'xoxb-...',
signingSecret: '<string>',
channelId: 'C0123456789',
channelName: '#coconut-notifications',
siteUrl: 'https://my-coconut.example.com',
notifications: {
proposals: {created: true, statusChange: true},
jobs: {completed: true, failed: true},
git: {push: true, merge: true}
}
})
};
fetch('http://localhost:3001/api/v1/slack/config', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3001",
CURLOPT_URL => "http://localhost:3001/api/v1/slack/config",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => true,
'botToken' => 'xoxb-...',
'signingSecret' => '<string>',
'channelId' => 'C0123456789',
'channelName' => '#coconut-notifications',
'siteUrl' => 'https://my-coconut.example.com',
'notifications' => [
'proposals' => [
'created' => true,
'statusChange' => true
],
'jobs' => [
'completed' => true,
'failed' => true
],
'git' => [
'push' => true,
'merge' => true
]
]
]),
CURLOPT_COOKIE => "nut-session=",
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 := "http://localhost:3001/api/v1/slack/config"
payload := strings.NewReader("{\n \"enabled\": true,\n \"botToken\": \"xoxb-...\",\n \"signingSecret\": \"<string>\",\n \"channelId\": \"C0123456789\",\n \"channelName\": \"#coconut-notifications\",\n \"siteUrl\": \"https://my-coconut.example.com\",\n \"notifications\": {\n \"proposals\": {\n \"created\": true,\n \"statusChange\": true\n },\n \"jobs\": {\n \"completed\": true,\n \"failed\": true\n },\n \"git\": {\n \"push\": true,\n \"merge\": true\n }\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("cookie", "nut-session=")
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.put("http://localhost:3001/api/v1/slack/config")
.header("cookie", "nut-session=")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"botToken\": \"xoxb-...\",\n \"signingSecret\": \"<string>\",\n \"channelId\": \"C0123456789\",\n \"channelName\": \"#coconut-notifications\",\n \"siteUrl\": \"https://my-coconut.example.com\",\n \"notifications\": {\n \"proposals\": {\n \"created\": true,\n \"statusChange\": true\n },\n \"jobs\": {\n \"completed\": true,\n \"failed\": true\n },\n \"git\": {\n \"push\": true,\n \"merge\": true\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3001/api/v1/slack/config")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["cookie"] = 'nut-session='
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true,\n \"botToken\": \"xoxb-...\",\n \"signingSecret\": \"<string>\",\n \"channelId\": \"C0123456789\",\n \"channelName\": \"#coconut-notifications\",\n \"siteUrl\": \"https://my-coconut.example.com\",\n \"notifications\": {\n \"proposals\": {\n \"created\": true,\n \"statusChange\": true\n },\n \"jobs\": {\n \"completed\": true,\n \"failed\": true\n },\n \"git\": {\n \"push\": true,\n \"merge\": true\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"enabled": true,
"channelId": "C0123456789",
"channelName": "#coconut-notifications",
"siteUrl": "https://my-coconut.example.com",
"notifications": {
"proposals": {
"created": true,
"statusChange": true
},
"jobs": {
"completed": true,
"failed": true
},
"git": {
"push": true,
"merge": true
}
},
"hasBotToken": true,
"hasSigningSecret": true
}
}{
"success": true,
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
sessionCookiebearerAuthapiKey
Session cookie authentication
Body
application/json
Partial update to Slack configuration. Only provided fields are updated.
Enable or disable Slack notifications
Bot User OAuth Token (starts with xoxb-)
Example:
"xoxb-..."
Slack app signing secret
Slack channel ID to post notifications to
Example:
"C0123456789"
Slack channel display name
Example:
"#coconut-notifications"
Site URL for notification links
Example:
"https://my-coconut.example.com"
Per-type notification enable/disable settings
Show child attributes
Show child attributes
⌘I