How it works
A REST API (Representational State Transfer) uses HTTP verbs (GET, POST, PUT, PATCH, DELETE) to operate on resources identified by URLs. Each request is independent: the server does not keep the conversation state between calls, and all necessary information goes in the request itself, in the headers or in the body. Responses usually come in JSON, with HTTP status codes indicating success (2xx) or error (4xx, 5xx). The REST style also values caching, a uniform interface and separation between client and server.
Practical example
Imagine a task app. To list tasks, the client makes GET /tarefas. To create one, it makes POST /tarefas with JSON in the body. To delete, it makes DELETE /tarefas/42. The same pattern applies to AI APIs: you send a POST with the prompt and receive the generated text in JSON. Webhooks complement this flow by sending events back to your system.
What it's for
REST is the most common standard for integrating systems, because it uses the existing web infrastructure, is easy to test in a browser or curl and works with any language. For those building AI agents, REST APIs are the bridge between the model and external tools, such as databases, file systems and third party services. GraphQL offers an alternative when the client needs specific fields.
Best practices
Use plural resource names, version the API, return appropriate status codes and document the endpoints. This makes maintenance and integration easier for other developers and agents.