Resources
Additional resources, concepts, and reference materials to help you get the most out of the Weir AI API v1.0.1.Core Concepts
Understanding the fundamental concepts and design principles of the Weir AI API.
Changelog
Complete changelog for v1.0.1 with all new features, improvements, and breaking changes.
Error Codes
Comprehensive error code reference and troubleshooting guide.
Quick Reference
API Categories
External APIs
External APIs
Purpose: Public-facing APIs for third-party integrationsAuthentication: Basic Authentication with client credentials
Rate Limits: 100 requests/minute per client
Use Cases: Third-party integrations, public API accessKey Endpoints:
POST /auth/token- Generate access token
Console APIs
Console APIs
Purpose: Organization management and internal operationsAuthentication: Bearer Token with x-source header
Rate Limits: 200 requests/minute per user
Use Cases: Internal management tools, organization administrationKey Endpoints:
POST /auth/login- User loginPOST /org/create/team- Create teamGET /org/teams- Get teamsPOST /org/create/platform- Create platform
Admin APIs
Admin APIs
Purpose: Platform administration and system managementAuthentication: Bearer Token with admin privileges
Rate Limits: 500 requests/minute per admin
Use Cases: System administration, platform monitoringKey Endpoints:
POST /auth/authenticateAdmin- Admin authenticationGET /admin/organizations- Get organizationsPOST /pax/pod- Create podGET /logs/all- Get logs
Common Response Format
Error Response Format
HTTP Status Codes
Success Codes
- 200 OK: Successful GET, PUT, PATCH requests
- 201 Created: Successful POST requests
- 204 No Content: Successful DELETE requests
Error Codes
- 400 Bad Request: Invalid request parameters
- 401 Unauthorized: Authentication required
- 403 Forbidden: Insufficient permissions
- 404 Not Found: Resource not found
- 429 Too Many Requests: Rate limit exceeded
- 500 Internal Server Error: Server error
Rate Limiting
All APIs implement rate limiting with the following headers:Maximum number of requests allowed per time window.
Number of requests remaining in the current time window.
Unix timestamp when the rate limit window resets.
Authentication Methods
Basic Authentication
Basic Authentication
Used by: External APIs
Bearer Token
Bearer Token
Used by: Console APIs, Admin APIs
Pagination
Many endpoints support pagination for large datasets:Page number for pagination. Must be a positive integer.
Number of items per page. Range: 1-100.
Pagination Response Format
Common Error Codes
Authentication Errors
Authentication Errors
- UNAUTHORIZED: Invalid or expired authentication token
- INVALID_CREDENTIALS: Invalid client credentials or user credentials
- TOKEN_EXPIRED: Access token has expired
Permission Errors
Permission Errors
- FORBIDDEN: Valid authentication but insufficient permissions
- ACCESS_DENIED: Access denied to requested resource
- INSUFFICIENT_PERMISSIONS: User lacks required permissions
Validation Errors
Validation Errors
- VALIDATION_ERROR: Invalid request parameters
- MISSING_REQUIRED_FIELD: Required field is missing
- INVALID_FORMAT: Invalid data format
Resource Errors
Resource Errors
- NOT_FOUND: Requested resource not found
- RESOURCE_EXISTS: Resource already exists
- RESOURCE_CONFLICT: Resource conflict
Rate Limiting
Rate Limiting
- RATE_LIMIT_EXCEEDED: Too many requests in time window
- QUOTA_EXCEEDED: API quota exceeded
Best Practices
Authentication
Authentication
- Store credentials securely in environment variables
- Implement automatic token refresh before expiration
- Handle authentication errors gracefully
- Use different credentials for different environments
- Never expose tokens in client-side code
Error Handling
Error Handling
- Implement comprehensive error handling for all API operations
- Provide clear error messages to users
- Log errors for debugging without exposing sensitive information
- Handle network failures and timeouts gracefully
- Implement retry logic with exponential backoff
Performance
Performance
- Cache responses when possible to reduce API calls
- Use pagination for large datasets
- Monitor rate limit headers to avoid hitting limits
- Implement request queuing for high-volume applications
- Use appropriate HTTP methods for different operations
Security
Security
- Always use HTTPS for all API requests
- Validate and sanitize all input parameters
- Implement proper CORS policies for web applications
- Follow OWASP security guidelines
- Use secure storage for authentication tokens
Development Workflow
Environment Setup
Set up development, staging, and production environments with appropriate API credentials.
API Testing
Use the API playground and testing tools to verify endpoint functionality.
Integration Development
Develop your integration following best practices and error handling patterns.
Testing and Validation
Test your integration thoroughly with various scenarios and edge cases.
Deployment and Monitoring
Deploy to production and monitor API usage, performance, and errors.
Support and Community
API Playground
Test endpoints directly in your browser with our interactive API playground.
Integration Guides
Detailed guides for building specific types of integrations.
Code Examples
Ready-to-use code examples in multiple programming languages.
Best Practices
Proven patterns and recommendations for building robust integrations.
Versioning and Compatibility
API Versioning
The Weir AI API uses URL-based versioning:- Current Version: v1.0.1
- Version Format:
/v{major}.{minor}.{patch} - Backward Compatibility: Minor and patch versions maintain backward compatibility
- Breaking Changes: Only major version changes introduce breaking changes
Migration Guidelines
Version Updates
Version Updates
- Review changelog for new features and changes
- Test new endpoints in staging environment
- Update client code to handle new response formats
- Monitor for deprecated endpoints and plan migration
Breaking Changes
Breaking Changes
- Major version updates may introduce breaking changes
- Review migration guides for detailed instructions
- Plan migration timeline and testing strategy
- Update documentation and client code accordingly