Welcome to COMPASS API
COMPASS is a comprehensive transportation management system that provides powerful APIs for managing users, departments, email analytics, customer support tickets, permissions, and audio transcription services.Getting Started
This documentation provides complete reference information for all COMPASS API endpoints, including detailed request/response examples, authentication requirements, and best practices for integration.Quick Start
- Authentication: All API calls require a valid JWT token
- Base URL:
http://localhost:2000 - Content Type:
application/jsonfor most endpoints - Rate Limiting: Check specific endpoints for any rate limits
API Overview
Core Services
| Service | Description | Endpoints |
|---|---|---|
| Authentication | OAuth integration and session management | 4 endpoints |
| User Management | Complete user lifecycle and permissions | 10 endpoints |
| Departments | Organizational structure and team management | 7 endpoints |
| Email Meter | Advanced email analytics and reporting | 12 endpoints |
| HubSpot Tickets | Customer support ticket management | 4 endpoints |
| Permissions | System-wide permission management | 1 endpoint |
| Transcription | Audio-to-text conversion services | 2 endpoints |
Authentication Flow
Key Features
Secure Authentication
- OAuth 2.0 integration with Google and Microsoft
- JWT-based session management
- Role-based access control
- Admin-only endpoints protection
Comprehensive User Management
- User profile management
- Department assignment and role management
- Permission-based access control
- Account linking and matching
Department Organization
- Hierarchical department structure
- User assignment and manager roles
- Department-based permissions
- Organizational analytics
Advanced Email Analytics
- Real-time email monitoring
- Performance metrics and SLA tracking
- Agent productivity analytics
- Client domain insights
- Hourly and trend analysis
Customer Support Integration
- HubSpot ticket management
- Advanced filtering and search
- Multi-format export capabilities
- Real-time ticket processing
Audio Transcription
- Automated speech-to-text conversion
- Multi-language support
- Confidence scoring and segmentation
- Transcription management
Making Your First API Call
1. Authenticate
2. Use Your Token
Response Format
All API responses follow a consistent format:Success Response
Error Response
HTTP Status Codes
| Code | Description |
|---|---|
200 | Success |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
500 | Internal Server Error |
SDK and Libraries
While we don’t provide official SDKs yet, our RESTful API is designed to work seamlessly with any HTTP client library:- JavaScript/Node.js:
fetch,axios - Python:
requests - Java:
OkHttp,Retrofit - C#:
HttpClient - Ruby:
Net::HTTP
Rate Limiting
API calls are subject to rate limiting to ensure fair usage:- Standard endpoints: 1000 requests per hour
- Authentication endpoints: 100 requests per hour
- Export endpoints: 50 requests per hour
Best Practices
Security
- Always use HTTPS in production
- Store JWT tokens securely
- Implement token refresh logic
- Validate all input data
Performance
- Use appropriate pagination
- Cache static data when possible
- Implement retry logic for failed requests
- Monitor API usage and optimize
Error Handling
- Always check HTTP status codes
- Handle rate limit responses gracefully
- Implement exponential backoff for retries
- Log errors for debugging
Support
- Documentation: This comprehensive guide
- Status Page: Check system status
- Support Email: [email protected]
- GitHub: Report issues and contribute
What’s Next?
- Explore Authentication: Learn about our OAuth integration
- Browse APIs: Discover all available endpoints
- Try Examples: Use our code samples to get started
- Build Integration: Start building with COMPASS API