Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

716 B
Raw Blame
import { PieceAuth } from '@activepieces/pieces-framework';
import { HttpMethod } from '@activepieces/pieces-common';
import { makeRequest } from './common';

export const filloutFormsAuth = PieceAuth.SecretText({
	displayName: 'API Key',
	required: true,
	description: `To get your API key:
1. Go to your Fillout account settings.
2. Click on "Developer settings".
3. Generate and copy your API key.
4. Paste it here.`,
	validate: async ({ auth }) => {
		try {
			await makeRequest(auth, HttpMethod.GET, '/forms', undefined);
			return { valid: true };
		} catch (error: any) {
			return {
				valid: false,
				error: error.message || 'Invalid API Key. Please check your API key and try again.',
			};
		}
	},
});