# Get Metadata Index

`GET /metadata/index/{collection}` · Core · Data, Queries & Vectors

Get index by collection. (Data, Queries & Vectors) GET `/@:projectSlug/metadata/index/{collection}`.

## Parameters

| Name | In | Required | Description |
|---|---|---|---|
| `collection` | path | yes | The collection's name. Example: `"products"`. |
| `projectSlug` | path | yes | The project's slug: the path segment after `@`. It is unique within the org. Example: `"storefront"`. |

## Responses

- **200**: Success

| Field | Type | Required | Description |
|---|---|---|---|
| `data` | object | yes | The collection's metadata column declaration. |
| `data.collection` | string | yes | The collection name. |
| `data.columns` | array of object | yes | The declared metadata columns. The GET lists them by column name; the PUT echoes them in the order sent. Empty when none are declared. |
| `data.columns.[]column` | string | yes | A column of the collection declared as metadata. |
| `data.columns.[]indexed` | boolean | yes | Whether the column was declared `indexed`. |
| `meta` | object | yes | Request metadata (request id, trace id, timing and cost) plus `cursor.next`: pass it as `cursor` to read the next page, or null when there is no next page. |


## Errors

| HTTP | Code | When |
|---|---|---|
| 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. |
| 400 | `K9O_INVALID_FIELD_VALUE` | The body is malformed: an unknown field, a wrong type, or an unsupported where operator. |

## Code samples

### cURL

```bash
curl -X GET 'https://<org>.api-<region>.k9o.io/@storefront/metadata/index/products' \
  -H 'Authorization: Bearer $K9O_TOKEN'
```

### fetch

```javascript
const res = await fetch('https://<org>.api-<region>.k9o.io/@storefront/metadata/index/products', {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${process.env.K9O_TOKEN}`
  },
});
const { data, meta } = await res.json();
```

### k9o CLI

```bash
k9o metadata index get <collection>
```

### @k9o/core

```typescript
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.metadata.index.get('<collection>')
```

### k9o

```python
# k9o = create_client(org_slug="playground", project_slug="storefront", api_key="k9o_…")
response = k9o.metadata.index.get("<collection>")
```

### sdk-go

```go
// ctx := context.Background()
// client, _ := k9o.NewClient(k9o.ClientOpts{OrgSlug: "playground", ProjectSlug: "storefront", APIKey: "k9o_…"})
data, _, kerr := client.Metadata.Index.Get(ctx, "<collection>")
```

### k9o

```rust
// let k9o = Client::new(ClientOpts { org_slug: "playground".into(), project_slug: "storefront".into(), api_key: "k9o_…".into() })?;
let resp = k9o.metadata.index.get("<collection>").await?
```

### dev.k9o:core

```java
// K9o k9o = K9o.createClient(K9o.Opts.builder().orgSlug("playground").projectSlug("storefront").apiKey("k9o_…").build());
var response = k9o.metadata().index().get("<collection>")
```

### K9o.Core

```c#
// var k9o = K9oClient.Create(new K9oOptions { OrgSlug = "playground", ProjectSlug = "storefront", ApiKey = "k9o_…" });
var response = await k9o.Metadata.Index.GetAsync("<collection>")
```

### k9o

```ruby
# k9o = K9o.create_client(org_slug: "playground", project_slug: "storefront", api_key: "k9o_…")
response = k9o.metadata.index.get("<collection>")
```

### k9o/sdk

```php
// $k9o = K9oClient::create(['org_slug' => 'playground', 'project_slug' => 'storefront', 'api_key' => 'k9o_…']);
$response = $k9o->metadata->index->get('<collection>')
```


Canonical page: https://docs.kilimanjaro.dev/api-playground/core/get-metadata-index
