Skip to main content

Lyzr Tools & Credentials — UI Configuration Cookbook

Goal: Help you build a complete UI for configuring tools in Lyzr Agent Studio. This cookbook walks through every API call you need, common UI patterns, and ready-to-use code snippets.

Prerequisites

Before you start, every request to the Lyzr API requires these headers:
Create a shared apiFetch helper so you never forget them:

Auth Type Reference

Understanding auth_type is the key to rendering the right UI and calling the right endpoint.

Recipe 1 — List All Available Tools

Use this to populate a tool browser / marketplace UI where users can discover and select tools.

API Call

Response Shape

UI Pattern — Tool Card Grid


Recipe 2 — List Connected Accounts

Show users which tools they’ve already configured. Drive a “My Connections” panel.

API Call

Response Shape

UI Pattern — Connected Accounts List


Recipe 3 — Enable an ACI App (Create Configuration)

Before a user can connect an ACI-sourced tool (e.g. Google Sheets, Google Maps), the app must be enabled in the system. Call this once per app.

API Call

When to Call It

Check existing ACI configurations first (GET /tools/aci/configurations). Only call enableAciApp if the app isn’t already present and enabled.

Recipe 4 — Connect a Tool (Dynamic Form by auth_type)

This is the core UX flow. When a user clicks “Connect” on a tool, render the right form based on auth_type.

Master Connect Flow


Recipe 5 — Static Credential (API Key or No Auth)

API Call

UI Pattern — API Key Form


Recipe 6 — OAuth2 Connection

API Call

UI Pattern — OAuth Connect Button

Handling the OAuth Redirect Callback

After the user authorizes, they land back on your redirect_url. Check sessionStorage and verify the connection:

Recipe 7 — Delete a Credential

API Call

UI Pattern — Delete Button with Confirmation


Recipe 8 — Full Connect Modal (Putting It All Together)

A single ConnectToolModal component that handles all three auth types:

Recipe 9 — Complete Page Example

Wire everything together in a single Tools Settings page:

Error Handling Reference


Quick Reference — All Endpoints