Dr. Violet Howard explains how AI agents use APIs to talk to external services like Gmail and HubSpot. An API is a communication bridge: the agent reads documentation, sends an HTTP request to an endpoint, and gets back data. Without APIs, n8n agents stay trapped in n8n's native environment.
Chapters
If you're building AI agents, but you don't really understand what an API is or how to use them, don't worry. You're not alone. I was in that exact same spot not too long ago. So the purpose of this video is to understand how to set up your own requests so you can access any API, because that's where the power truly comes in. And APIs are so, so powerful because let's say we're building agents within N8N. Basically, we can only do things within N8N's environment unless we use an API to access some sort of server. So whether that's like a Gmail or a HubSpot or Airtable, whatever we want to access that's outside of N8N's own environment, we have to use an API call to do so. So API stands for Application Programming Interface, and at the highest level, in the most simple terms, it's just a way for two systems to talk to each other. So N8N and whatever other system we want to use in our automations. Okay, so I said we're going to make this as simple as possible, so let's do it. What we have here is just a scenario where we go to a restaurant. So this is us right here, and what we do is we sit down and we look at the menu and we look at what food that the restaurant has to offer. And then when we're ready to order, we don't talk directly to the kitchen or the chefs in the kitchen. We talk to the waiter. So we'd basically look at the menu, we'd understand what we want, then we would talk to the waiter and say, "Hey, I want the chicken parm." The waiter would then take our order and deliver it to the kitchen. And after the kitchen sees the request that we made and they understand, "Okay, this person wants chicken parm, I'm gonna grab the chicken parm, not the salmon," and then we're basically gonna feed this back down the line through the waiter all the way back to the person who ordered it in the first place. And so now a little bit more of a technical example of how this works in n8n. Okay, so here is our AI agent, and when it wants to interact with a service, it first has to look at that service's API documentation to see what is offered. Once we understand that, we'll read that and we'll be ready to make our request, and we will make that request using an HTTP request. From there, that HTTP request will take our information and send it to the API endpoint. The endpoint will look at what we ordered and it will say, okay, this person wants this data, so I'm going to go grab that. I'm going to send it back. Send it back to the HTTP request, and then the HTTP request is actually what delivers us back the data that we asked. And we know that it was available because we had to look at the API documentation first. So I hope that helps. I think that looking at it visually makes a lot more sense, especially when you hear, you know, HTTP API endpoint, all this kind of stuff. But really, it's just going to be this simple. If you want to watch the full breakdown, all you got to do is click right here, and I'll see you guys over there.