---
title: "Retrieve schema from the data source"
method: POST
path: "/_api/connectors/{connector-name}/schema"
tags: ["Connections"]
---

# Retrieve schema from the data source

`POST /_api/connectors/{connector-name}/schema`

## Request

- The document declares no server URL.
- Auth: one of:
  - API key in header `Authorization`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/macrometa/apis/macrometa-api-reference/docs/_api/connectors/:connector-name/schema/post.ts> (a function with typed inputs; its response is checked against the schema)

Retrieve schema for the connector by supplying the connector configurations.

## Path parameters

- `connector-name` string, required

## Request body

- ConnectorSampleRequest
  - `type` string: Connector type. source or target.
  - `config` object: Contains the connector configurations. Key-value pairs should be provided to configure the connection to the respective data source or target.

## Response `200`

Successfully retrieved connector schema.

- object
  - `error` boolean, required
  - `code` integer
  - `result` ConnectorSchema[]
    - `name` string: Name of the schema.
    - `attributes` SchemaAttribute[]: Attributes of the schema.
      - `name` string: Name of the attribute.
      - `type` string: Type of the attribute.

## Other responses

- `400`: Failed due to missing or malformed data. Verify that all parameters are complete.
- `401`: Failed to authenticate the request.
- `404`: Failed to find the connector.

---

[API](https://skmtc.dev/macrometa/apis/macrometa-api-reference.md) - [All operations](https://skmtc.dev/macrometa/apis/macrometa-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/macrometa/apis/macrometa-api-reference/revisions/2006b6d7f31d?raw)
