Request cURL
curl -s -X DELETE "https://app.upfour.io/v1/organization" \
-H "Authorization: Bearer $UP4_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"organization_name": "Acme GmbH",
"password": "••••"
}'
JavaScript
const res = await fetch("https://app.upfour.io/v1/organization", {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.UP4_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
organization_name: "Acme GmbH",
password: "••••",
}),
});
console.log(res.status);
Python
import os
import requests
res = requests.delete(
"https://app.upfour.io/v1/organization",
headers={"Authorization": f"Bearer {os.environ['UP4_API_KEY']}"},
json={
"organization_name": "Acme GmbH",
"password": "••••",
},
)
print(res.status_code)
Go
package main
import (
"fmt"
"net/http"
"os"
"strings"
)
func main() {
payload := strings.NewReader(`{
"organization_name": "Acme GmbH",
"password": "••••"
}`)
req, _ := http.NewRequest("DELETE", "https://app.upfour.io/v1/organization", payload)
req.Header.Set("Authorization", "Bearer "+os.Getenv("UP4_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
fmt.Println(res.StatusCode)
}
PHP
<?php
$payload = <<<'JSON'
{
"organization_name": "Acme GmbH",
"password": "••••"
}
JSON;
$ch = curl_init("https://app.upfour.io/v1/organization");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("UP4_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => $payload,
]);
$response = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), "\n";
curl_close($ch);
Response
204
Deleted
400
{
"error": {
"code": "bad_request",
"message": "The request is malformed or fails validation.",
"request_id": "req_…"
}
}
403
{
"error": {
"code": "permission_denied",
"message": "The credentials do not permit this action.",
"request_id": "req_…"
}
}