Skip to main content
POST
/
v1
/
storage
/
cURL
curl --request POST \
  --url https://api.unize.org/v1/storage/ \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "documents": [
    {
      "text": "<string>",
      "source_title": "<string>",
      "source_url": "<string>",
      "source_author": "<string>",
      "source_article_date": "<string>",
      "override_extraction_criteria": "<string>"
    }
  ],
  "graph_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "graph_name": "<string>",
  "extraction_criteria": "<string>",
  "system": "st-0.75",
  "extraction_mode": "normal"
}
'
import requests

url = "https://api.unize.org/v1/storage/"

payload = {
    "documents": [
        {
            "text": "<string>",
            "source_title": "<string>",
            "source_url": "<string>",
            "source_author": "<string>",
            "source_article_date": "<string>",
            "override_extraction_criteria": "<string>"
        }
    ],
    "graph_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "graph_name": "<string>",
    "extraction_criteria": "<string>",
    "system": "st-0.75",
    "extraction_mode": "normal"
}
headers = {
    "Authorization": "<api-key>",
    "Content-Type": "application/json"
}

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

print(response.text)
const options = {
  method: 'POST',
  headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    documents: [
      {
        text: '<string>',
        source_title: '<string>',
        source_url: '<string>',
        source_author: '<string>',
        source_article_date: '<string>',
        override_extraction_criteria: '<string>'
      }
    ],
    graph_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
    graph_name: '<string>',
    extraction_criteria: '<string>',
    system: 'st-0.75',
    extraction_mode: 'normal'
  })
};

fetch('https://api.unize.org/v1/storage/', 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.unize.org/v1/storage/",
  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([
    'documents' => [
        [
                'text' => '<string>',
                'source_title' => '<string>',
                'source_url' => '<string>',
                'source_author' => '<string>',
                'source_article_date' => '<string>',
                'override_extraction_criteria' => '<string>'
        ]
    ],
    'graph_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
    'graph_name' => '<string>',
    'extraction_criteria' => '<string>',
    'system' => 'st-0.75',
    'extraction_mode' => 'normal'
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: <api-key>",
    "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.unize.org/v1/storage/"

	payload := strings.NewReader("{\n  \"documents\": [\n    {\n      \"text\": \"<string>\",\n      \"source_title\": \"<string>\",\n      \"source_url\": \"<string>\",\n      \"source_author\": \"<string>\",\n      \"source_article_date\": \"<string>\",\n      \"override_extraction_criteria\": \"<string>\"\n    }\n  ],\n  \"graph_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"graph_name\": \"<string>\",\n  \"extraction_criteria\": \"<string>\",\n  \"system\": \"st-0.75\",\n  \"extraction_mode\": \"normal\"\n}")

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

	req.Header.Add("Authorization", "<api-key>")
	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.unize.org/v1/storage/")
  .header("Authorization", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"documents\": [\n    {\n      \"text\": \"<string>\",\n      \"source_title\": \"<string>\",\n      \"source_url\": \"<string>\",\n      \"source_author\": \"<string>\",\n      \"source_article_date\": \"<string>\",\n      \"override_extraction_criteria\": \"<string>\"\n    }\n  ],\n  \"graph_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"graph_name\": \"<string>\",\n  \"extraction_criteria\": \"<string>\",\n  \"system\": \"st-0.75\",\n  \"extraction_mode\": \"normal\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.unize.org/v1/storage/")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"documents\": [\n    {\n      \"text\": \"<string>\",\n      \"source_title\": \"<string>\",\n      \"source_url\": \"<string>\",\n      \"source_author\": \"<string>\",\n      \"source_article_date\": \"<string>\",\n      \"override_extraction_criteria\": \"<string>\"\n    }\n  ],\n  \"graph_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"graph_name\": \"<string>\",\n  \"extraction_criteria\": \"<string>\",\n  \"system\": \"st-0.75\",\n  \"extraction_mode\": \"normal\"\n}"

response = http.request(request)
puts response.read_body
{
  "graph_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}

Authorizations

Authorization
string
header
required

Send the API generated from the Playground:

  • Authorization: <api_key>

Body

documents
object[]
required

List of documents to be processed. A minimum of 1 document is required.

Minimum array length: 1
graph_id
string<uuid>

An alphanumeric string that uniquely identifies a generated knowledge graph. Provide the graph_id of an existing knoweldge graph to add new data to it. If omitted, a new knoweldge graph will be created instead of updating an existing one.

graph_name
string

A unique identifier or label for the knowledge graph being imported. It should be descriptive enough to indicate the graph's content, purpose, or source (e.g., 'medical_research_graph' or 'customer_support_kg'). If not provided, defaults to source_title of the first document.

extraction_criteria
string

Specify the criteria that the system must follow when generating the knoweldge graph. This parameter is only applicable when extraction_mode is set to user_defined. If extraction_criteria is provided while extraction_mode is set to any value other than user_defined, the API will return an error.

Required string length: 10 - 750
system
enum<string>
default:st-0.75
  • st-0.75 (default) - newest, more accurate, and cheapest Storage system
  • st-0.5 (legacy) - only works with normal and user-defined extraction modes
Available options:
st-0.75,
st-0.5
extraction_mode
enum<string>
default:normal
  • normal - extracts all key entities (e.g. 'John Doe') and their relationships
  • detailed - extracts all entities and relationships
  • user_defined - extracts all entities and relationships based on the extraction_criteria provided by the user
Available options:
normal,
detailed,
user_defined

Response

202 - application/json
graph_id
string<uuid>
required

An alphanumeric string that uniquely identifies the generated knowledge graph.