Skip to main content
Glama
create-data-route-merge.ts1.15 kB
import { createAction, Property } from '@activepieces/pieces-framework'; import { HttpMethod } from '@activepieces/pieces-common'; import { documergeAuth } from '../common/auth'; import { DocuMergeClient } from '../common/client'; export const createDataRouteMerge = createAction({ auth: documergeAuth, name: 'create_data_route_merge', displayName: 'Create Data Route Merge', description: 'Send data to your Data Route URL', props: { routeKey: Property.ShortText({ displayName: 'Route Key', description: 'The key of the data route to merge', required: true, }), fields: Property.Object({ displayName: 'Fields', description: 'Field data to merge into the document', required: false, }), }, async run(context) { const { routeKey, fields } = context.propsValue; if (!routeKey) { throw new Error('Route key is required'); } const client = new DocuMergeClient(context.auth.secret_text); const response = await client.post<{ message: string }>( `/api/routes/merge/${encodeURIComponent(routeKey)}`, fields || {} ); return response; }, });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/activepieces/activepieces'

If you have feedback or need assistance with the MCP directory API, please join our Discord server