---
title: "Get KG package contents"
method: GET
path: "/api/v0/graph-packages/{slug}/{version}"
tags: ["Knowledge Base Graph"]
---

# Get KG package contents

`GET /api/v0/graph-packages/{slug}/{version}`

## Request

- Base URL: `https://api.outerport.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.outerport.com/api/v0/graph-packages/{slug}/{version}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/outerport/apis/outerport-api/docs/api/v0/graph-packages/:slug/:version/get.ts> (a function with typed inputs; its response is checked against the schema)

Returns the full entity and relationship type metadata for one Package, joining the package's id lists against ENTITY_TYPE_REGISTRY and RELATIONSHIP_TYPE_REGISTRY.

## Path parameters

- `slug` string, required
- `version` string, required

## Response `200`

Successful Response

- PackageContents: Every type a Package declares, in the same catalog-item shape as the per-collection type endpoints. ``node_count`` / ``edge_count`` are always 0 here (a Package holds no instances); do not present them as "no instances exist".
  - `slug` string, required
  - `version` string, required
  - `display_name` string, required
  - `description` string, required
  - `entity_types` EntityTypeCatalogItem[], required
    - `type_id` string, required
    - `display_name` string, required
    - `description` string, required
    - `tier` 'representation' | 'domain', required
    - `attribute_fields` AttributeFieldSpec[], required
      - `name` string, required
      - `kind` string, required
      - `required` boolean
      - `description` string
      - `enum_values` string[], nullable
      - `label` string, nullable
      - `instant` boolean: Whether the field holds an ISO-8601 date or time a reader may order records by: always for a date or datetime field, and for a text field its type declares holds one.
    - `derived_properties` DerivedPropertyDefOutput[]
      - `id` string, required
      - `description` string
      - `rule` union, required
        - PatternMapRule: Derive a value from one stored field on the same entity: the field's text is matched (case-insensitive ``re.search``) against ``cases`` in order; misses fall back to ``default``. ``source_field`` is ``"name"`` or a stored-attribute id, never another derived property.
          - `kind` 'pattern_map'
          - `source_field` string
          - `cases` PatternCase[], required
            - `pattern` string, required
            - `value` string, required
          - `default` string, nullable
        - EdgeDegreeRule: Derive the count of the entity's own incident edges of one relationship type. ``node_role`` picks which end the entity sits on (``source`` = outgoing, ``target`` = incoming, ``either`` = both).
          - `kind` 'edge_degree'
          - `relationship_type_id` string, required
          - `node_role` 'source' | 'target' | 'either'
          - `minimum` integer: How many of these edges the ontology requires an instance to have. Zero means optional: an instance with none is complete, and no reader may present it as missing anything. This is the cardinality constraint — a count on its own is a measurement, and deciding after the fact that a zero looks wrong because other instances have more is a guess about the corpus rather than a statement of the ontology.
      - `label` string, nullable
    - `origin` string, required
    - `editable` boolean, required
    - `public_id` string, uuid, nullable, required
    - `node_count` integer, required
    - `source_bindings` SourceBindingSpec[]
      - `source_kind` string, required: A source in the source schema catalog, e.g. email.
      - `role` string, required: A class role or link role that source offers.
      - `field_map` object: Attribute of the class -> field of the role that fills it. A relationship's binding maps nothing.
    - `edits_package` boolean
    - `package_editable` boolean
    - `package_attribute_names` string[]
  - `relationship_types` RelationshipTypeCatalogItem[], required
    - `type_id` string, required
    - `display_name` string, required
    - `description` string, required
    - `attribute_fields` AttributeFieldSpec[], required
      - `name` string, required
      - `kind` string, required
      - `required` boolean
      - `description` string
      - `enum_values` string[], nullable
      - `label` string, nullable
      - `instant` boolean: Whether the field holds an ISO-8601 date or time a reader may order records by: always for a date or datetime field, and for a text field its type declares holds one.
    - `origin` string, required
    - `editable` boolean, required
    - `public_id` string, uuid, nullable, required
    - `edits_package` boolean
    - `package_editable` boolean
    - `source_tier` 'representation' | 'domain', required
    - `target_tier` 'representation' | 'domain', required
    - `source_entity_type_ids` string[]
    - `target_entity_type_ids` string[]
    - `source_accepts_any` boolean
    - `target_accepts_any` boolean
    - `symmetric` boolean
    - `edge_count` integer, required
    - `source_bindings` SourceBindingSpec[]
      - `source_kind` string, required: A source in the source schema catalog, e.g. email.
      - `role` string, required: A class role or link role that source offers.
      - `field_map` object: Attribute of the class -> field of the role that fills it. A relationship's binding maps nothing.
  - `hierarchy` HierarchyLevelResponse[]
    - `entity_type_id` string, required
    - `via_relationship_type_id` string, nullable
    - `via_points_up` boolean
    - `shadowed_by` string[]

## Other responses

- `422`: Validation Error

## Changes

- **2026-11-09** `ecd5b922e78a`: 8 info
  - added the optional property `entity_types/items/attribute_fields/items/instant` to the response with the `200` status
  - added the optional property `entity_types/items/edits_package` to the response with the `200` status
  - added the optional property `entity_types/items/package_attribute_names` to the response with the `200` status
  - added the optional property `entity_types/items/package_editable` to the response with the `200` status
  - …4 more
- **2026-10-22** `762a02693cbb`: 2 info
  - added the optional property `entity_types/items/source_bindings` to the response with the `200` status
  - added the optional property `relationship_types/items/source_bindings` to the response with the `200` status
- **2026-10-22** `fd2664afd5a3`: 3 info
  - added the optional property `entity_types/items/attribute_fields/items/label` to the response with the `200` status
  - added the optional property `entity_types/items/derived_properties/items/label` to the response with the `200` status
  - added the optional property `relationship_types/items/attribute_fields/items/label` to the response with the `200` status
- …earlier changes not shown

[Operation history](https://skmtc.dev/outerport/apis/outerport-api/changes/api/v0/graph-packages/:slug/:version/get.md)

---

[API](https://skmtc.dev/outerport/apis/outerport-api.md) - [All operations](https://skmtc.dev/outerport/apis/outerport-api/llms.txt) - [OpenAPI document](https://skmtc.dev/outerport/apis/outerport-api/revisions/08b5bf6f7f18?raw)
