• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
colel

colel

newsletter-signup

Email signup API with flexible metadata and admin endpoints
Public
Like
newsletter-signup
Home
Code
2
README.md
H
main.ts
Environment variables
Branches
1
Pull requests
Remixes
History
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.
Sign up now
Code
/
Code
/
Search
README.md

Newsletter Signup API

Email signup endpoint with flexible metadata storage and admin management.

Features

  • Public signup endpoint - POST /subscribe
  • Protected admin endpoints - List, update, and delete subscribers
  • Flexible metadata - details field 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

Setup

Set the ADMIN_API_KEY environment variable to protect admin endpoints.

Endpoints

MethodPathAuthDescription
POST/subscribePublicSubmit a signup
GET/subscribersAPI KeyList all subscribers
PUT/subscribers/:idAPI KeyUpdate details or notes
DELETE/subscribers/:idAPI KeyRemove a subscriber

Usage

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"

Schema

ColumnTypeDescription
idINTEGERAuto-incrementing primary key
emailTEXTSubscriber email
detailsTEXTJSON metadata (flexible)
developer_notesTEXTInternal notes
created_atTEXTSubmission timestamp
updated_atTEXTLast update timestamp
Code
README.md
H
main.ts
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2026 Val Town, Inc.