Public
Likenewsletter-signup
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Email signup endpoint with flexible metadata storage and admin management.
- Public signup endpoint -
POST /subscribe - Protected admin endpoints - List, update, and delete subscribers
- Flexible metadata -
detailsfield accepts any JSON - Developer notes - Internal annotations per subscriber
- Duplicate emails allowed - De-duplicate downstream as needed
- SQLite storage - Timestamps for created/updated
- CORS enabled
Set the ADMIN_API_KEY environment variable to protect admin endpoints.
| Method | Path | Auth | Description |
|---|---|---|---|
| POST | /subscribe | Public | Submit a signup |
| GET | /subscribers | API Key | List all subscribers |
| PUT | /subscribers/:id | API Key | Update details or notes |
| DELETE | /subscribers/:id | API Key | Remove a subscriber |
Subscribe (public):
curl -X POST https://YOUR_ENDPOINT/subscribe \ -H "Content-Type: application/json" \ -d '{"email": "user@example.com", "details": {"any": "json"}}'
Admin requests:
curl https://YOUR_ENDPOINT/subscribers \ -H "X-API-Key: your-admin-key"
| Column | Type | Description |
|---|---|---|
id | INTEGER | Auto-incrementing primary key |
email | TEXT | Subscriber email |
details | TEXT | JSON metadata (flexible) |
developer_notes | TEXT | Internal notes |
created_at | TEXT | Submission timestamp |
updated_at | TEXT | Last update timestamp |