API Reference Overview¶
Amebo provides a comprehensive RESTful HTTP API for managing applications, events, actions, and subscriptions. All endpoints return JSON responses and support standard HTTP methods.
Base URL¶
Authentication¶
Amebo uses JWT-based authentication for API access:
API Endpoints¶
Core Resources¶
Resource | Endpoint | Description |
---|---|---|
Applications | /v1/applications | Manage microservices and modules |
Actions | /v1/actions | Define event types with schemas |
Events | /v1/events | Publish and query events |
Subscriptions | /v1/subscriptions | Manage event subscriptions |
Gists | /v1/gists | View event delivery status |
Authentication¶
Endpoint | Method | Description |
---|---|---|
/v1/tokens | POST | Authenticate and get JWT token |
/v8/tokens | POST | Alternative authentication endpoint |
Web Interface¶
Endpoint | Description |
---|---|
/ | Login page |
/p/:page | Web interface pages |
HTTP Methods¶
Amebo follows RESTful conventions:
- GET - Retrieve resources
- POST - Create new resources
- PUT - Update existing resources
- DELETE - Remove resources (limited endpoints)
Response Format¶
All API responses follow a consistent format:
Status Codes¶
Code | Meaning | Description |
---|---|---|
200 | OK | Request successful |
201 | Created | Resource created successfully |
400 | Bad Request | Invalid request data |
401 | Unauthorized | Authentication required |
403 | Forbidden | Insufficient permissions |
404 | Not Found | Resource not found |
409 | Conflict | Resource already exists |
422 | Unprocessable Entity | Validation failed |
500 | Internal Server Error | Server error |
Rate Limiting¶
Amebo implements rate limiting to prevent abuse:
- Default: 1000 requests per minute per IP
- Authenticated: 5000 requests per minute per token
- Headers: Rate limit info in response headers
Pagination¶
List endpoints support pagination:
Filtering & Sorting¶
Most list endpoints support filtering and sorting:
Content Types¶
Amebo supports multiple content types:
- JSON (default):
application/json
- Form Data:
application/x-www-form-urlencoded
- Multipart:
multipart/form-data
CORS Support¶
Cross-Origin Resource Sharing (CORS) is enabled by default:
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization
Webhooks¶
Amebo delivers events via webhooks with the following features:
- Attempts: Up to 5 retries
- Backoff: Exponential (1s, 2s, 4s, 8s, 16s)
- Timeout: 30 seconds per attempt
- Success: HTTP 200-299 response
Schema Validation¶
All event payloads are validated against JSON Schema:
SDK & Libraries¶
Official SDKs and community libraries:
# Set base URL and token
export AMEBO_URL="http://localhost:3310"
export AMEBO_TOKEN="your-jwt-token"
# Publish event
curl -X POST "$AMEBO_URL/v1/events" \
-H "Authorization: Bearer $AMEBO_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"action": "user.created",
"payload": {"id": "123", "email": "john@example.com"}
}'
OpenAPI Specification¶
Amebo provides an OpenAPI 3.0 specification:
- Specification:
/openapi.json
- Swagger UI:
/docs
- ReDoc:
/redoc
Testing¶
Use the built-in test endpoints for development:
# Health check
curl http://localhost/health
# API status
curl http://localhost/v1/status
# Database connectivity
curl http://localhost/v1/health/database
Next Steps¶
Explore the detailed API documentation:
- Authentication - JWT tokens and security
- Applications API - Manage applications
- Events API - Publish and query events
- Actions API - Define event schemas
- Subscriptions API - Manage subscriptions