SaifAPI
SaifAPI is a modular RESTful API providing authentication, posts,
short URL, and subscription management services.
Built with Node.js, Express, MongoDB, and modern security best
practices.
Features
🔐 Authentication : Secure signup, signin, JWT, email
verification, password reset, and user management.
📝 Posts : CRUD operations for user posts, with user-based
access control.
🔗 Short URLs : Create, manage, and track short URLs with
click analytics.
💳 Subscriptions : Manage recurring subscriptions, renewal
dates, and reminders.
Base URL
https://api.saifabdelrazek.com/v1/
Authentication Endpoints /auth
Method
Endpoint
Description
GET
/auth
Render authentication view
POST
/auth/signup
Register a new user
POST
/auth/signin
User login
POST
/auth/signout
User logout (requires authentication)
PATCH
/auth/verification/send
Send email verification code (requires authentication)
PATCH
/auth/verification/verify
Verify email with code (requires authentication)
PATCH
/auth/password/forget
Send forgot password code
PATCH
/auth/password
Change password (requires authentication)
PATCH
/auth/password/reset
Reset forgotten password
DELETE
/auth/users/one
Delete current user (requires authentication)
PATCH
/auth/users/one
Update current user info (requires authentication)
GET
/auth/users/one
Get current user info (requires authentication)
GET
/auth/users/all
Get all users (admin only, requires authentication)
Posts Endpoints /posts
Method
Endpoint
Description
GET
/posts
Get paginated posts
GET
/posts/:postId
Get a single post by ID
POST
/posts
Create a new post (requires authentication)
PUT
/posts/:postId
Update a post (requires authentication, owner only)
DELETE
/posts/:postId
Delete a post (requires authentication, owner only)
GET
/posts/users/:userId
Get all posts for a user (requires authentication)
Short URLs Endpoints
/shorturls
Method
Endpoint
Description
POST
/shorturls
Create a new short URL (requires authentication)
GET
/shorturls
Get your short URLs (requires authentication)
GET
/shorturls/all
Get all short URLs (admin only, requires authentication)
GET
/shorturls/:shorturl
Redirect to the full URL
PATCH
/shorturls/:shorturlId
Update a short URL (requires authentication)
DELETE
/shorturls/:shorturlId
Delete a short URL (requires authentication)
GET
/shorturls/user/:userId
Get all short URLs for a user (requires authentication)
GET
/shorturls/my
Get your short URLs (alias, requires authentication)
Subscriptions Endpoints
/subscriptions
Method
Endpoint
Description
GET
/subscriptions
Get all subscriptions
GET
/subscriptions/:id
Get subscription details
POST
/subscriptions
Create a new subscription (requires authentication)
PUT
/subscriptions/:id
Update a subscription
DELETE
/subscriptions/:id
Delete a subscription
GET
/subscriptions/user/:id
Get all subscriptions for a user (requires authentication)
PUT
/subscriptions/:id/cancel
Cancel a subscription
GET
/subscriptions/upcoming-renewals
Get upcoming renewals
SaifAPI © 2025 —
GitHub
·
Contact
Found an issue or have feedback? Email us at
dev@saifabdelrazek.com