Introduction
The Macondo Link Manager API is a RESTful service built with Fastify and Prisma for managing shortened links, tracking analytics, and organizing marketing campaigns.Base URL
All API requests should be made to:Architecture
The API is built with:- Fastify: High-performance Node.js web framework
- Prisma: Type-safe ORM for database operations
- Zod: Schema validation for requests and responses
- PostgreSQL: Primary database
Available Resources
The API provides the following resource groups:Authentication
Google OAuth 2.0 login and JWT-based session management
Links
Create, manage, and track shortened links
Clients
Manage agency clients and their campaigns
Campaigns
Organize links into marketing campaigns
Dashboard
Analytics and reporting endpoints
Users
User profile and session information
Request Format
All requests should use JSON format with the appropriateContent-Type header:
Example Request
Response Format
All responses are returned in JSON format.Success Response
Error Handling
The API uses standard HTTP status codes and returns detailed error messages.Error Response Structure
Common Status Codes
| Status Code | Description |
|---|---|
200 | Success |
201 | Resource created successfully |
204 | Success with no content (e.g., deletions) |
400 | Bad request - validation error |
401 | Unauthorized - missing or invalid authentication |
403 | Forbidden - insufficient permissions |
404 | Resource not found |
409 | Conflict - resource already exists |
500 | Internal server error |
503 | Service unavailable |
Validation Errors
Validation errors include detailed information about what failed:Domain Errors
Resource-specific errors:CORS Configuration
The API is configured to accept requests from the configured frontend URL with credentials support:- Allowed Methods:
GET,POST,PUT,DELETE,OPTIONS - Credentials: Enabled (cookies are sent/received)
- Allowed Origin: Configured via
FRONTEND_URLenvironment variable
The API uses cookie-based authentication, so ensure your client includes credentials in cross-origin requests.
Rate Limiting
Currently, there are no explicit rate limits enforced at the application level. However, standard infrastructure rate limiting may apply.Health Check
Check the API and database status:Endpoint
Success Response (200)
Error Response (503)
Example
Interactive Documentation
Explore and test the API using the built-in Swagger UI:- Complete endpoint reference
- Request/response schemas
- Interactive “Try it out” functionality
- Request examples
- Response samples
Open Swagger Documentation
Test API endpoints in your browser
Request Tracking
All requests include a unique request ID in the response headers:Next Steps
Authentication
Learn how to authenticate and manage sessions
Create Your First Link
Start creating and managing shortened links
