Proxy endpoints
All routes are relative to basePath (default /api/contentstack). GET only.
| Route | Description |
|---|---|
GET /search | Multi-type entry search |
GET /entries/by-url?url=/path | URL field lookup |
GET /entries/:contentType/:uid | Single entry fetch |
GET /content-types | List configured types |
GET /your-custom-path | Via customRoutes |
Search query parameters
| Param | Alias | Description |
|---|---|---|
query | q | Free-text search |
content_types | — | Comma-separated UIDs |
limit | — | Max results (capped by maxLimit) |
offset | — | Pagination offset |
locale | — | Locale code |
Example:
GET /api/contentstack/search?query=headless&content_types=blogpost&limit=10Get by URL
GET /api/contentstack/entries/by-url?url=/blog/my-post&locale=en-usGet by UID
GET /api/contentstack/entries/blogpost/blt1234567890abcdefContent types
GET /api/contentstack/content-typesCustom routes
Defined in server config:
typescript
customRoutes: {
"/products/by-sku": async (request, context) => { /* ... */ },
}Called at:
GET /api/contentstack/products/by-sku?sku=ABC-123Custom routes are matched before built-in routes.
Error responses
json
{
"error": {
"code": "not_found",
"message": "No entry found for URL: /missing"
}
}| Status | Code | When |
|---|---|---|
| 400 | bad_request | Invalid input |
| 404 | not_found | Entry or route not found |
| 405 | method_not_allowed | Non-GET request |
| 500 | internal_error | Unhandled server error |