improved

API Step V2

We're introducing a new API step with a cleaner, more intuitive interface for configuring your API requests. While the existing API step remains fully functional, we recommend trying out the new version at your earliest convenience.

Project Data Changes

For users working with our API programmatically, we've included the new step type definition below:

type CodeText = (
  | string
  | {
      variableID: string;
    }
  | {
      entityID: string;
    }
)[];

interface MarkupSpan {
  text: Markup;
  attributes?: Record<string, unknown> | undefined;
}

type Markup = (
  | string
  | {
      variableID: string;
    }
  | {
      entityID: string;
    }
  | MarkupSpan
)[];

type ApiV2Node = {
  type: "api-v2";
  data: {
    name: string;
    url?: Markup | null | undefined;
    headers?: Array<{ id: string; key: string; value: Markup }> | undefined;
    httpMethod: "get" | "post" | "put" | "patch" | "delete";
    queryParameters?: Array<{ id: string; key: string; value: Markup }> | undefined;
    responseMappings?: Array<{ id: string; path: string; variableID: string }> | undefined;
    body?:
      | {
          type: "form-data";
          formData: Array<{ id: string; key: string; value: Markup }>;
        }
      | {
          type: "params";
          params: Array<{ id: string; key: string; value: Markup }>;
        }
      | {
          type: "raw-input";
          content: CodeText;
        }
      | null
      | undefined;
    fallback?:
      | {
          path: boolean;
          pathLabel: string;
        }
      | null
      | undefined;
    portsV2: {
      byKey: Record
        string,
        {
          type: string;
          id: string;
          target: string | null;
        }
      >;
    };
  };
  nodeID: string;
  coords?: [number, number] | undefined;
};