123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571 |
- openapi: 3.0.0
- info:
- title: BYOM Core API
- version: '1.0'
- description: API for managing BYOM Core services
- contact:
- name: BYOM Support
- servers:
- - url: /api/v1/core
- description: BYOM Core API
- components:
- securitySchemes:
- BearerAuth:
- type: http
- scheme: bearer
- bearerFormat: JWT
- schemas:
- Error:
- type: object
- properties:
- error:
- type: string
- example: "Error message description"
- Message:
- type: object
- properties:
- message:
- type: string
- example: "Success message description"
- User:
- type: object
- properties:
- id:
- type: string
- format: uuid
- email:
- type: string
- format: email
- name:
- type: string
- phone_number:
- type: string
- role:
- type: string
- enum: [owner, admin, member]
- status:
- type: string
- enum: [active, pending, inactive]
- created_at:
- type: string
- format: date-time
- updated_at:
- type: string
- format: date-time
- Workspace:
- type: object
- properties:
- id:
- type: string
- format: uuid
- name:
- type: string
- created_at:
- type: string
- format: date-time
- updated_at:
- type: string
- format: date-time
- Profile:
- type: object
- properties:
- id:
- type: string
- format: uuid
- name:
- type: string
- workspace_id:
- type: string
- format: uuid
- Invite:
- type: object
- properties:
- id:
- type: string
- format: uuid
- email:
- type: string
- format: email
- workspace_id:
- type: string
- format: uuid
- role:
- type: string
- enum: [owner, admin, member]
- status:
- type: string
- enum: [pending, accepted, expired, cancelled]
- expires_at:
- type: string
- format: date-time
- created_at:
- type: string
- format: date-time
- paths:
- /health:
- get:
- summary: Health check endpoint
- responses:
- '200':
- description: Service is healthy
- content:
- application/json:
- schema:
- type: object
- properties:
- status:
- type: string
- example: "ok"
- /auth/login:
- post:
- summary: Authenticate user
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- required:
- - email
- - password
- properties:
- email:
- type: string
- format: email
- password:
- type: string
- format: password
- responses:
- '200':
- description: Login successful
- content:
- application/json:
- schema:
- type: object
- properties:
- token:
- type: string
- user:
- $ref: '#/components/schemas/User'
- '400':
- description: Invalid credentials
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Error'
- /users/current:
- get:
- summary: Get current user information
- security:
- - BearerAuth: []
- responses:
- '200':
- description: Current user information
- content:
- application/json:
- schema:
- type: object
- properties:
- user:
- $ref: '#/components/schemas/User'
- workspaces:
- type: array
- items:
- $ref: '#/components/schemas/Workspace'
- put:
- summary: Update current user
- security:
- - BearerAuth: []
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- required:
- - name
- properties:
- name:
- type: string
- phone_number:
- type: string
- responses:
- '200':
- description: User updated successfully
- content:
- application/json:
- schema:
- type: object
- properties:
- user:
- $ref: '#/components/schemas/User'
- /workspaces:
- post:
- summary: Create new workspace
- security:
- - BearerAuth: []
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- required:
- - name
- properties:
- name:
- type: string
- responses:
- '201':
- description: Workspace created
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Workspace'
- /workspaces/owners/init:
- post:
- summary: Initialize workspace owner
- description: First step of workspace owner creation - creates a pending owner account
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- required:
- - email
- - name
- properties:
- email:
- type: string
- format: email
- name:
- type: string
- phone_number:
- type: string
- responses:
- '201':
- description: Workspace owner initialized
- content:
- application/json:
- schema:
- type: object
- properties:
- user:
- $ref: '#/components/schemas/User'
- '400':
- description: Invalid request
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Error'
- '409':
- description: User already exists
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Error'
- /workspaces/owners:
- put:
- summary: Complete workspace owner creation
- description: Second step of workspace owner creation - sets password and activates the account
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- required:
- - email
- - name
- - password
- properties:
- email:
- type: string
- format: email
- name:
- type: string
- phone_number:
- type: string
- password:
- type: string
- format: password
- responses:
- '201':
- description: Workspace owner created
- content:
- application/json:
- schema:
- type: object
- properties:
- user:
- $ref: '#/components/schemas/User'
- '400':
- description: Invalid request
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Error'
- '404':
- description: Pending owner not found
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Error'
- '409':
- description: Email does not match pending owner
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Error'
- /workspaces/{id}/members:
- post:
- summary: Add member to workspace
- security:
- - BearerAuth: []
- parameters:
- - name: id
- in: path
- required: true
- schema:
- type: string
- format: uuid
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- required:
- - role
- properties:
- role:
- type: string
- enum: [admin, member]
- responses:
- '200':
- description: Member added successfully
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Message'
- /profiles:
- get:
- summary: List profiles
- security:
- - BearerAuth: []
- responses:
- '200':
- description: List of profiles
- content:
- application/json:
- schema:
- type: object
- properties:
- profiles:
- type: array
- items:
- $ref: '#/components/schemas/Profile'
- post:
- summary: Create new profile
- security:
- - BearerAuth: []
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- required:
- - name
- - workspace_id
- properties:
- name:
- type: string
- workspace_id:
- type: string
- format: uuid
- responses:
- '201':
- description: Profile created
- content:
- application/json:
- schema:
- type: object
- properties:
- profile:
- $ref: '#/components/schemas/Profile'
- /profiles/{id}:
- parameters:
- - name: id
- in: path
- required: true
- schema:
- type: string
- format: uuid
- get:
- summary: Get profile by ID
- security:
- - BearerAuth: []
- responses:
- '200':
- description: Profile details
- content:
- application/json:
- schema:
- type: object
- properties:
- profile:
- $ref: '#/components/schemas/Profile'
- put:
- summary: Update profile
- security:
- - BearerAuth: []
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- required:
- - name
- properties:
- name:
- type: string
- responses:
- '200':
- description: Profile updated
- content:
- application/json:
- schema:
- type: object
- properties:
- profile:
- $ref: '#/components/schemas/Profile'
- delete:
- summary: Delete profile
- security:
- - BearerAuth: []
- responses:
- '200':
- description: Profile deleted
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Message'
- /invitations:
- post:
- summary: Create invitation
- security:
- - BearerAuth: []
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- required:
- - email
- - workspace_id
- - role
- properties:
- email:
- type: string
- format: email
- workspace_id:
- type: string
- format: uuid
- role:
- type: string
- enum: [admin, member]
- responses:
- '201':
- description: Invitation created
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Invite'
- /invitations/accept:
- post:
- summary: Accept invitation
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- required:
- - email
- - name
- - password
- - token
- properties:
- email:
- type: string
- format: email
- name:
- type: string
- phone_number:
- type: string
- password:
- type: string
- format: password
- token:
- type: string
- responses:
- '201':
- description: Invitation accepted
- content:
- application/json:
- schema:
- type: object
- properties:
- user:
- $ref: '#/components/schemas/User'
- workspace_id:
- type: string
- format: uuid
- /invitations/validate:
- get:
- summary: Validate invitation token
- parameters:
- - name: token
- in: query
- required: true
- schema:
- type: string
- responses:
- '200':
- description: Token validation result
- content:
- application/json:
- schema:
- type: object
- properties:
- valid:
- type: boolean
- workspace_id:
- type: string
- format: uuid
- email:
- type: string
- format: email
|