Skip to main content
PATCH
/
memories
/
{memoryId}
Update Memory
curl --request PATCH \
  --url https://api.tess.im/memories/{memoryId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "memory": "<string>",
  "collection_id": 123
}
'
import requests

url = "https://api.tess.im/memories/{memoryId}"

payload = {
    "memory": "<string>",
    "collection_id": 123
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({memory: '<string>', collection_id: 123})
};

fetch('https://api.tess.im/memories/{memoryId}', 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://api.tess.im/memories/{memoryId}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PATCH",
  CURLOPT_POSTFIELDS => json_encode([
    'memory' => '<string>',
    'collection_id' => 123
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "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://api.tess.im/memories/{memoryId}"

	payload := strings.NewReader("{\n  \"memory\": \"<string>\",\n  \"collection_id\": 123\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	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.patch("https://api.tess.im/memories/{memoryId}")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"memory\": \"<string>\",\n  \"collection_id\": 123\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.tess.im/memories/{memoryId}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"memory\": \"<string>\",\n  \"collection_id\": 123\n}"

response = http.request(request)
puts response.read_body

Code Examples

curl --request PATCH \
  --url 'https://api.tess.im/memories/{memoryId}' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "memory": "Updated memory content",
    "collection_id": 1
  }'
const axios = require('axios');

const data = {
  memory: "Updated memory content",
  collection_id: 1
};

const config = {
  method: 'patch',
  url: 'https://api.tess.im/memories/{memoryId}',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  data: data
};

try {
  const response = await axios(config);
  console.log(response.data);
} catch (error) {
  console.error(error);
}
import requests
import json

url = "https://api.tess.im/memories/{memoryId}"
payload = {
  "memory": "Updated memory content",
  "collection_id": 1
}
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}

response = requests.patch(url, headers=headers, json=payload)
print(response.json())
<?php
$curl = curl_init();

$data = [
  "memory" => "Updated memory content",
  "collection_id" => 1
];

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.tess.im/memories/{memoryId}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PATCH",
  CURLOPT_POSTFIELDS => json_encode($data),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer YOUR_API_KEY",
    "Content-Type: application/json"
  ]
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "Error: " . $err;
} else {
  echo $response;
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

String jsonBody = "{\"memory\":\"Updated memory content\",\"collection_id\":1}";

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.tess.im/memories/{memoryId}"))
    .header("Authorization", "Bearer YOUR_API_KEY")
    .header("Content-Type", "application/json")
    .method("PATCH", HttpRequest.BodyPublishers.ofString(jsonBody))
    .build();

HttpResponse<String> response = client.send(request,
    HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "io/ioutil"
    "net/http"
)

func main() {
    data := map[string]interface{}{
        "memory":        "Updated memory content",
        "collection_id": 1,
    }
    
    jsonData, _ := json.Marshal(data)
    
    client := &http.Client{}
    req, err := http.NewRequest("PATCH", "https://api.tess.im/memories/{memoryId}", bytes.NewBuffer(jsonData))
    if err != nil {
        fmt.Println(err)
        return
    }
    
    req.Header.Add("Authorization", "Bearer YOUR_API_KEY")
    req.Header.Add("Content-Type", "application/json")
    
    resp, err := client.Do(req)
    if err != nil {
        fmt.Println(err)
        return
    }
    defer resp.Body.Close()
    
    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        fmt.Println(err)
        return
    }
    
    fmt.Println(string(body))
}
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main(string[] args)
    {
        using (var client = new HttpClient())
        {
            client.DefaultRequestHeaders.Add("Authorization", "Bearer YOUR_API_KEY");
            
            var data = @"{
                ""memory"": ""Updated memory content"",
                ""collection_id"": 1
            }";
            
            var content = new StringContent(data, Encoding.UTF8, "application/json");
            
            try
            {
                var response = await client.PatchAsync("https://api.tess.im/memories/{memoryId}", content);
                response.EnsureSuccessStatusCode();
                string responseBody = await response.Content.ReadAsStringAsync();
                Console.WriteLine(responseBody);
            }
            catch(HttpRequestException e)
            {
                Console.WriteLine("\nException Caught!");
                Console.WriteLine("Message :{0} ",e.Message);
            }
        }
    }
}
require 'uri'
require 'net/http'
require 'json'

uri = URI('https://api.tess.im/memories/{memoryId}')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(uri)
request['Authorization'] = 'Bearer YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = {
  memory: 'Updated memory content',
  collection_id: 1
}.to_json

response = http.request(request)
puts response.read_body

Path Parameters

memoryId
integer
required
ID of the memory to update

Request Body

memory
string
required
New memory content
collection_id
integer
Collection ID to associate the memory
{
  "memory": "Updated memory content",
  "collection_id": 1
}

Response

{
"message": "Memory updated successfully!",
"memory": {
  "id": 10,
  "user_id": 1,
  "memory": "Updated memory content",
  "credits": 0,
  "collection_id": 1,
  "collection": {
    "id": 1,
    "user_id": 1,
    "name": "default"
  }
}
}

Response Codes

CodeDescription
200Success
404Memory not found
500Server error