Python
# To use the Python SDK, install the package:
# pip install memobase
from memobase import MemoBaseClient
memobase = MemoBaseClient(project_url='PROJECT_URL', api_key='PROJECT_TOKEN')
memobase.update_config('your_profile_config')// To use the JavaScript SDK, install the package:
// npm install @memobase/memobase
import { MemoBaseClient } from '@memobase/memobase';
const client = new MemoBaseClient(process.env.MEMOBASE_PROJECT_URL, process.env.MEMOBASE_API_KEY);
await client.updateConfig('your_profile_config');// To use the Go SDK, install the package:
// go get github.com/memodb-io/memobase/src/client/memobase-go@latest
import (
"fmt"
"log"
"github.com/memodb-io/memobase/src/client/memobase-go/core"
)
func main() {
projectURL := "YOUR_PROJECT_URL"
apiKey := "YOUR_API_KEY"
// Initialize the client
client, err := core.NewMemoBaseClient(
projectURL,
apiKey,
)
if err != nil {
log.Fatalf("Failed to create client: %v", err)
}
// Update config
err = client.UpdateConfig("your_profile_config")
if err != nil {
log.Fatalf("Failed to update config: %v", err)
}
fmt.Println("Successfully updated config")
}curl --request POST \
--url https://api.memobase.dev/api/v1/project/profile_config \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"profile_config": "<string>"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.memobase.dev/api/v1/project/profile_config",
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([
'profile_config' => '<string>'
]),
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.memobase.dev/api/v1/project/profile_config")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"profile_config\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.memobase.dev/api/v1/project/profile_config")
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 \"profile_config\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {},
"errno": 0,
"errmsg": ""
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Project
Update Current Profile Config
POST
/
api
/
v1
/
project
/
profile_config
Python
# To use the Python SDK, install the package:
# pip install memobase
from memobase import MemoBaseClient
memobase = MemoBaseClient(project_url='PROJECT_URL', api_key='PROJECT_TOKEN')
memobase.update_config('your_profile_config')// To use the JavaScript SDK, install the package:
// npm install @memobase/memobase
import { MemoBaseClient } from '@memobase/memobase';
const client = new MemoBaseClient(process.env.MEMOBASE_PROJECT_URL, process.env.MEMOBASE_API_KEY);
await client.updateConfig('your_profile_config');// To use the Go SDK, install the package:
// go get github.com/memodb-io/memobase/src/client/memobase-go@latest
import (
"fmt"
"log"
"github.com/memodb-io/memobase/src/client/memobase-go/core"
)
func main() {
projectURL := "YOUR_PROJECT_URL"
apiKey := "YOUR_API_KEY"
// Initialize the client
client, err := core.NewMemoBaseClient(
projectURL,
apiKey,
)
if err != nil {
log.Fatalf("Failed to create client: %v", err)
}
// Update config
err = client.UpdateConfig("your_profile_config")
if err != nil {
log.Fatalf("Failed to update config: %v", err)
}
fmt.Println("Successfully updated config")
}curl --request POST \
--url https://api.memobase.dev/api/v1/project/profile_config \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"profile_config": "<string>"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.memobase.dev/api/v1/project/profile_config",
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([
'profile_config' => '<string>'
]),
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.memobase.dev/api/v1/project/profile_config")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"profile_config\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.memobase.dev/api/v1/project/profile_config")
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 \"profile_config\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {},
"errno": 0,
"errmsg": ""
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Updates the current profile config. Checkout more details in Profile Config.
Below is an example of your profile config:
Your profile config will not as strong as the
overwrite_user_profiles:
- topic: "User Basic Information"
sub_topics:
- name: "Name"
- name: "Gender"
- name: "Age"
- name: "Occupation"
description: "For example, a programmer"
- name: "City"
- topic: "User Pet Information"
sub_topics:
- name: "Purpose of Pet Ownership"
- name: "Attitude Towards Pet Ownership"
description: "whether they like to play with the pet"
- name: "Pet Medical Habits"
description: "Whether they are accustomed to finding medicine themselves"
...
config.yaml you used to start Memobase server,
it only affect the profile slots.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
The profile config to update
Profile config string
⌘I