{"openapi":"3.0.3","info":{"title":"Fellow Collaborative SaaS API","description":"Secure Multi-Tenant Project and Task Collaboration Platform API with strict organization isolation, fine-grained RBAC, fractional task reordering, and durable event publishing.","version":"1.0.0"},"servers":[{"url":"http://localhost:3000/api/v1","description":"Local development server"}],"paths":{"/health/live":{"get":{"summary":"Liveness probe (no dependencies touched)","responses":{"200":{"description":"Process is up"}}}},"/health":{"get":{"summary":"Readiness probe (database, realtime bus, outbox lag)","responses":{"200":{"description":"Ready. `status` is `healthy`, or `degraded` when the outbox is lagging or has dead-lettered events"},"503":{"description":"Database unreachable"}}}},"/auth/register":{"post":{"summary":"Register a new user","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","email","password"],"properties":{"name":{"type":"string"},"email":{"type":"string","format":"email"},"password":{"type":"string","minLength":8,"maxLength":72}}}}}},"responses":{"201":{"description":"User created and session established"},"400":{"description":"Email already in use or validation error"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/auth/login":{"post":{"summary":"Authenticate user","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email","password"],"properties":{"email":{"type":"string"},"password":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful authentication"},"401":{"description":"Invalid credentials"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/me":{"get":{"summary":"Get current authenticated user","security":[{"CookieAuth":[]},{"BearerAuth":[]}],"responses":{"200":{"description":"Authenticated user details"},"401":{"description":"Unauthorized"}}}},"/organizations":{"get":{"summary":"List organizations accessible to user","responses":{"200":{"description":"List of organizations"}}},"post":{"summary":"Create an organization","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"slug":{"type":"string"}}}}}},"responses":{"201":{"description":"Organization created"}}}},"/organizations/{organizationId}":{"get":{"summary":"Get organization details","parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Organization details"},"404":{"description":"Organization not found or access denied"}}},"patch":{"summary":"Update organization settings","parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"}}}}}},"responses":{"200":{"description":"Updated organization"},"403":{"description":"Forbidden"}}}},"/organizations/{organizationId}/members":{"get":{"summary":"List organization members","parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Organization members"}}}},"/organizations/{organizationId}/invitations":{"post":{"summary":"Invite member to organization","parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email","role"],"properties":{"email":{"type":"string"},"role":{"type":"string","enum":["owner","admin","member","viewer","guest"]}}}}}},"responses":{"201":{"description":"Invitation created"}}}},"/organizations/{organizationId}/projects":{"get":{"summary":"List accessible projects","parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"List of accessible projects"}}},"post":{"summary":"Create a project","parameters":[{"name":"organizationId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"visibility":{"type":"string","enum":["organization","private","guest"]}}}}}},"responses":{"201":{"description":"Project created"}}}},"/projects/{projectId}":{"get":{"summary":"Get project by ID","parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Project details"},"404":{"description":"Project not found or access denied"}}},"patch":{"summary":"Update project","parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Project updated"}}}},"/projects/{projectId}/tasks":{"get":{"summary":"List tasks in project","parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}},{"name":"statusId","in":"query","schema":{"type":"string"}},{"name":"priority","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Tasks ordered by column position"}}},"post":{"summary":"Create a new task","parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title","statusId"],"properties":{"title":{"type":"string"},"description":{"type":"string"},"statusId":{"type":"string"},"priority":{"type":"string","enum":["urgent","high","medium","low","none"]},"assigneeId":{"type":"string"},"dueAt":{"type":"string","format":"date-time"}}}}}},"responses":{"201":{"description":"Task created"}}}},"/tasks/{taskId}":{"get":{"summary":"Get task details","parameters":[{"name":"taskId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Task details"},"404":{"description":"Task not found"}}},"patch":{"summary":"Update task fields with optimistic concurrency control","parameters":[{"name":"taskId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"statusId":{"type":"string"},"priority":{"type":"string"},"version":{"type":"integer","description":"Expected optimistic locking version"}}}}}},"responses":{"200":{"description":"Updated task"},"409":{"description":"Version conflict detected"}}}},"/tasks/{taskId}/move":{"post":{"summary":"Move or reorder task across columns or positions","parameters":[{"name":"taskId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["statusId"],"properties":{"statusId":{"type":"string"},"prevTaskId":{"type":"string"},"nextTaskId":{"type":"string"},"destinationProjectId":{"type":"string"},"expectedVersion":{"type":"integer"}}}}}},"responses":{"200":{"description":"Task moved and reordered"},"409":{"description":"Concurrency conflict"}}}},"/tasks/{taskId}/activity":{"get":{"summary":"Get task audit activity history","parameters":[{"name":"taskId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Chronological task activity logs"}}}},"/tasks/{taskId}/comments":{"get":{"summary":"List task comments","parameters":[{"name":"taskId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Task comments"}}},"post":{"summary":"Add comment to task","parameters":[{"name":"taskId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["content"],"properties":{"content":{"type":"string"}}}}}},"responses":{"201":{"description":"Comment added"}}}},"/search":{"get":{"summary":"Search accessible projects and tasks","description":"Without q, the filters alone select tasks and no projects are returned (assigneeId=me lists the caller's tasks). \"%\" and \"_\" in q match literally. Up to 50 tasks, most recently updated first.\n","parameters":[{"name":"organizationId","in":"query","required":true,"schema":{"type":"string"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"projectId","in":"query","schema":{"type":"string"}},{"name":"statusId","in":"query","schema":{"type":"string"}},{"name":"priority","in":"query","schema":{"type":"string","enum":["urgent","high","medium","low","none"]}},{"name":"assigneeId","in":"query","description":"A user id, or \"me\" for the signed-in user","schema":{"type":"string"}}],"responses":{"200":{"description":"Filtered search results strictly within access scope"},"422":{"$ref":"#/components/responses/ValidationFailed"}}}},"/notifications":{"get":{"summary":"List user notifications","responses":{"200":{"description":"Filtered user notifications verified against current resource permissions"}}}},"/realtime/stream":{"get":{"summary":"Server-Sent Events real-time subscription","parameters":[{"name":"organizationId","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Continuous text/event-stream of authorized collaboration events"}}}}},"components":{"schemas":{"Error":{"description":"The body of every error response","type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string","enum":["UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","VALIDATION_ERROR","BAD_REQUEST","RATE_LIMITED","INTERNAL_SERVER_ERROR"]},"message":{"type":"string"},"requestId":{"type":"string","description":"Also sent as the x-request-id header; quote it when reporting a problem"},"details":{"description":"For VALIDATION_ERROR, the messages for each invalid field","type":"object"}}}}}},"responses":{"ValidationFailed":{"description":"The body or query failed validation (a malformed JSON body is a 400 instead)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many attempts; retry after the number of seconds in the Retry-After header","headers":{"Retry-After":{"schema":{"type":"integer"}}}}},"securitySchemes":{"CookieAuth":{"type":"apiKey","in":"cookie","name":"fellow_session"},"BearerAuth":{"type":"http","scheme":"bearer"}}}}