Skip to main content
POST
/
memories
/
update
/
{source}
/
{resource_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 memoryStatus = await client.memories.update('resource_id', { source: 'reddit' });

console.log(memoryStatus.resource_id);
import os
from hyperspell import Hyperspell

client = Hyperspell(
api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted
)
memory_status = client.memories.update(
resource_id="resource_id",
source="reddit",
)
print(memory_status.resource_id)
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"),
)
memoryStatus, err := client.Memories.Update(
context.TODO(),
"resource_id",
hyperspell.MemoryUpdateParams{
Source: hyperspell.MemoryUpdateParamsSourceReddit,
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", memoryStatus.ResourceID)
}
hyperspell memories update \
--api-key 'My API Key' \
--source reddit \
--resource-id resource_id
curl --request POST \
--url https://api.hyperspell.com/memories/update/{source}/{resource_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": {},
"collection": {},
"title": {},
"date": {},
"metadata": {}
}
'
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hyperspell.com/memories/update/{source}/{resource_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'text' => [

],
'collection' => [

],
'title' => [

],
'date' => [

],
'metadata' => [

]
]),
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;
}
HttpResponse<String> response = Unirest.post("https://api.hyperspell.com/memories/update/{source}/{resource_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": {},\n \"collection\": {},\n \"title\": {},\n \"date\": {},\n \"metadata\": {}\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.hyperspell.com/memories/update/{source}/{resource_id}")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": {},\n \"collection\": {},\n \"title\": {},\n \"date\": {},\n \"metadata\": {}\n}"

response = http.request(request)
puts response.read_body
{
  "resource_id": "<string>"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

Authorizations

Authorization
string
header
required

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.

Path Parameters

source
enum<string>
required
Available options:
reddit,
notion,
slack,
google_calendar,
google_mail,
box,
dropbox,
github,
google_drive,
vault,
web_crawler,
trace,
microsoft_teams,
gmail_actions,
granola,
fathom,
fireflies,
linear,
hubspot,
salesforce,
coda,
lightfield,
gong,
pylon,
clickup
resource_id
string
required

Body

application/json
text
default:{}

Full text of the document. If provided, the document will be re-indexed.

collection
default:{}
deprecated

The collection to move the document to — deprecated, set the collection using metadata instead.

title
default:{}

Title of the document.

date
default:{}

Date of the document for ranking and filtering.

metadata

Custom metadata for filtering. Keys must be alphanumeric with underscores, max 64 chars. Values must be string, number, boolean, or null. Will be merged with existing metadata.

Response

Successful Response

source
enum<string>
required
Available options:
reddit,
notion,
slack,
google_calendar,
google_mail,
box,
dropbox,
github,
google_drive,
vault,
web_crawler,
trace,
microsoft_teams,
gmail_actions,
granola,
fathom,
fireflies,
linear,
hubspot,
salesforce,
coda,
lightfield,
gong,
pylon,
clickup
resource_id
string
required
status
enum<string>
required
Available options:
pending,
processing,
completed,
failed,
pending_review,
skipped