> ## Documentation Index
> Fetch the complete documentation index at: https://developers.unize.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate Graph

> Generate a knowledge graph from a document or a list of documents



## OpenAPI

````yaml post /v1/storage/
openapi: 3.0.3
info:
  title: Unize API
  version: 1.0.0
  description: Unize API
servers: []
security: []
paths:
  /v1/storage/:
    post:
      tags:
        - Storage (API & Playground)
      description: Generate a knowledge graph from a document or a list of documents
      operationId: Create Graph
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GraphPost'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/GraphPost'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/GraphPost'
        required: true
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GraphPostResponse'
          description: ''
      security:
        - Authentication: []
components:
  schemas:
    GraphPost:
      type: object
      properties:
        graph_id:
          type: string
          format: uuid
          description: >-
            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:
          type: string
          description: >-
            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:
          type: string
          maxLength: 750
          minLength: 10
          description: >-
            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.
        documents:
          type: array
          items:
            $ref: '#/components/schemas/GraphDocument'
          minItems: 1
          description: >-
            List of documents to be processed. A minimum of 1 document is
            required.
        system:
          enum:
            - st-0.75
            - st-0.5
          type: string
          description: >-
            * `st-0.75` (default) - newest, more accurate, and cheapest Storage
            system

            * `st-0.5` (legacy) - only works with normal and user-defined
            extraction modes
          x-spec-enum-id: 18ed669db57337c7
          default: st-0.75
        extraction_mode:
          enum:
            - normal
            - detailed
            - user_defined
          type: string
          description: >-
            * `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
          x-spec-enum-id: 27d5c7e6f587a627
          default: normal
      required:
        - documents
    GraphPostResponse:
      type: object
      properties:
        graph_id:
          type: string
          format: uuid
          description: >-
            An alphanumeric string that uniquely identifies the generated
            knowledge graph.
      required:
        - graph_id
    GraphDocument:
      type: object
      properties:
        text:
          type: string
          description: The text to generate a knowledge graph from.
        source_title:
          type: string
          description: >-
            The title of the text. This will also be used as the title of the
            generated knowledge graph if no `graph_name` is provided.
        source_url:
          type: string
          description: The URL of the text. This is optional.
        source_author:
          type: string
          description: The person who wrote the text. This is optional.
        source_article_date:
          type: string
          description: >-
            The date when the text was published or written, or last updated.
            This is optional.
        override_extraction_criteria:
          type: string
          maxLength: 750
          minLength: 10
          description: >-
            This will overwrite the general `extraction_criteria` set for this
            specific API call. This `override_extraction_criteria` will only be
            used with this specific document.
      required:
        - source_title
        - text
  securitySchemes:
    Authentication:
      type: apiKey
      in: header
      name: Authorization
      description: |-
        Send the API generated from the Playground:
        - `Authorization: <api_key>`

````