DELETE v0/subscriptions
This endpoint will delete a subscription if it exists and is owned by the current user.
id
— string
(required)The ID of the subscription to be deleted. Fetch this ID via the GET /subscriptions endpoint.
string
"Successfully deleted subscription: 0145f6d3-401c-4fc9-9915-0e11a2471991"
curl \
-X DELETE 'https://t.tech/v0/subscriptions?id=%22REPLACE%20ME%22' \
-H 'Authorization: Bearer <YOUR API KEY>'
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
url := "https://t.tech/v0/subscriptions?id=%22REPLACE%20ME%22"
apiKey := "Your API Key" // Replace with your actual token
req, err := http.NewRequest("DELETE", url, nil)
if err != nil {
fmt.Println("Error creating request:", err)
return
}
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", apiKey))
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error sending request:", err)
return
}
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil {
fmt.Println("Error reading response body:", err)
return
}
fmt.Println("Status:", resp.Status)
fmt.Println("Response:", string(body))
}
// Cargo.toml dependencies:
// [dependencies]
// reqwest = { version = "0.12" }
// tokio = { version = "1.46", features = ["macros", "rt-multi-thread"] }
use reqwest::{Client, header};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
let url = "https://t.tech/v0/subscriptions?id=%22REPLACE%20ME%22";
let api_key = "Your API Key"; // Replace with your actual token
let res = client
.delete(url)
.bearer_auth(api_key)
.send()
.await?;
let status = res.status();
let body = res.text().await?;
println!("Status: {}", status);
println!("Response: {}", body);
Ok(())
}