---
title: "SpecVersion"
description: "The `SpecVersion` entity."
section: "Reference"
group: "Types"
order: 212
---

## Definition

```ts
interface SpecVersion {
  id: string;
  specId: string;
  version: string;
  spec: unknown;
  parentId: string | null;
  fetchedAt: string;
}
```

## Fields

| Field       | Type             | Notes                                                                                                                                                          |
| ----------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`        | `string`         | `readonly` `required`                                                                                                                                          |
| `specId`    | `string`         | `required` — Parent spec.                                                                                                                                      |
| `version`   | `string`         | `required` — Stable version identifier — the spec's `info.version` if present, else a content hash of the spec bytes. Lets refresh detect 'no change, skip'.   |
| `spec`      | `unknown`        | `required` — Raw OpenAPI spec at this version. Stored as JSONB; consumers should expect the OpenAPI / Swagger schema shape but the entity treats it as opaque. |
| `parentId`  | `string \| null` | `required` — Previous version in the history chain. Null for the first.                                                                                        |
| `fetchedAt` | `string`         | `required` — ISO-8601 timestamp the spec was fetched and ingested.                                                                                             |
