---
title: "Generate a transformation query sample"
method: POST
path: "/_api/transformations/sample"
tags: ["Connections"]
---

# Generate a transformation query sample

`POST /_api/transformations/sample`

## 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/transformations/sample/post.ts> (a function with typed inputs; its response is checked against the schema)

Generate a sample transformation query based on the schema of the specific data source.
This API serves as the initial step in creating a data transformation process.
Use this API's generated sample transformation query to construct your transformation logic.

## Request body

- ConnectorSchema: Model to encapsulate properties of a schema from a connector.
  - `name` string: Name of the schema.
  - `attributes` SchemaAttribute[]: Attributes of the schema.
    - `name` string: Name of the attribute.
    - `type` string: Type of the attribute.

## Response `200`

Successfully fetched the sample transformation query.

- object
  - `error` boolean, required
  - `code` integer
  - `query` string: Transformation query.
  - `inputSchema` ConnectorSchema: Model to encapsulate properties of a schema from a connector.
    - `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.

---

[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)
