Create Plugin
curl --request POST \
--url https://use.hoop.dev/api/plugins \
--header 'Content-Type: application/json' \
--data '
{
"connections": [
{
"config": [
"EMAIL_ADDRESS",
"URL"
],
"id": "B702C63C-E6EB-46BB-9D1E-90EA077E4582",
"name": "pgdemo"
}
],
"name": "slack",
"config": {
"envvars": {
"SLACK_APP_TOKEN": "eC1hcHAtdG9rZW4=",
"SLACK_BOT_TOKEN": "eG94Yi10b2tlbg=="
}
},
"priority": 0,
"source": "null"
}
'import requests
url = "https://use.hoop.dev/api/plugins"
payload = {
"connections": [
{
"config": ["EMAIL_ADDRESS", "URL"],
"id": "B702C63C-E6EB-46BB-9D1E-90EA077E4582",
"name": "pgdemo"
}
],
"name": "slack",
"config": { "envvars": {
"SLACK_APP_TOKEN": "eC1hcHAtdG9rZW4=",
"SLACK_BOT_TOKEN": "eG94Yi10b2tlbg=="
} },
"priority": 0,
"source": "null"
}
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({
connections: [
{
config: ['EMAIL_ADDRESS', 'URL'],
id: 'B702C63C-E6EB-46BB-9D1E-90EA077E4582',
name: 'pgdemo'
}
],
name: 'slack',
config: {
envvars: {SLACK_APP_TOKEN: 'eC1hcHAtdG9rZW4=', SLACK_BOT_TOKEN: 'eG94Yi10b2tlbg=='}
},
priority: 0,
source: 'null'
})
};
fetch('https://use.hoop.dev/api/plugins', 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://use.hoop.dev/api/plugins",
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([
'connections' => [
[
'config' => [
'EMAIL_ADDRESS',
'URL'
],
'id' => 'B702C63C-E6EB-46BB-9D1E-90EA077E4582',
'name' => 'pgdemo'
]
],
'name' => 'slack',
'config' => [
'envvars' => [
'SLACK_APP_TOKEN' => 'eC1hcHAtdG9rZW4=',
'SLACK_BOT_TOKEN' => 'eG94Yi10b2tlbg=='
]
],
'priority' => 0,
'source' => 'null'
]),
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://use.hoop.dev/api/plugins"
payload := strings.NewReader("{\n \"connections\": [\n {\n \"config\": [\n \"EMAIL_ADDRESS\",\n \"URL\"\n ],\n \"id\": \"B702C63C-E6EB-46BB-9D1E-90EA077E4582\",\n \"name\": \"pgdemo\"\n }\n ],\n \"name\": \"slack\",\n \"config\": {\n \"envvars\": {\n \"SLACK_APP_TOKEN\": \"eC1hcHAtdG9rZW4=\",\n \"SLACK_BOT_TOKEN\": \"eG94Yi10b2tlbg==\"\n }\n },\n \"priority\": 0,\n \"source\": \"null\"\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://use.hoop.dev/api/plugins")
.header("Content-Type", "application/json")
.body("{\n \"connections\": [\n {\n \"config\": [\n \"EMAIL_ADDRESS\",\n \"URL\"\n ],\n \"id\": \"B702C63C-E6EB-46BB-9D1E-90EA077E4582\",\n \"name\": \"pgdemo\"\n }\n ],\n \"name\": \"slack\",\n \"config\": {\n \"envvars\": {\n \"SLACK_APP_TOKEN\": \"eC1hcHAtdG9rZW4=\",\n \"SLACK_BOT_TOKEN\": \"eG94Yi10b2tlbg==\"\n }\n },\n \"priority\": 0,\n \"source\": \"null\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://use.hoop.dev/api/plugins")
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 \"connections\": [\n {\n \"config\": [\n \"EMAIL_ADDRESS\",\n \"URL\"\n ],\n \"id\": \"B702C63C-E6EB-46BB-9D1E-90EA077E4582\",\n \"name\": \"pgdemo\"\n }\n ],\n \"name\": \"slack\",\n \"config\": {\n \"envvars\": {\n \"SLACK_APP_TOKEN\": \"eC1hcHAtdG9rZW4=\",\n \"SLACK_BOT_TOKEN\": \"eG94Yi10b2tlbg==\"\n }\n },\n \"priority\": 0,\n \"source\": \"null\"\n}"
response = http.request(request)
puts response.read_body{
"connections": [
{
"config": [
"EMAIL_ADDRESS",
"URL"
],
"id": "B702C63C-E6EB-46BB-9D1E-90EA077E4582",
"name": "pgdemo"
}
],
"name": "slack",
"config": {
"envvars": {
"SLACK_APP_TOKEN": "eC1hcHAtdG9rZW4=",
"SLACK_BOT_TOKEN": "eG94Yi10b2tlbg=="
},
"id": "D9A998B3-AA7B-49B0-8463-C9E36435FC0B"
},
"id": "15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7",
"priority": 0,
"source": "null"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}Plugins
Create Plugin
Create Plugin resource
POST
/
plugins
Create Plugin
curl --request POST \
--url https://use.hoop.dev/api/plugins \
--header 'Content-Type: application/json' \
--data '
{
"connections": [
{
"config": [
"EMAIL_ADDRESS",
"URL"
],
"id": "B702C63C-E6EB-46BB-9D1E-90EA077E4582",
"name": "pgdemo"
}
],
"name": "slack",
"config": {
"envvars": {
"SLACK_APP_TOKEN": "eC1hcHAtdG9rZW4=",
"SLACK_BOT_TOKEN": "eG94Yi10b2tlbg=="
}
},
"priority": 0,
"source": "null"
}
'import requests
url = "https://use.hoop.dev/api/plugins"
payload = {
"connections": [
{
"config": ["EMAIL_ADDRESS", "URL"],
"id": "B702C63C-E6EB-46BB-9D1E-90EA077E4582",
"name": "pgdemo"
}
],
"name": "slack",
"config": { "envvars": {
"SLACK_APP_TOKEN": "eC1hcHAtdG9rZW4=",
"SLACK_BOT_TOKEN": "eG94Yi10b2tlbg=="
} },
"priority": 0,
"source": "null"
}
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({
connections: [
{
config: ['EMAIL_ADDRESS', 'URL'],
id: 'B702C63C-E6EB-46BB-9D1E-90EA077E4582',
name: 'pgdemo'
}
],
name: 'slack',
config: {
envvars: {SLACK_APP_TOKEN: 'eC1hcHAtdG9rZW4=', SLACK_BOT_TOKEN: 'eG94Yi10b2tlbg=='}
},
priority: 0,
source: 'null'
})
};
fetch('https://use.hoop.dev/api/plugins', 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://use.hoop.dev/api/plugins",
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([
'connections' => [
[
'config' => [
'EMAIL_ADDRESS',
'URL'
],
'id' => 'B702C63C-E6EB-46BB-9D1E-90EA077E4582',
'name' => 'pgdemo'
]
],
'name' => 'slack',
'config' => [
'envvars' => [
'SLACK_APP_TOKEN' => 'eC1hcHAtdG9rZW4=',
'SLACK_BOT_TOKEN' => 'eG94Yi10b2tlbg=='
]
],
'priority' => 0,
'source' => 'null'
]),
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://use.hoop.dev/api/plugins"
payload := strings.NewReader("{\n \"connections\": [\n {\n \"config\": [\n \"EMAIL_ADDRESS\",\n \"URL\"\n ],\n \"id\": \"B702C63C-E6EB-46BB-9D1E-90EA077E4582\",\n \"name\": \"pgdemo\"\n }\n ],\n \"name\": \"slack\",\n \"config\": {\n \"envvars\": {\n \"SLACK_APP_TOKEN\": \"eC1hcHAtdG9rZW4=\",\n \"SLACK_BOT_TOKEN\": \"eG94Yi10b2tlbg==\"\n }\n },\n \"priority\": 0,\n \"source\": \"null\"\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://use.hoop.dev/api/plugins")
.header("Content-Type", "application/json")
.body("{\n \"connections\": [\n {\n \"config\": [\n \"EMAIL_ADDRESS\",\n \"URL\"\n ],\n \"id\": \"B702C63C-E6EB-46BB-9D1E-90EA077E4582\",\n \"name\": \"pgdemo\"\n }\n ],\n \"name\": \"slack\",\n \"config\": {\n \"envvars\": {\n \"SLACK_APP_TOKEN\": \"eC1hcHAtdG9rZW4=\",\n \"SLACK_BOT_TOKEN\": \"eG94Yi10b2tlbg==\"\n }\n },\n \"priority\": 0,\n \"source\": \"null\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://use.hoop.dev/api/plugins")
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 \"connections\": [\n {\n \"config\": [\n \"EMAIL_ADDRESS\",\n \"URL\"\n ],\n \"id\": \"B702C63C-E6EB-46BB-9D1E-90EA077E4582\",\n \"name\": \"pgdemo\"\n }\n ],\n \"name\": \"slack\",\n \"config\": {\n \"envvars\": {\n \"SLACK_APP_TOKEN\": \"eC1hcHAtdG9rZW4=\",\n \"SLACK_BOT_TOKEN\": \"eG94Yi10b2tlbg==\"\n }\n },\n \"priority\": 0,\n \"source\": \"null\"\n}"
response = http.request(request)
puts response.read_body{
"connections": [
{
"config": [
"EMAIL_ADDRESS",
"URL"
],
"id": "B702C63C-E6EB-46BB-9D1E-90EA077E4582",
"name": "pgdemo"
}
],
"name": "slack",
"config": {
"envvars": {
"SLACK_APP_TOKEN": "eC1hcHAtdG9rZW4=",
"SLACK_BOT_TOKEN": "eG94Yi10b2tlbg=="
},
"id": "D9A998B3-AA7B-49B0-8463-C9E36435FC0B"
},
"id": "15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7",
"priority": 0,
"source": "null"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}Body
application/json
The request body resource
The list of connections configured for a specific plugin
Show child attributes
Show child attributes
The name of the plugin to enable
- audit - Audit connections
- access_control - Enable access control by groups
- dlp - Enable Google Data Loss Prevention (requires further configuration)
- indexer - Enable indexing session contents
- review - Enable reviewing executions
- runbooks - Enable configuring runbooks
- slack - Enable reviewing execution through Slack
- webhooks - Send events via webhooks
Available options:
audit, access_control, dlp, indexer, review, runbooks, slack, webhooks Example:
"slack"
The top level plugin configuration. This value is immutable after creation
Show child attributes
Show child attributes
DEPRECATED, should be always 0
DEPRECATED, should be always null
Response
Created
The list of connections configured for a specific plugin
Show child attributes
Show child attributes
The name of the plugin to enable
- audit - Audit connections
- access_control - Enable access control by groups
- dlp - Enable Google Data Loss Prevention (requires further configuration)
- indexer - Enable indexing session contents
- review - Enable reviewing executions
- runbooks - Enable configuring runbooks
- slack - Enable reviewing execution through Slack
- webhooks - Send events via webhooks
Available options:
audit, access_control, dlp, indexer, review, runbooks, slack, webhooks Example:
"slack"
The top level plugin configuration. This value is immutable after creation
Show child attributes
Show child attributes
The resource identifier
Example:
"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7"
DEPRECATED, should be always 0
DEPRECATED, should be always null
Was this page helpful?
⌘I