What an API Endpoint Actually Is
An API endpoint is a URL your application exposes that other systems can call to send or receive data. When Stripe sends your app a notification that a payment succeeded, it calls your webhook endpoint. When your frontend form submits, it calls your backend endpoint. When another app wants to access your data, it calls your API endpoint.
In an Express app, an endpoint is a route -- a specific URL that, when called with the right data, does something specific and returns a response.
The three things that define any endpoint: the method (GET for retrieving data, POST for sending data), the URL path (/api/subscribe, /api/webhook), and the logic (what the endpoint does when called). Describe all three to Claude and it writes the complete handler.
The Endpoint Description Format
"Create a [GET/POST] endpoint at [/path]. It receives [what data]. It should [what logic]. It returns [what response]."
Example: "Create a POST endpoint at /api/leads. It receives a JSON body with email (string) and source (string). It should save both fields plus the current timestamp to the leads table in SQLite. It returns JSON with success: true and the saved record's id."
Testing Your Endpoint
Ask Claude to show you how to test the endpoint using a tool like the browser's fetch API or tell you the curl command to run in the Replit terminal. This confirms the endpoint is working before you connect it to your frontend or external services.