An API endpoint is a specific URL where a program can request data or perform an action. The endpoint identifies the resource; the HTTP method tells the API what you want to do with it.
For example, a weather application might read temperature records from /v1/alex/weather-station/readings/. That path is an endpoint. It is one part of the larger API that defines the available URLs, methods, credentials, data shapes and responses.
Endpoint, API, app and database
These terms describe different layers of the same system:
| Term | Meaning |
|---|---|
| API | The complete contract for communicating with a service. |
| Endpoint | One address that accepts a defined kind of request. |
| App | A project that groups related endpoints and credentials. |
| Database | Where the service stores data internally. A client should not need direct access to it. |
An endpoint is therefore not the whole API and not the database. It is the controlled doorway between a client and one operation provided by the service.
Anatomy of a real request
GET https://meowmeowscratch.com/api/v1/YOUR_USERNAME/weather-station/readings/
Authorization: Bearer YOUR_APP_API_KEYCode language: JavaScript (javascript)
- Scheme and host:
https://meowmeowscratch.comidentifies the service. - API version:
/api/v1/selects the consumer API route. - Username: identifies the owner of the app.
- App and endpoint slugs:
weather-station/readingsidentify the resource. - Method:
GETasks to read it. - Header: the Bearer credential proves access to a private endpoint.
The method changes the operation
The same resource path can support several operations. The method is part of the request contract, so changing it can change a harmless read into a write or delete.
| Method | Typical meaning | Example |
|---|---|---|
GET | Read a collection or record. | List temperature readings. |
POST | Create a new record or resource. | Add a temperature reading. |
PATCH | Change part of an existing resource. | Correct one reading. |
DELETE | Remove a resource. | Delete one record by UUID. |
Collections, records and static payloads
A collection endpoint represents many typed records, such as sensor readings or form submissions. A collection response normally includes metadata and a list of records. Each record has its own UUID and timestamps.
{
"count": 1,
"records": [
{
"uuid": "…",
"data": { "temperature": 22.5 },
"created_at": "…"
}
]
}Code language: JSON / JSON with Comments (json)
A static endpoint represents one JSON document instead of a list of records. It is useful for device settings, feature flags or a current status document. Choose the endpoint type that matches the data: collections for history, static payloads for current state.
Trailing slashes are part of the route
Meow Meow Scratch REST management routes are slash-terminated. Use /api/apps/, not /api/apps. A missing slash can produce a redirect. Redirects are easy to overlook for GET requests but can cause problems for authenticated POST, PATCH or DELETE requests.
Read the response, not just the URL
A request is not successful merely because it reached the right-looking address. Inspect the HTTP status and JSON response. A 200 OK normally means a read succeeded; 201 Created means a POST created a resource; 400 indicates invalid input; 401 means credentials are missing or invalid; and 404 usually means the route or resource is wrong.
curl -i "https://meowmeowscratch.com/api/v1/YOUR_USERNAME/weather-station/readings/" \
-H "Authorization: Bearer $MEOW_APP_API_KEY"Code language: JavaScript (javascript)
The -i option shows response headers and the status line before the JSON body. That makes it easier to distinguish authentication, permission, validation and routing errors.
Common endpoint mistakes
- Using the management route when you need the stable consumer URL.
- Leaving out the username, app slug or endpoint slug.
- Changing a slug in the URL instead of copying the exact configured slug.
- Omitting the trailing slash on a write route.
- Sending a collection record without the required JSON field.
- Putting an API key directly in source code or a public repository.
Next step
Now that you can identify an endpoint, learn how the JSON inside its request and response is structured in What Is JSON? A Beginner’s Guide with Real API Examples. Then use the HTTP methods guide to choose the operation safely.