> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prequel.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Test stream transform

> Test transforming a predefined set of records for an import stream. Optionally accepts a partial 'stream' body to preview the transform output as if the stream were patched (without persisting the patch).



## OpenAPI

````yaml /generated/openapi-import-generated-2023-12-01.json post /import/streams/{id}/test-transform
openapi: 3.1.0
info:
  title: Prequel Data Import
  description: Data Import API spec
  version: '2023-12-01'
servers:
  - url: https://api.prequel.co
    description: Cloud-hosted server (US)
  - url: https://eu-api.prequel.co
    description: Cloud-hosted server (EU)
  - url: https://{custom_host}
    description: Self-hosted Prequel API host
security:
  - ApiKeyAuth: []
paths:
  /import/streams/{id}/test-transform:
    post:
      tags:
        - Import Streams
      summary: Test stream transform
      description: >-
        Test transforming a predefined set of records for an import stream.
        Optionally accepts a partial 'stream' body to preview the transform
        output as if the stream were patched (without persisting the patch).
      operationId: test-import-stream-transform
      parameters:
        - name: id
          in: path
          required: true
          description: Import Stream ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TestStreamTransformRequest'
              $schema: https://json-schema.org/draft/2020-12/schema
              $id: >-
                https://github.com/prequel-co/datafeed/internal/import/api/models/test-stream-transform-request
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    const: success
                  data:
                    $ref: '#/components/schemas/TestStreamTransformResponse'
                    $schema: https://json-schema.org/draft/2020-12/schema
                    $id: >-
                      https://github.com/prequel-co/datafeed/internal/import/api/models/test-stream-transform-response
                  message:
                    type: string
                type: object
                required:
                  - status
                  - data
                  - message
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    TestStreamTransformRequest:
      properties:
        record_ids:
          items:
            type: string
          type: array
          maxItems: 100
          minItems: 1
          title: Record IDs
          description: List of specific record IDs to test the transformation against.
        stream:
          $ref: '#/components/schemas/UpdateStreamOptions'
          title: Stream
          description: >-
            Optional partial stream patch merged onto the saved stream to
            preview transform output without persisting.
      additionalProperties: false
      type: object
      required:
        - record_ids
    TestStreamTransformResponse:
      properties:
        schema:
          items:
            $ref: '#/components/schemas/QueryResultSchemaField'
          type: array
        records:
          items: true
          type: array
      additionalProperties: false
      type: object
      required:
        - schema
        - records
    UpdateStreamOptions:
      properties:
        name:
          type: string
          description: Name for this stream.
        is_enabled:
          type: boolean
          description: Whether this stream is enabled.
        mappings:
          items:
            $ref: '#/components/schemas/MappingOptions'
          type: array
          description: Field mappings for this stream.
      additionalProperties: false
      type: object
    QueryResultSchemaField:
      properties:
        name:
          type: string
        database_type_name:
          type: string
        length:
          type: integer
        precision:
          type: integer
        scale:
          type: integer
        nullable:
          type: boolean
      additionalProperties: false
      type: object
      required:
        - name
    ErrorResponse:
      properties:
        status:
          type: string
          const: error
        message:
          type: string
        data:
          type: 'null'
      type: object
      required:
        - status
        - message
    MappingOptions:
      properties:
        field_type:
          type: string
          title: Field Type
          description: Type of field mapping (field or expression).
        column:
          additionalProperties:
            type: string
          type: object
          title: Column
          description: Column reference for field type mappings.
        expression:
          additionalProperties:
            type: string
          type: object
          title: Expression
          description: Configuration for expression field mappings.
        target_field:
          type: string
          title: Target Field
          description: The target field name in the destination.
      additionalProperties: false
      type: object
      required:
        - field_type
        - target_field
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````