GET
/metadata/index/{collection}Get Metadata Index
Get index by collection. (Data, Queries & Vectors) GET /@:projectSlug/metadata/index/{collection}.
Parameters
| collection * | path | The collection's name. |
| projectSlug * | path | The project's slug: the path segment after It is unique within the org. |
Responses
| HTTP | K9O Code | Description |
|---|---|---|
| 200 | Success | |
| 400 | K9O_INVALID_FIELD_VALUE | The body is malformed: an unknown field, a wrong type, or an unsupported where operator. |
| 401 | K9O_INVALID_CREDENTIALS | The caller is not authenticated. |
| 403 | K9O_ACCESS_DENIED | The caller has no read access to the collection (the record read's own gate). |
| 403 | K9O_EXTENSION_PERMISSION_DENIED | An extension token: the Metadata API is not extension-callable yet. |
Response body (200)
| data * | object | The collection's metadata column declaration. |
| collection * | string | The collection name. |
| columns * | object[] | The declared metadata columns. The GET lists them by column name; the PUT echoes them in the order sent. Empty when none are declared. |
| column * | string | A column of the collection declared as metadata. |
| indexed * | boolean | Whether the column was declared |
| meta * | any | Request metadata (request id, trace id, timing and cost) plus |
TypeScript
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.metadata.index.get('<collection>')Showing example in TypeScript
Response example (200)
{
"data": {
"collection": "string",
"columns": [
{
"column": "string",
"indexed": false
}
]
}
}