/schema/collections/{name}Get Collection
Returns full schema detail for a single named collection, including:
- all columns (with type, nullability, primary-key flag, default, and
vectorDimensionforvector(N)columns) - declared relationships (from the migration
policysection) - indexes with their current build status (
active,building, orinvalid)
Reserved columns are flagged with reserved: true.
Returns K9O_COLLECTION_NOT_FOUND (404) if the name does not exist in the project schema.
Requires PROJECT_MEMBER role minimum.
| name * | path | The collection's name: a letter or |
| projectSlug * | path | The project's slug: the path segment after It is unique within the org. |
| HTTP | K9O Code | Description |
|---|---|---|
| 200 | Success | |
| 401 | K9O_SESSION_EXPIRED | Your session has expired; re-authenticate and retry. |
| 403 | K9O_ACCESS_DENIED | Your account does not have the required role (PROJECT_MEMBER or higher) to view this collection's schema. |
| 404 | K9O_COLLECTION_NOT_FOUND | No collection with that name exists in this project. |
| data * | object | The collection's structure: columns, relationships, indexes and access scope, with its live row count. |
| name * | string | The collection (table) name. |
| rowCount * | integer | The live row count (soft-deleted rows excluded), counted without row-level security, so it can exceed what your own reads return. |
| rowCountIsExact * | true | Always true: |
| lastMigrationSlug * | any | The slug of the most recent migration that touched the collection; null when none did (for example a collection created outside migrations). |
| One of: string | ||
| or: null | ||
| lastMigrationAppliedAt * | any | When that migration was applied; null when no migration touched the collection. |
| One of: string <date-time> | ||
| or: null | ||
| ownerColumn * | any | The collection's per-subject owner column (its value is the end user's id); null for a shared collection. |
| One of: string | ||
| or: null | ||
| gateScope * | "owner" | "none" | The gate scope the collection declares. Default |
| endUserScope * | "owner" | "deny" | "open" | What an end user can reach. |
| columns * | object[] | The columns, in table order. |
| name * | string | The column name. |
| type * | string | The column's Postgres type as |
| nullable * | boolean | Whether the column accepts null. |
| isPrimary * | boolean | Whether the column is part of the primary key. |
| isUnique * | boolean | Whether the column has a single-column unique constraint. |
| default * | any | The column's default as a SQL expression; null when it has none. |
| One of: string | ||
| or: null | ||
| vectorDimension * | any | For a |
| One of: integer | ||
| or: null | ||
| reserved * | boolean | True for a platform-reserved column (its name starts with Reserved columns are read-only to you. |
| isOwnerColumn * | boolean | True when this is the collection's per-subject owner column (its value is the end user's id). |
| protection * | any | The column's field-level encryption; null for an unprotected column. |
| One of: object | ||
| encrypted * | true | Always true for a protected column. |
| store * | "inline" | "vault" |
|
| blindIndexed * | boolean | An Always false for |
| searchable * | boolean | A Always false for |
| revealGated * | boolean | True when reading the plaintext requires a stated purpose (a reveal gate). |
| or: null | ||
| relationships * | object[] | Declared relationships, by join alias. |
| column * | string | The column holding the reference. |
| joinAlias * | string | The name to embed the related row under in a query. |
| joinType * | string | The join kind in query syntax: |
| targetCollection * | string | The collection the column refers to. |
| indexes * | object[] | The collection's indexes, by name. |
| name * | string | The index name. |
| columns * | string[] | The indexed columns, in index order. Expression parts are left out. |
| type * | string | The index method, for example |
| unique * | boolean | Whether the index enforces uniqueness. |
| status * | "active" | "building" | "invalid" |
|
| meta * | any | Request metadata: cost, timing and correlation ids. The list adds |
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.schema.collections.get('products')Showing example in TypeScript
{
"data": {
"name": "string",
"rowCount": 0,
"rowCountIsExact": true,
"lastMigrationSlug": "string",
"lastMigrationAppliedAt": "string",
"ownerColumn": "string",
"gateScope": "owner",
"endUserScope": "owner",
"columns": [
{
"name": "string",
"type": "string",
"nullable": false,
"isPrimary": false,
"isUnique": false,
"default": "string",
"vectorDimension": 0,
"reserved": false,
"isOwnerColumn": false,
"protection": {
"encrypted": true,
"store": "inline",
"blindIndexed": false,
"searchable": false,
"revealGated": false
}
}
],
"relationships": [
{
"column": "string",
"joinAlias": "string",
"joinType": "string",
"targetCollection": "string"
}
],
"indexes": [
{
"name": "string",
"columns": [
"string"
],
"type": "string",
"unique": false,
"status": "active"
}
]
}
}