Create Activity With Staged Changes
curl --request POST \
--url https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/activities \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "smart_import",
"description": "<string>",
"input_data": {},
"staged_changes": [
{
"after_data": {},
"catalog_item_id": "<string>",
"catalog_item_entity_type": "<string>",
"before_data": {},
"source_data": {},
"is_new_item": false,
"row_index": 123
}
],
"metadata": {},
"status": "<string>"
}
'import requests
url = "https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/activities"
payload = {
"type": "smart_import",
"description": "<string>",
"input_data": {},
"staged_changes": [
{
"after_data": {},
"catalog_item_id": "<string>",
"catalog_item_entity_type": "<string>",
"before_data": {},
"source_data": {},
"is_new_item": False,
"row_index": 123
}
],
"metadata": {},
"status": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'smart_import',
description: '<string>',
input_data: {},
staged_changes: [
{
after_data: {},
catalog_item_id: '<string>',
catalog_item_entity_type: '<string>',
before_data: {},
source_data: {},
is_new_item: false,
row_index: 123
}
],
metadata: {},
status: '<string>'
})
};
fetch('https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/activities', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/activities",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'smart_import',
'description' => '<string>',
'input_data' => [
],
'staged_changes' => [
[
'after_data' => [
],
'catalog_item_id' => '<string>',
'catalog_item_entity_type' => '<string>',
'before_data' => [
],
'source_data' => [
],
'is_new_item' => false,
'row_index' => 123
]
],
'metadata' => [
],
'status' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/activities"
payload := strings.NewReader("{\n \"type\": \"smart_import\",\n \"description\": \"<string>\",\n \"input_data\": {},\n \"staged_changes\": [\n {\n \"after_data\": {},\n \"catalog_item_id\": \"<string>\",\n \"catalog_item_entity_type\": \"<string>\",\n \"before_data\": {},\n \"source_data\": {},\n \"is_new_item\": false,\n \"row_index\": 123\n }\n ],\n \"metadata\": {},\n \"status\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/activities")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"smart_import\",\n \"description\": \"<string>\",\n \"input_data\": {},\n \"staged_changes\": [\n {\n \"after_data\": {},\n \"catalog_item_id\": \"<string>\",\n \"catalog_item_entity_type\": \"<string>\",\n \"before_data\": {},\n \"source_data\": {},\n \"is_new_item\": false,\n \"row_index\": 123\n }\n ],\n \"metadata\": {},\n \"status\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/activities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"smart_import\",\n \"description\": \"<string>\",\n \"input_data\": {},\n \"staged_changes\": [\n {\n \"after_data\": {},\n \"catalog_item_id\": \"<string>\",\n \"catalog_item_entity_type\": \"<string>\",\n \"before_data\": {},\n \"source_data\": {},\n \"is_new_item\": false,\n \"row_index\": 123\n }\n ],\n \"metadata\": {},\n \"status\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"activity_id": "<string>",
"status": "<string>",
"staged_changes_count": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Catalog Activities
Create Activity With Staged Changes
Create an activity with optional staged changes for a catalog.
This endpoint allows programmatic creation of review activities (e.g., from an MCP tool server). Staged changes represent proposed modifications to catalog items that can be reviewed and applied.
POST
/
public
/
catalogs
/
{catalog_id}
/
activities
Create Activity With Staged Changes
curl --request POST \
--url https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/activities \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "smart_import",
"description": "<string>",
"input_data": {},
"staged_changes": [
{
"after_data": {},
"catalog_item_id": "<string>",
"catalog_item_entity_type": "<string>",
"before_data": {},
"source_data": {},
"is_new_item": false,
"row_index": 123
}
],
"metadata": {},
"status": "<string>"
}
'import requests
url = "https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/activities"
payload = {
"type": "smart_import",
"description": "<string>",
"input_data": {},
"staged_changes": [
{
"after_data": {},
"catalog_item_id": "<string>",
"catalog_item_entity_type": "<string>",
"before_data": {},
"source_data": {},
"is_new_item": False,
"row_index": 123
}
],
"metadata": {},
"status": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'smart_import',
description: '<string>',
input_data: {},
staged_changes: [
{
after_data: {},
catalog_item_id: '<string>',
catalog_item_entity_type: '<string>',
before_data: {},
source_data: {},
is_new_item: false,
row_index: 123
}
],
metadata: {},
status: '<string>'
})
};
fetch('https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/activities', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/activities",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'smart_import',
'description' => '<string>',
'input_data' => [
],
'staged_changes' => [
[
'after_data' => [
],
'catalog_item_id' => '<string>',
'catalog_item_entity_type' => '<string>',
'before_data' => [
],
'source_data' => [
],
'is_new_item' => false,
'row_index' => 123
]
],
'metadata' => [
],
'status' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/activities"
payload := strings.NewReader("{\n \"type\": \"smart_import\",\n \"description\": \"<string>\",\n \"input_data\": {},\n \"staged_changes\": [\n {\n \"after_data\": {},\n \"catalog_item_id\": \"<string>\",\n \"catalog_item_entity_type\": \"<string>\",\n \"before_data\": {},\n \"source_data\": {},\n \"is_new_item\": false,\n \"row_index\": 123\n }\n ],\n \"metadata\": {},\n \"status\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/activities")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"smart_import\",\n \"description\": \"<string>\",\n \"input_data\": {},\n \"staged_changes\": [\n {\n \"after_data\": {},\n \"catalog_item_id\": \"<string>\",\n \"catalog_item_entity_type\": \"<string>\",\n \"before_data\": {},\n \"source_data\": {},\n \"is_new_item\": false,\n \"row_index\": 123\n }\n ],\n \"metadata\": {},\n \"status\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/activities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"smart_import\",\n \"description\": \"<string>\",\n \"input_data\": {},\n \"staged_changes\": [\n {\n \"after_data\": {},\n \"catalog_item_id\": \"<string>\",\n \"catalog_item_entity_type\": \"<string>\",\n \"before_data\": {},\n \"source_data\": {},\n \"is_new_item\": false,\n \"row_index\": 123\n }\n ],\n \"metadata\": {},\n \"status\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"activity_id": "<string>",
"status": "<string>",
"staged_changes_count": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Path Parameters
Body
application/json
Request to create an activity with staged changes
Activity type (e.g., smart_import, custom_transform)
Human-readable description of the activity
Optional full activity input data for audit context and apply-time hooks
Staged changes to attach to the activity
Show child attributes
Show child attributes
Initial activity status (defaults to 'pending_review' if staged_changes provided, else 'created')
⌘I