Delete Memory
DELETE /api/memories/{memoryId}
Deletes an existing memory.
Code Examples
- cURL
- Node.js
- Python
- PHP
- Java
- Go
- .NET
- Ruby
curl --request DELETE \
--url 'https://tess.pareto.io/api/memories/{memoryId}' \
--header 'Authorization: Bearer YOUR_API_KEY'
const axios = require('axios');
const memoryId = 123;
const options = {
method: 'DELETE',
url: `https://tess.pareto.io/api/memories/${memoryId}`,
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
};
axios.request(options)
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
import requests
memoryId = 123
url = f"https://tess.pareto.io/api/memories/{memoryId}"
headers = {
"Authorization": "Bearer YOUR_API_KEY"
}
response = requests.delete(url, headers=headers)
print(response.json())
<?php
$memoryId = 123;
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://tess.pareto.io/api/memories/{$memoryId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOUR_API_KEY"
]
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error: " . $err;
} else {
echo $response;
}
?>
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
public class DeleteMemory {
public static void main(String[] args) {
int memoryId = 123;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://tess.pareto.io/api/memories/" + memoryId))
.header("Authorization", "Bearer YOUR_API_KEY")
.DELETE()
.build();
client.sendAsync(request, HttpResponse.BodyHandlers.ofString())
.thenApply(HttpResponse::body)
.thenAccept(System.out::println)
.join();
}
}
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
memoryId := 123
url := fmt.Sprintf("https://tess.pareto.io/api/memories/%d", memoryId)
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer YOUR_API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(string(body))
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
int memoryId = 123;
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", "YOUR_API_KEY");
var response = await client.DeleteAsync($"https://tess.pareto.io/api/memories/{memoryId}");
var content = await response.Content.ReadAsStringAsync();
Console.WriteLine(content);
}
}
}
require 'uri'
require 'net/http'
require 'json'
memoryId = 123
url = URI("https://tess.pareto.io/api/memories/#{memoryId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = "Bearer YOUR_API_KEY"
response = http.request(request)
puts response.read_body
Path Parameters
Parameter | Type | Required | Description |
---|---|---|---|
memoryId | integer | Yes | ID of the memory |
Response
{
"message": "Memory deleted successfully!"
}
Response Codes
Status Code | Description |
---|---|
200 | Success |
404 | Memory not found |
500 | Server error |
Error Responses
404 Not Found
{
"message": "Memory not found!"
}
500 Server Error
{
"message": "Memory deletion failed!",
"error": "Error message details"
}
Try it out!
Authentication
This endpoint requires Bearer token authentication.