API Reference
API Reference
Section titled “API Reference”Stowaway provides a REST API for programmatic access to your inventory data.
Base URL
Section titled “Base URL”All API endpoints are relative to your Stowaway installation:
https://your-stowaway-instance.com/apiAuthentication
Section titled “Authentication”All API requests require authentication via session cookies.
Note: Session-Based Auth The API uses the same session authentication as the web interface. You must be logged in to make API requests.
For programmatic access, you can authenticate by:
- Logging in via the web interface
- Using the session cookie in subsequent API requests
Response Format
Section titled “Response Format”All responses are JSON formatted.
Success Response
Section titled “Success Response”{ "items": [...], "pagination": { "page": 1, "limit": 20, "total": 100, "totalPages": 5 }}Error Response
Section titled “Error Response”{ "error": "Error message here"}HTTP Status Codes
Section titled “HTTP Status Codes”| Code | Meaning |
|---|---|
200 |
Success |
201 |
Created |
400 |
Bad Request - Invalid input |
401 |
Unauthorized - Not logged in |
403 |
Forbidden - Insufficient permissions |
404 |
Not Found |
500 |
Internal Server Error |
Endpoints Overview
Section titled “Endpoints Overview”| Method | Endpoint | Description |
|---|---|---|
GET |
/api/items |
List items |
POST |
/api/items |
Create item |
GET |
/api/items/[id] |
Get item |
PUT |
/api/items/[id] |
Update item |
DELETE |
/api/items/[id] |
Delete item |
Categories
Section titled “Categories”| Method | Endpoint | Description |
|---|---|---|
GET |
/api/categories |
List categories |
POST |
/api/categories |
Create category |
PUT |
/api/categories/[id] |
Update category |
DELETE |
/api/categories/[id] |
Delete category |
Locations
Section titled “Locations”| Method | Endpoint | Description |
|---|---|---|
GET |
/api/locations |
List locations |
POST |
/api/locations |
Create location |
PUT |
/api/locations/[id] |
Update location |
DELETE |
/api/locations/[id] |
Delete location |
Data Management
Section titled “Data Management”| Method | Endpoint | Description |
|---|---|---|
GET |
/api/export?format=json |
Export data as JSON |
GET |
/api/export?format=csv |
Export data as CSV |
POST |
/api/import |
Import data |
Rate Limiting
Section titled “Rate Limiting”Currently, there are no rate limits on the API. However, please be considerate and avoid excessive requests.
Next Steps
Section titled “Next Steps”- Authentication - Detailed auth documentation
- Items API - Item endpoints
- Categories API - Category endpoints
- Locations API - Location endpoints