API Reference
API Reference
This document provides a complete reference for all API endpoints in Bitor.
Authentication
Login
POST /api/collections/users/auth-with-passwordRequest Body:
{ "identity": "user@example.com", "password": "password123"}Response:
{ "token": "JWT_TOKEN", "record": { "id": "USER_ID", "email": "user@example.com", // other user fields }}Refresh Token
POST /api/collections/users/auth-refreshOrganizations
Create Organization
POST /api/collections/organizations/recordsRequest Body:
{ "name": "Organization Name", "description": "Organization Description"}List Organizations
GET /api/collections/organizations/recordsUpdate Organization
PATCH /api/collections/organizations/records/{id}Invitations
Create Invitation
POST /api/collections/invitations/recordsRequest Body:
{ "email": "invite@example.com", "organization": "ORG_ID", "role": "member"}Accept Invitation
POST /api/accept-inviteRequest Body:
{ "token": "INVITATION_TOKEN"}Calendar Events
Create Event
POST /api/collections/events/recordsRequest Body:
{ "title": "Event Title", "start": "2023-01-01T10:00:00Z", "end": "2023-01-01T11:00:00Z", "description": "Event Description"}List Events
GET /api/collections/events/recordsUpdate Event
PATCH /api/collections/events/records/{id}Notifications
Get Notification Settings
GET /api/collections/notification_settings/recordsUpdate Notification Settings
PATCH /api/collections/notification_settings/records/{id}Request Body:
{ "email_enabled": true, "teams_enabled": true, "webhook_url": "https://teams.webhook.url"}Error Responses
All endpoints may return the following error responses:
400 Bad Request
{ "code": 400, "message": "Invalid request", "data": {}}401 Unauthorized
{ "code": 401, "message": "Authentication required", "data": {}}403 Forbidden
{ "code": 403, "message": "Insufficient permissions", "data": {}}404 Not Found
{ "code": 404, "message": "Record not found", "data": {}}Rate Limiting
API requests are limited to:
- 100 requests per minute for authenticated users
- 20 requests per minute for unauthenticated users
Authentication Headers
Include the authentication token in the Authorization header:
Authorization: Bearer YOUR_JWT_TOKENQuery Parameters
Common query parameters for list endpoints:
page: Page number (default: 1)perPage: Items per page (default: 30)sort: Sort field and direction (e.g.,-created,name)filter: Filter query (e.g.,created >= "2023-01-01")
Webhook Events
Available webhook event types:
user.createdorganization.createdinvitation.sentinvitation.acceptedevent.createdevent.updatedevent.deleted