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

# Create Custom Transform Activity

> Create a custom transform activity with full audit metadata.

This is the primary endpoint for MCP tool servers to create reviewable activities
with script provenance, diff summaries, and validation reports.



## OpenAPI

````yaml /api-reference/openapi.json post /public/catalogs/{catalog_id}/activities/custom-transform
openapi: 3.1.0
info:
  title: Rastro Public API
  description: >-
    Public API for enrichment, catalog management, workflows, activities,
    snapshots, taxonomy, and MCP integrations.
  version: 0.1.0
servers:
  - url: https://catalogapi.rastro.ai/api
security:
  - bearerAuth: []
paths:
  /public/catalogs/{catalog_id}/activities/custom-transform:
    post:
      tags:
        - Catalog Activities
      summary: Create Custom Transform Activity
      description: >-
        Create a custom transform activity with full audit metadata.


        This is the primary endpoint for MCP tool servers to create reviewable
        activities

        with script provenance, diff summaries, and validation reports.
      operationId: >-
        create_custom_transform_activity_api_public_catalogs__catalog_id__activities_custom_transform_post
      parameters:
        - name: catalog_id
          in: path
          required: true
          schema:
            type: string
            title: Catalog Id
        - name: X-Organization-Id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Organization-Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTransformActivityRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateTransformActivityResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - bearerAuth: []
components:
  schemas:
    CreateTransformActivityRequest:
      properties:
        activity_message:
          type: string
          title: Activity Message
          description: Human-readable description (e.g., 'Q2 price update')
        script:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Script
          description: 'Transform script metadata: {filename, content, sha256}'
        diff_summary:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Diff Summary
          description: >-
            Diff summary: {rows_before, rows_after, rows_added, rows_removed,
            rows_modified, ...}
        validation_report:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Validation Report
          description: Bundle validation report
        staged_changes:
          items:
            $ref: '#/components/schemas/PublicStagedChangeInput'
          type: array
          title: Staged Changes
          description: Staged changes
        schema_changes:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Schema Changes
          description: Schema changes to apply alongside row changes
        taxonomy_changes:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Taxonomy Changes
          description: Taxonomy changes to apply alongside row changes
        attachments:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Attachments
          description: >-
            Optional attachment metadata used in this session (files, urls,
            sheet names)
        activity_context:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Activity Context
          description: >-
            Optional activity context for auditability (tool params, notes,
            attachment refs, etc.)
        session_context:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Session Context
          description: Deprecated alias for activity_context.session_context
        base_snapshot_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Base Snapshot Id
          description: Optional snapshot ID for audit trail
      type: object
      required:
        - activity_message
      title: CreateTransformActivityRequest
      description: Request to create a custom transform activity with full audit metadata
    CreateTransformActivityResponse:
      properties:
        activity_id:
          type: string
          title: Activity Id
        status:
          type: string
          title: Status
        staged_count:
          type: integer
          title: Staged Count
        review_url:
          type: string
          title: Review Url
      type: object
      required:
        - activity_id
        - status
        - staged_count
        - review_url
      title: CreateTransformActivityResponse
      description: Response after creating a custom transform activity
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PublicStagedChangeInput:
      properties:
        catalog_item_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Catalog Item Id
        catalog_item_entity_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Catalog Item Entity Type
        before_data:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Before Data
        after_data:
          additionalProperties: true
          type: object
          title: After Data
        source_data:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Source Data
        is_new_item:
          type: boolean
          title: Is New Item
          default: false
        row_index:
          anyOf:
            - type: integer
            - type: 'null'
          title: Row Index
        status:
          anyOf:
            - $ref: >-
                #/components/schemas/app__models__staged_changes__StagedChangeStatus
            - type: 'null'
      type: object
      required:
        - after_data
      title: PublicStagedChangeInput
      description: Input for a single staged change in the public API
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    app__models__staged_changes__StagedChangeStatus:
      type: string
      enum:
        - draft
        - pending
        - approved
        - rejected
        - partially_accepted
        - error
      title: StagedChangeStatus
      description: Status for individual staged changes
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Rastro API key or user token

````