{
  "openapi": "3.2.0",
  "info": {
    "description": "Data Schema API provides RESTful access to IKG (IndyKite Knowledge Graph) schema metadata in JGFv2 format.",
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0"
    },
    "title": "Data Schema REST API",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://eu.api.indykite.com/data-schema/v1"
    },
    {
      "url": "https://us.api.indykite.com/data-schema/v1"
    }
  ],
  "security": [
    {
      "APIKey": []
    }
  ],
  "tags": [
    {
      "description": "DataSchema enables customers to define their own data models within the Identity Knowledge Graph (IKG)",
      "name": "DataSchema"
    }
  ],
  "paths": {
    "/": {
      "get": {
        "description": "Read the IKG data schema for the specified Project in JGFv2 format.",
        "operationId": "ReadDataSchema",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dataschema.JGFGraph"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/restapi.ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/restapi.DetailedError"
                }
              }
            },
            "description": "Data schema not found for the specified Project"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Read Data Schema",
        "tags": [
          "DataSchema"
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "dataschema.JGFEdge": {
        "properties": {
          "directed": {
            "type": "boolean"
          },
          "metadata": {
            "$ref": "#/components/schemas/dataschema.JGFEdgeMetadata"
          },
          "relation": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "target": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "dataschema.JGFEdgeMetadata": {
        "properties": {
          "count": {
            "format": "int64",
            "type": "integer"
          },
          "properties": {
            "additionalProperties": {
              "$ref": "#/components/schemas/dataschema.JGFEdgeProperty"
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "dataschema.JGFEdgeProperty": {
        "properties": {
          "count": {
            "format": "int64",
            "type": "integer"
          },
          "types": {
            "items": {
              "$ref": "#/components/schemas/dataschema.JGFPropertyType"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "dataschema.JGFGraph": {
        "properties": {
          "graph": {
            "$ref": "#/components/schemas/dataschema.JGFGraphContent"
          }
        },
        "type": "object"
      },
      "dataschema.JGFGraphContent": {
        "properties": {
          "directed": {
            "type": "boolean"
          },
          "edges": {
            "items": {
              "$ref": "#/components/schemas/dataschema.JGFEdge"
            },
            "type": "array"
          },
          "metadata": {
            "$ref": "#/components/schemas/dataschema.JGFGraphMetadata"
          },
          "nodes": {
            "additionalProperties": {
              "$ref": "#/components/schemas/dataschema.JGFNode"
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "dataschema.JGFGraphMetadata": {
        "properties": {
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "dataschema.JGFLabel": {
        "properties": {
          "count": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "dataschema.JGFNode": {
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/dataschema.JGFNodeMetadata"
          }
        },
        "type": "object"
      },
      "dataschema.JGFNodeMetadata": {
        "properties": {
          "node_count": {
            "format": "int64",
            "type": "integer"
          },
          "properties": {
            "additionalProperties": {
              "$ref": "#/components/schemas/dataschema.JGFNodeProperty"
            },
            "type": "object"
          },
          "system_labels": {
            "items": {
              "$ref": "#/components/schemas/dataschema.JGFLabel"
            },
            "type": "array"
          },
          "user_defined_labels": {
            "items": {
              "$ref": "#/components/schemas/dataschema.JGFLabel"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "dataschema.JGFNodeProperty": {
        "properties": {
          "count": {
            "format": "int64",
            "type": "integer"
          },
          "metadata": {
            "additionalProperties": {
              "$ref": "#/components/schemas/dataschema.JGFPropertyMeta"
            },
            "type": "object"
          },
          "types": {
            "items": {
              "$ref": "#/components/schemas/dataschema.JGFPropertyType"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "dataschema.JGFPropertyMeta": {
        "properties": {
          "count": {
            "format": "int64",
            "type": "integer"
          },
          "types": {
            "items": {
              "$ref": "#/components/schemas/dataschema.JGFPropertyType"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "dataschema.JGFPropertyType": {
        "properties": {
          "count": {
            "format": "int64",
            "type": "integer"
          },
          "type": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "restapi.DetailedError": {
        "properties": {
          "errors": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "message": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "restapi.ErrorResponse": {
        "properties": {
          "message": {
            "examples": [
              "Internal Server Error"
            ],
            "type": "string"
          }
        },
        "type": "object"
      }
    },
    "securitySchemes": {
      "APIKey": {
        "description": "The value of the App Agent credential header must be passed as is, without any prefix.",
        "in": "header",
        "name": "X-IK-ClientKey",
        "type": "apiKey"
      }
    }
  }
}