curl --request POST \
--url https://api.example.com/v1/memory/entities \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"type": "<string>",
"source": {
"source_type": "<string>",
"source_id": "<string>",
"source_title": "<string>"
}
}
'import requests
url = "https://api.example.com/v1/memory/entities"
payload = {
"name": "<string>",
"type": "<string>",
"source": {
"source_type": "<string>",
"source_id": "<string>",
"source_title": "<string>"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
type: '<string>',
source: {source_type: '<string>', source_id: '<string>', source_title: '<string>'}
})
};
fetch('https://api.example.com/v1/memory/entities', 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.example.com/v1/memory/entities",
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([
'name' => '<string>',
'type' => '<string>',
'source' => [
'source_type' => '<string>',
'source_id' => '<string>',
'source_title' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"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.example.com/v1/memory/entities"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"source\": {\n \"source_type\": \"<string>\",\n \"source_id\": \"<string>\",\n \"source_title\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://api.example.com/v1/memory/entities")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"source\": {\n \"source_type\": \"<string>\",\n \"source_id\": \"<string>\",\n \"source_title\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/memory/entities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"source\": {\n \"source_type\": \"<string>\",\n \"source_id\": \"<string>\",\n \"source_title\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"entity_id": "<string>",
"entity_type": "<string>",
"name": "<string>",
"created": true
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Create or retrieve an entity
Idempotent endpoint: inserts a new entity into the registry if one with the same name and type does not already exist. Returns the entity_id and a created flag indicating whether a new row was inserted. When source is provided the endpoint also creates a source node and a :MENTIONED_IN edge in FalkorDB (T11). The FalkorDB node label is derived from source.source_type (e.g. 'knowledge_document' → KnowledgeDocument).
curl --request POST \
--url https://api.example.com/v1/memory/entities \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"type": "<string>",
"source": {
"source_type": "<string>",
"source_id": "<string>",
"source_title": "<string>"
}
}
'import requests
url = "https://api.example.com/v1/memory/entities"
payload = {
"name": "<string>",
"type": "<string>",
"source": {
"source_type": "<string>",
"source_id": "<string>",
"source_title": "<string>"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
type: '<string>',
source: {source_type: '<string>', source_id: '<string>', source_title: '<string>'}
})
};
fetch('https://api.example.com/v1/memory/entities', 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.example.com/v1/memory/entities",
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([
'name' => '<string>',
'type' => '<string>',
'source' => [
'source_type' => '<string>',
'source_id' => '<string>',
'source_title' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"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.example.com/v1/memory/entities"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"source\": {\n \"source_type\": \"<string>\",\n \"source_id\": \"<string>\",\n \"source_title\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://api.example.com/v1/memory/entities")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"source\": {\n \"source_type\": \"<string>\",\n \"source_id\": \"<string>\",\n \"source_title\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/memory/entities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"source\": {\n \"source_type\": \"<string>\",\n \"source_id\": \"<string>\",\n \"source_title\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"entity_id": "<string>",
"entity_type": "<string>",
"name": "<string>",
"created": true
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Body
Request body for POST /entities.
Entity display name.
1 - 512Entity type (e.g. 'company', 'person'). Stored title-cased.
1 - 100Optional source reference. When provided, a source node is created/merged in FalkorDB and a :MENTIONED_IN edge is added from the entity to the source. The FalkorDB node label is derived from source_type (e.g. 'knowledge_document' → KnowledgeDocument).
Show child attributes
Show child attributes