---
title: "Create Custom Transform Activity"
method: POST
path: "/public/catalogs/{catalog_id}/activities/custom-transform"
tags: ["Catalog Activities"]
---

# Create Custom Transform Activity

`POST /public/catalogs/{catalog_id}/activities/custom-transform`

## Request

- Base URL: `https://catalogapi.rastro.ai/api`
- URL: `https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/activities/custom-transform`
- Auth: HTTP bearer

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.

## Path parameters

- `catalog_id` string, required

## Headers

- `X-Organization-Id` string, nullable

## Request body

- CreateTransformActivityRequest: Request to create a custom transform activity with full audit metadata
  - `activity_message` string, required: Human-readable description (e.g., 'Q2 price update')
  - `script` object, nullable: Transform script metadata: {filename, content, sha256}
  - `diff_summary` object, nullable: Diff summary: {rows_before, rows_after, rows_added, rows_removed, rows_modified, ...}
  - `validation_report` object, nullable: Bundle validation report
  - `staged_changes` PublicStagedChangeInput[]: Staged changes
    - `catalog_item_id` string, nullable
    - `catalog_item_entity_type` string, nullable
    - `before_data` object, nullable
    - `after_data` object, required
    - `source_data` object, nullable
    - `is_new_item` boolean
    - `row_index` integer, nullable
    - `status` 'draft' | 'pending' | 'approved' | 'rejected' | 'partially_accepted' | 'error': Status for individual staged changes
  - `schema_changes` object, nullable: Schema changes to apply alongside row changes
  - `taxonomy_changes` object, nullable: Taxonomy changes to apply alongside row changes
  - `attachments` object[], nullable: Optional attachment metadata used in this session (files, urls, sheet names)
  - `activity_context` object, nullable: Optional activity context for auditability (tool params, notes, attachment refs, etc.)
  - `session_context` object, nullable: Deprecated alias for activity_context.session_context
  - `base_snapshot_id` string, nullable: Optional snapshot ID for audit trail

## Response `200`

Successful Response

- CreateTransformActivityResponse: Response after creating a custom transform activity
  - `activity_id` string, required
  - `status` string, required
  - `staged_count` integer, required
  - `review_url` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/rastro-ai/apis/rastro-public-api.md) - [All operations](https://skmtc.dev/rastro-ai/apis/rastro-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/rastro-ai/apis/rastro-public-api/revisions/57c8ed4854bb?raw)
