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

# Get Ontology

> Retrieve complete ontology details including schema

## Endpoint

```
GET https://api.intellibase.dev/api/v1/ontologies/{ontology_id}
```

## Path Parameters

<ParamField path="ontology_id" type="string" required>
  The unique identifier of the ontology
</ParamField>

## Authentication

Requires a valid API key.

## Response

<ResponseField name="id" type="string">
  Unique identifier for the ontology
</ResponseField>

<ResponseField name="name" type="string">
  Ontology name
</ResponseField>

<ResponseField name="created_at" type="string" format="datetime">
  When the ontology was created
</ResponseField>

<ResponseField name="schema" type="object">
  Complete ontology schema including hierarchy and edge types
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl https://api.intellibase.dev/api/v1/ontologies/ont-abc123 \
    -H "Authorization: Bearer ib-your-api-key"
  ```

  ```python Python theme={null}
  import requests

  ontology_id = "ont-abc123"

  response = requests.get(
      f"https://api.intellibase.dev/api/v1/ontologies/{ontology_id}",
      headers={"Authorization": "Bearer ib-your-api-key"}
  )

  ontology = response.json()
  print(f"Ontology: {ontology['name']}")
  print(f"Hierarchy levels: {len(ontology['schema']['ontology']['hierarchy'])}")
  print(f"Edge types: {len(ontology['schema']['ontology']['edge_types'])}")
  ```

  ```typescript TypeScript theme={null}
  const ontologyId = "ont-abc123";

  const response = await fetch(
    `https://api.intellibase.dev/api/v1/ontologies/${ontologyId}`,
    {
      headers: {
        "Authorization": "Bearer ib-your-api-key"
      }
    }
  );

  const ontology = await response.json();
  console.log(`Ontology: ${ontology.name}`);
  console.log(`Hierarchy levels: ${ontology.schema.ontology.hierarchy.length}`);
  console.log(`Edge types: ${ontology.schema.ontology.edge_types.length}`);
  ```
</RequestExample>

<ResponseExample>
  ```json 200 Success theme={null}
  {
    "id": "ont-abc123",
    "name": "Software Engineering",
    "created_at": "2024-01-15T10:30:00Z",
    "schema": {
      "ontology": {
        "hierarchy": [
          {
            "level": 0,
            "node_types": {
              "Developer": {
                "properties": ["name", "role", "team"],
                "description": "Software developer"
              },
              "Feature": {
                "properties": ["name", "status", "deadline"],
                "description": "Software feature"
              }
            }
          },
          {
            "level": 1,
            "node_types": {
              "Team": {
                "aggregates": ["Developer"],
                "properties": ["name", "focus"],
                "description": "Engineering team"
              }
            }
          }
        ],
        "edge_types": [
          {
            "name": "WORKS_ON",
            "source_types": ["Developer"],
            "target_types": ["Feature"],
            "properties": ["role"],
            "temporal": true,
            "description": "Developer works on feature"
          }
        ]
      }
    }
  }
  ```

  ```json 404 Not Found theme={null}
  {
    "detail": "Ontology not found"
  }
  ```

  ```json 401 Unauthorized theme={null}
  {
    "detail": "Invalid API key"
  }
  ```
</ResponseExample>

<Info>
  Use this endpoint to retrieve the complete ontology schema before creating a project or to inspect the structure.
</Info>
