openapi: 3.0.3 info: title: AltPro API version: 1.0.0 description: > Resource API for the AltPro platform. Secured with OAuth2/OIDC; clients call endpoints using Bearer JWT issued by the Authorization Server. servers: - url: http://localhost:9001 description: Local API server security: - bearerAuth: [] tags: - name: Organizations - name: Projects - name: Tasks - name: Comments - name: Invitations - name: Members components: securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: JWT schemas: Error: type: object properties: message: { type: string } Organization: type: object required: [id, name] properties: id: { type: string, example: "64f1c2a..." } name: { type: string, example: "KTU Dev Club" } description: { type: string, example: "Student projects organization" } createdAt: { type: string, format: date-time, example: "2025-10-01T10:00:00Z" } members: type: array items: { $ref: "#/components/schemas/OrgMember" } OrgMember: type: object required: [userId, role] properties: userId: { type: string, example: "user1" } role: { type: string, enum: [ADMIN, MEMBER], example: "MEMBER" } Project: type: object required: [id, organizationId, name] properties: id: { type: string, example: "prj_abc123" } organizationId: { type: string, example: "org_123" } name: { type: string, example: "Website Revamp" } description: { type: string, example: "Revamp marketing website" } createdAt: { type: string, format: date-time, example: "2025-10-01T10:00:00Z" } members: type: array items: { type: string } Task: type: object required: [id, projectId, title, status, priority] properties: id: { type: string, example: "tsk_001" } projectId: { type: string, example: "prj_abc123" } title: { type: string, example: "Design landing" } description: { type: string, example: "Create hero and CTA" } status: { type: string, enum: [TODO, IN_PROGRESS, DONE], example: "TODO" } priority: { type: integer, example: 2 } assignee: { type: string, example: "user1" } createdAt: { type: string, format: date-time, example: "2025-10-02T09:00:00Z" } Comment: type: object required: [id, taskId, author, text] properties: id: { type: string, example: "cmt_001" } taskId: { type: string, example: "tsk_001" } author: { type: string, example: "user2" } text: { type: string, example: "Looks good. Add CTA button." } createdAt: { type: string, format: date-time, example: "2025-10-03T09:00:00Z" } Invitation: type: object required: [id, organizationId] properties: id: { type: string, example: "inv_001" } organizationId: { type: string, example: "org_123" } inviteeUsername: { type: string, example: "john" } inviteeEmail: { type: string, example: "john@example.com" } status: { type: string, example: "PENDING" } paths: /api/orgs: get: tags: [Organizations] summary: List organizations responses: "200": description: OK content: application/json: schema: type: array items: { $ref: "#/components/schemas/Organization" } examples: sample: value: - id: "org_123" name: "KTU Dev Club" description: "Student projects organization" members: [] post: tags: [Organizations] summary: Create organization requestBody: required: true content: application/json: schema: type: object required: [name] properties: name: { type: string } description: { type: string } examples: sample: value: name: "KTU Dev Club" description: "Student projects organization" responses: "201": description: Created content: application/json: schema: { $ref: "#/components/schemas/Organization" } "400": { description: Bad Request, content: { application/json: { schema: { $ref: "#/components/schemas/Error" } } } } "401": { description: Unauthorized } "403": { description: Forbidden } /api/orgs/{id}: get: tags: [Organizations] summary: Get organization by id parameters: - in: path name: id required: true schema: { type: string } responses: "200": description: OK content: application/json: schema: { $ref: "#/components/schemas/Organization" } "404": { description: Not Found } put: tags: [Organizations] summary: Update organization parameters: - in: path name: id required: true schema: { type: string } requestBody: required: true content: application/json: schema: type: object properties: name: { type: string } description: { type: string } examples: sample: value: name: "KTU Dev Club" description: "Updated description" responses: "200": { description: OK, content: { application/json: { schema: { $ref: "#/components/schemas/Organization" } } } } "400": { description: Bad Request } "404": { description: Not Found } /api/orgs/{id}/leave: post: tags: [Organizations] summary: Leave organization parameters: - in: path name: id required: true schema: { type: string } responses: "200": { description: OK } "401": { description: Unauthorized } "404": { description: Not Found } /api/orgs/{orgId}/invitations: get: tags: [Invitations] summary: List invitations for organization parameters: - in: path name: orgId required: true schema: { type: string } responses: "200": description: OK content: application/json: schema: type: array items: { $ref: "#/components/schemas/Invitation" } /api/invitations/mine: get: tags: [Invitations] summary: List my invitations responses: "200": description: OK content: application/json: schema: type: array items: { $ref: "#/components/schemas/Invitation" } /api/invitations/{id}/accept: post: tags: [Invitations] summary: Accept invitation parameters: - in: path name: id required: true schema: { type: string } responses: "200": description: OK content: application/json: schema: type: object properties: status: { type: string, example: "ACCEPTED" } /api/invitations/{id}/decline: post: tags: [Invitations] summary: Decline invitation parameters: - in: path name: id required: true schema: { type: string } responses: "200": description: OK content: application/json: schema: type: object properties: status: { type: string, example: "DECLINED" } /api/orgs/{id}/members: post: tags: [Members] summary: Add organization member parameters: - in: path name: id required: true schema: { type: string } requestBody: required: true content: application/json: schema: type: object properties: userId: { type: string } role: { type: string, enum: [ADMIN, MEMBER] } examples: sample: value: userId: "user2" role: "MEMBER" responses: "200": { description: OK } "400": { description: Bad Request } "403": { description: Forbidden } /api/orgs/{id}/members/{memberId}: put: tags: [Members] summary: Update member role parameters: - in: path name: id required: true schema: { type: string } - in: path name: memberId required: true schema: { type: string } requestBody: required: true content: application/json: schema: type: object properties: role: { type: string, enum: [ADMIN, MEMBER] } examples: sample: value: role: "ADMIN" responses: "200": { description: OK } "400": { description: Bad Request } "404": { description: Not Found } delete: tags: [Members] summary: Remove organization member parameters: - in: path name: id required: true schema: { type: string } - in: path name: memberId required: true schema: { type: string } responses: "200": { description: OK } "404": { description: Not Found } /api/orgs/{orgId}/projects: get: tags: [Projects] summary: List projects parameters: - in: path name: orgId required: true schema: { type: string } responses: "200": description: OK content: application/json: schema: type: array items: { $ref: "#/components/schemas/Project" } post: tags: [Projects] summary: Create project parameters: - in: path name: orgId required: true schema: { type: string } requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/Project" } examples: sample: value: organizationId: "org_123" name: "Website Revamp" description: "Revamp marketing website" responses: "201": { description: Created, content: { application/json: { schema: { $ref: "#/components/schemas/Project" } } } } "400": { description: Bad Request } "403": { description: Forbidden } /api/orgs/{orgId}/projects/{id}: get: tags: [Projects] summary: Get project by id parameters: - in: path name: orgId required: true schema: { type: string } - in: path name: id required: true schema: { type: string } responses: "200": { description: OK, content: { application/json: { schema: { $ref: "#/components/schemas/Project" } } } } "404": { description: Not Found } put: tags: [Projects] summary: Update project parameters: - in: path name: orgId required: true schema: { type: string } - in: path name: id required: true schema: { type: string } requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/Project" } examples: sample: value: name: "Website Revamp" description: "Update scope" responses: "200": { description: OK } "404": { description: Not Found } delete: tags: [Projects] summary: Delete project parameters: - in: path name: orgId required: true schema: { type: string } - in: path name: id required: true schema: { type: string } responses: "204": { description: No Content } "404": { description: Not Found } /api/orgs/{orgId}/tasks: get: tags: [Tasks] summary: List tasks parameters: - in: path name: orgId required: true schema: { type: string } responses: "200": description: OK content: application/json: schema: type: array items: { $ref: "#/components/schemas/Task" } post: tags: [Tasks] summary: Create task parameters: - in: path name: orgId required: true schema: { type: string } requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/Task" } examples: sample: value: projectId: "prj_abc123" title: "Implement API" description: "Backend endpoints" status: "IN_PROGRESS" priority: 1 responses: "201": { description: Created, content: { application/json: { schema: { $ref: "#/components/schemas/Task" } } } } "400": { description: Bad Request } /api/orgs/{orgId}/tasks/{id}: get: tags: [Tasks] summary: Get task by id parameters: - in: path name: orgId required: true schema: { type: string } - in: path name: id required: true schema: { type: string } responses: "200": { description: OK, content: { application/json: { schema: { $ref: "#/components/schemas/Task" } } } } "404": { description: Not Found } put: tags: [Tasks] summary: Update task parameters: - in: path name: orgId required: true schema: { type: string } - in: path name: id required: true schema: { type: string } requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/Task" } examples: sample: value: title: "Design landing page" status: "DONE" priority: 2 responses: "200": { description: OK } "404": { description: Not Found } delete: tags: [Tasks] summary: Delete task parameters: - in: path name: orgId required: true schema: { type: string } - in: path name: id required: true schema: { type: string } responses: "200": { description: OK } "404": { description: Not Found } /api/orgs/{orgId}/tasks/project/{projectId}: get: tags: [Tasks] summary: List tasks by project parameters: - in: path name: orgId required: true schema: { type: string } - in: path name: projectId required: true schema: { type: string } responses: "200": description: OK content: application/json: schema: type: array items: { $ref: "#/components/schemas/Task" } /api/orgs/{orgId}/comments/task/{taskId}: get: tags: [Comments] summary: List comments by task parameters: - in: path name: orgId required: true schema: { type: string } - in: path name: taskId required: true schema: { type: string } responses: "200": description: OK content: application/json: schema: type: array items: { $ref: "#/components/schemas/Comment" } "404": { description: Not Found }