<@U04S8PLJWMT> how can I fetch the schema of a str...
# ask-ai
s
@kapa.ai how can I fetch the schema of a stream, including column types, from the Airbyte API?
k
To fetch the schema of a stream, including column types, from the Airbyte API, you should use the schema discovery endpoint rather than the
/v1/streams
or
/streamproperties
endpoints. The
/v1/streams
and
/streamproperties
endpoints do not return column data types—only field names and related metadata. This limitation has been confirmed in multiple GitHub issues and user reports, where users noted that these endpoints do not provide the data type information for columns, and this is a known gap in the public API [[GitHub Issue 41646](https://github.com/airbytehq/airbyte/issues/41646)] [[GitHub Issue 44489](https://github.com/airbytehq/airbyte/issues/44489)]. Instead, you should use the schema discovery API, which is available at:
Copy code
POST /v1/sources/discover_schema
This endpoint will return the full schema, including the data types for each field. This is the recommended way to programmatically fetch the schema (with types) for a source stream, and it is commonly used for CI/CD or automation purposes [[Airbyte Forum](https://discuss.airbyte.io/t/1952)] [[GitHub Issue 26399](https://github.com/airbytehq/airbyte/issues/26399)]. Example usage: - Call the
POST /v1/sources/discover_schema
endpoint with the appropriate source ID or configuration. - The response will include the schema for each stream, with field names and their corresponding types. Note: The
/v1/sources/discover_schema
endpoint is referenced in the Airbyte public API documentation and is the correct way to obtain column types. The
/v1/streams
endpoint does not provide this information as of now. If you need more details on how to use this endpoint, you can refer to the [Airbyte public API documentation](https://airbyte-public-api-docs.s3.us-east-2.amazonaws.com/rapidoc-api-docs.html#post-/v1/sources/discover_schema). Summary: Use
POST /v1/sources/discover_schema
to fetch stream schemas with column types. The
/v1/streams
and
/streamproperties
endpoints do not provide column type information.