JavaScript
import Hyperspell from '@hyperspell/hyperspell';
const client = new Hyperspell({
apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted
});
const response = await client.folders.deletePolicy('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
connection_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
});
console.log(response.success);import os
from hyperspell import Hyperspell
client = Hyperspell(
api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted
)
response = client.folders.delete_policy(
policy_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
connection_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(response.success)package main
import (
"context"
"fmt"
"github.com/hyperspell/hyperspell-go"
"github.com/hyperspell/hyperspell-go/option"
)
func main() {
client := hyperspell.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Folders.DeletePolicy(
context.TODO(),
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
hyperspell.FolderDeletePolicyParams{
ConnectionID: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Success)
}
hyperspell folders delete-policy \
--api-key 'My API Key' \
--connection-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
--policy-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26ecurl --request DELETE \
--url https://api.hyperspell.com/connections/{connection_id}/folder-policies/{policy_id} \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hyperspell.com/connections/{connection_id}/folder-policies/{policy_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.delete("https://api.hyperspell.com/connections/{connection_id}/folder-policies/{policy_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperspell.com/connections/{connection_id}/folder-policies/{policy_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Folder Policies
Delete a folder policy
Delete a folder policy for a specific connection.
DELETE
/
connections
/
{connection_id}
/
folder-policies
/
{policy_id}
JavaScript
import Hyperspell from '@hyperspell/hyperspell';
const client = new Hyperspell({
apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted
});
const response = await client.folders.deletePolicy('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
connection_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
});
console.log(response.success);import os
from hyperspell import Hyperspell
client = Hyperspell(
api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted
)
response = client.folders.delete_policy(
policy_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
connection_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(response.success)package main
import (
"context"
"fmt"
"github.com/hyperspell/hyperspell-go"
"github.com/hyperspell/hyperspell-go/option"
)
func main() {
client := hyperspell.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Folders.DeletePolicy(
context.TODO(),
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
hyperspell.FolderDeletePolicyParams{
ConnectionID: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Success)
}
hyperspell folders delete-policy \
--api-key 'My API Key' \
--connection-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
--policy-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26ecurl --request DELETE \
--url https://api.hyperspell.com/connections/{connection_id}/folder-policies/{policy_id} \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hyperspell.com/connections/{connection_id}/folder-policies/{policy_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.delete("https://api.hyperspell.com/connections/{connection_id}/folder-policies/{policy_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperspell.com/connections/{connection_id}/folder-policies/{policy_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
APIKeyAsUser
API Key or JWT User Token. If using an API Key, set the X-As-User header to act as a specific user. A JWT User Token is always scoped to a specific user.
Response
Successful Response
Whether the deletion was successful
Was this page helpful?
⌘I