---
title: "Discover the schema catalog of the source"
method: POST
path: "/v1/sources/discover_schema"
tags: ["source"]
---

# Discover the schema catalog of the source

`POST /v1/sources/discover_schema`

## Request body

- SourceDiscoverSchemaRequestBody
  - `connectionId` string, uuid
  - `disable_cache` boolean
  - `notifySchemaChange` boolean
  - `sourceId` string, uuid, required

## Response `200`

Successful operation

- SourceDiscoverSchemaRead — Returns the results of a discover catalog job. If the job was not successful, the catalog field will not be present. jobInfo will aways be present and its status be used to determine if the job was successful or not.
  - `breakingChange` boolean
  - `catalog` AirbyteCatalog — describes the available schema (catalog).
    - `streams` AirbyteStreamAndConfiguration[], required
      - `config` AirbyteStreamConfiguration — the mutable part of the stream to configure the destination
        - `aliasName` string — Alias name to the stream to be used in the destination
        - `cursorField` string[] — Path to the field that will be used to determine if a record is new or modified since the last sync. This field is REQUIRED if `sync_mode` is `incremental`. Otherwise it is ignored.
        - `destinationSyncMode` 'append' | 'overwrite' | 'append_dedup', required
        - `fieldSelectionEnabled` boolean — Whether field selection should be enabled. If this is true, only the properties in `selectedFields` will be included.
        - `primaryKey` array[] — Paths to the fields that will be used as primary key. This field is REQUIRED if `destination_sync_mode` is `*_dedup`. Otherwise it is ignored.
          - string[]
        - `selected` boolean — If this is true, the stream is selected with all of its properties. For new connections, this considers if the stream is suggested or not
        - `selectedFields` SelectedFieldInfo[] — Paths to the fields that will be included in the configured catalog. This must be set if `fieldSelectedEnabled` is set. An empty list indicates that no properties will be included.
          - `fieldPath` string[]
        - `suggested` boolean — Does the connector suggest that this stream be enabled by default?
        - `syncMode` 'full_refresh' | 'incremental', required
      - `stream` AirbyteStream — the immutable schema defined by the source
        - `defaultCursorField` string[] — Path to the field that will be used to determine if a record is new or modified since the last sync. If not provided by the source, the end user will have to specify the comparable themselves.
        - `jsonSchema` StreamJsonSchema — Stream schema using Json Schema specs.
        - `name` string, required — Stream's name.
        - `namespace` string — Optional Source-defined namespace. Airbyte streams from the same sources should have the same namespace. Currently only used by JDBC destinations to determine what schema to write to.
        - `sourceDefinedCursor` boolean — If the source defines the cursor field, then any other cursor field inputs will be ignored. If it does not, either the user_provided one is used, or the default one is used as a backup.
        - `sourceDefinedPrimaryKey` array[] — If the source defines the primary key, paths to the fields that will be used as a primary key. If not provided by the source, the end user will have to specify the primary key themselves.
          - string[]
        - `supportedSyncModes` SyncMode[]
  - `catalogDiff` CatalogDiff — Describes the difference between two Airbyte catalogs.
    - `transforms` StreamTransform[], required — list of stream transformations. order does not matter.
      - `streamDescriptor` StreamDescriptor, required
        - `name` string, required
        - `namespace` string
      - `transformType` 'add_stream' | 'remove_stream' | 'update_stream', required
      - `updateStream` FieldTransform[] — list of field transformations. order does not matter.
        - `addField` FieldAdd
          - `schema` FieldSchema — JSONSchema representation of the field
        - `breaking` boolean, required
        - `fieldName` string[], required — A field name is a list of strings that form the path to the field.
        - `removeField` FieldRemove
          - `schema` FieldSchema — JSONSchema representation of the field
        - `transformType` 'add_field' | 'remove_field' | 'update_field_schema', required
        - `updateFieldSchema` FieldSchemaUpdate
          - `newSchema` FieldSchema, required — JSONSchema representation of the field
          - `oldSchema` FieldSchema, required — JSONSchema representation of the field
  - `catalogId` string, uuid
  - `connectionStatus` 'active' | 'inactive' | 'deprecated' — Active means that data is flowing through the connection. Inactive means it is not. Deprecated means the connection is off and cannot be re-activated. the schema field describes the elements of the schema that will be synced.
  - `jobInfo` SynchronousJobRead, required
    - `configId` string — only present if a config id was provided.
    - `configType` 'check_connection_source' | 'check_connection_destination' | 'discover_schema' | 'get_spec' | 'sync' | 'reset_connection', required
    - `connectorConfigurationUpdated` boolean
    - `createdAt` integer, required
    - `endedAt` integer, required
    - `id` string, uuid, required
    - `logs` LogRead
      - `logLines` string[], required
    - `succeeded` boolean, required

## Other responses

- `404` — Object with given id was not found.
- `422` — Input failed validation

---

[API](https://skmtc.net/airbyte/apis/config.md) · [All operations](https://skmtc.net/airbyte/apis/config/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/airbyte/config/versions/ce48e08e02ec/schema)
