---
title: "Get stream schema"
method: GET
path: "/api/{org_id}/streams/{stream_name}/schema"
tags: ["Streams"]
---

# Get stream schema

`GET /api/{org_id}/streams/{stream_name}/schema`

## Request

- Base URL: `https://api.openobserve.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.openobserve.ai/api/{org_id}/streams/{stream_name}/schema`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/openobserve/apis/openobserve-api-http/docs/api/:org_id/streams/:stream_name/schema/get.ts> (a function with typed inputs; its response is checked against the schema)

Retrieves the schema definition for a specific stream, including field types and metadata. Supports filtering by keyword and pagination

## Path parameters

- `org_id` string, required
- `stream_name` string, required

## Query parameters

- `type` string
- `keyword` string
- `offset` integer
- `limit` integer

## Response `200`

Success

- Stream
  - `inherited_retention_days` integer, nullable: Days the stream keeps data with no value of its own, 0 for forever; set by the schema read.
  - `is_derived` boolean, nullable
  - `is_internal` boolean: True for streams OpenObserve writes itself; omitted when false.
  - `metrics_meta` Metadata
    - `help` string, required
    - `metric_family_name` string, required
    - `metric_type` 'Unknown' | 'Counter' | 'Gauge' | 'Histogram' | 'GaugeHistogram' | 'ExponentialHistogram' | 'Summary' | 'Info' | 'StateSet' | 'Empty', required
    - `unit` string, required
  - `name` string, required
  - `pattern_associations` PatternAssociation[]
    - `apply_at` string, required
    - `description` string, required
    - `field` string, required
    - `pattern` string, required
    - `pattern_id` string, required
    - `pattern_name` string, required
    - `policy` string, required
  - `schema` StreamField[], required
    - `name` string, required
    - `type` string, required
  - `settings` StreamSettings, required
    - `approx_partition` boolean
    - `bloom_filter_fields` string[]
    - `cross_links` CrossLink[]
      - `fields` CrossLinkField[]: Show link only when at least one field matches the record. If empty, the link is always shown.
        - `alias` string, nullable: Populated by result_schema: the alias used in the query for this field.
        - `name` string, required
      - `name` string, required: Display name for the link
      - `url` string, required: URL template with {field_name} placeholders
    - `data_retention` integer
    - `defined_schema_fields` string[]
    - `distinct_value_fields` DistinctField[]
      - `added_ts` integer, required
      - `name` string, required
    - `enable_distinct_fields` boolean
    - `enable_log_patterns_extraction` boolean
    - `extended_retention_days` TimeRange[]
      - `end` integer, required: End timestamp in microseconds
      - `start` integer, required: Start timestamp in microseconds
    - `flatten_level` integer, nullable
    - `full_text_search_keys` string[]
    - `index_all_values` boolean
    - `index_fields` string[]
    - `index_fields_updated_at` object
    - `index_original_data` boolean
    - `index_updated_at` integer
    - `is_llm_stream` boolean
    - `max_query_range` integer
    - `partition_keys` StreamPartition[]
      - `disabled` boolean
      - `field` string, required
      - `types` union
        - 'value'
        - object
          - `hash` integer, required
        - 'prefix'
    - `partition_time_level` StreamPartitionTimeLevel: A stream's partition level per day; a day's level never changes once the day has begun.
      - `changes` PartitionTimeLevelChange[]
        - `level` 'unset' | 'hourly' | 'daily', required
        - `since` integer, required
      - `dynamic` boolean, nullable: The stream's own classifier switch; unset follows `ZO_DYNAMIC_PARTITION_STREAM_TYPES`.
    - `storage_type` 'normal' | 'compliance'
    - `store_original_data` boolean
  - `stats` StreamStats, required
    - `compressed_size` number, double, required
    - `created_at` integer, required
    - `doc_num` integer, required
    - `doc_time_max` integer, required
    - `doc_time_min` integer, required
    - `file_num` integer, required
    - `index_size` number, double, required
    - `mindex_size` number, double
    - `storage_size` number, double, required
  - `storage_type` string, required
  - `stream_type` 'logs' | 'metrics' | 'traces' | 'profiles' | 'service_graph' | 'enrichment_tables' | 'file_list' | 'metadata' | 'index', required
  - `total_fields` integer, required
  - `uds_schema` StreamField[]
    - `name` string, required
    - `type` string, required

## Other responses

- `400`: Failure

---

[API](https://skmtc.dev/openobserve/apis/openobserve-api-http.md) - [All operations](https://skmtc.dev/openobserve/apis/openobserve-api-http/llms.txt) - [OpenAPI document](https://skmtc.dev/openobserve/apis/openobserve-api-http/revisions/0529b8a10252?raw)
