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

930 B
Raw Blame
import { createAction } from '@activepieces/pieces-framework';
import { promptmateAuth } from '../..';
import { httpClient, HttpMethod } from '@activepieces/pieces-common';

export const getUserInfo = createAction({
  auth: promptmateAuth,
  name: 'get_user_info',
  displayName: 'Get User Information',
  description: 'Retrieve user information associated with the API key',
  audience: 'both',
  aiMetadata: { description: 'Returns the account/user profile tied to the authenticated PromptMate API key. Use it to identify the current account or verify that credentials are valid. Takes no input; read-only and safe to repeat.', idempotent: true },
  props: {},
  async run({ auth }) {
    const response = await httpClient.sendRequest({
      method: HttpMethod.GET,
      url: 'https://api.promptmate.io/v1/userInfo',
      headers: {
        'x-api-key': auth.secret_text,
      },
    });

    return response.body;
  },
});