openapi: 3.2.0 info: title: OpenAPI definition Subscription Controller API version: v0 servers: - url: http://api.moirailabs.com/api/v1 description: Generated server url security: - bearerAuth: [] tags: - name: subscription-controller paths: /subscriptions/{id}: get: tags: - subscription-controller summary: GET Subscription description: GET info about subscription. operationId: getSubscription parameters: - name: id in: path required: true schema: type: string format: uuid - name: X-Request-ID in: header description: Optional frontend-generated correlation ID. The backend returns the effective value in the response header. required: false schema: maxLength: 128 minLength: 1 pattern: ^[A-Za-z0-9._:-]{1,128}$ type: string example: 8df31080-3b78-4e63-a67d-c2d107190f3c responses: '200': description: OK headers: X-Request-ID: description: Effective request correlation ID used by backend audit logging. schema: maxLength: 128 minLength: 1 pattern: ^[A-Za-z0-9._:-]{1,128}$ type: string example: 8df31080-3b78-4e63-a67d-c2d107190f3c content: '*/*': schema: $ref: '#/components/schemas/SubscriptionResponse' put: tags: - subscription-controller summary: PUT Subscription description: Update information about subscription. operationId: updateSubscription parameters: - name: id in: path required: true schema: type: string format: uuid - name: X-Request-ID in: header description: Optional frontend-generated correlation ID. The backend returns the effective value in the response header. required: false schema: maxLength: 128 minLength: 1 pattern: ^[A-Za-z0-9._:-]{1,128}$ type: string example: 8df31080-3b78-4e63-a67d-c2d107190f3c requestBody: content: application/json: schema: $ref: '#/components/schemas/SubscriptionUpdateRequest' required: true responses: '200': description: OK headers: X-Request-ID: description: Effective request correlation ID used by backend audit logging. schema: maxLength: 128 minLength: 1 pattern: ^[A-Za-z0-9._:-]{1,128}$ type: string example: 8df31080-3b78-4e63-a67d-c2d107190f3c content: '*/*': schema: $ref: '#/components/schemas/SubscriptionResponse' /subscriptions: post: tags: - subscription-controller summary: CREATE new Subscription description: POST Method to create a new subscription by user. operationId: createSubscription parameters: - name: X-Request-ID in: header description: Optional frontend-generated correlation ID. The backend returns the effective value in the response header. required: false schema: maxLength: 128 minLength: 1 pattern: ^[A-Za-z0-9._:-]{1,128}$ type: string example: 8df31080-3b78-4e63-a67d-c2d107190f3c requestBody: content: application/json: schema: $ref: '#/components/schemas/SubscriptionRequest' required: true responses: '200': description: OK headers: X-Request-ID: description: Effective request correlation ID used by backend audit logging. schema: maxLength: 128 minLength: 1 pattern: ^[A-Za-z0-9._:-]{1,128}$ type: string example: 8df31080-3b78-4e63-a67d-c2d107190f3c content: '*/*': schema: $ref: '#/components/schemas/SubscriptionResponse' components: schemas: SubscriptionUpdateRequest: required: - planId type: object properties: planId: type: string format: uuid paymentId: type: string format: uuid startDate: type: string format: date-time endDate: type: string format: date-time isActive: type: boolean SubscriptionResponse: type: object properties: id: type: string format: uuid userId: type: string format: uuid planId: type: string format: uuid paymentId: type: string format: uuid startDate: type: string format: date-time endDate: type: string format: date-time isActive: type: boolean createdAt: type: string format: date-time updatedAt: type: string format: date-time SubscriptionRequest: required: - endDate - isActive - planId - startDate type: object properties: planId: type: string format: uuid paymentId: type: string format: uuid startDate: type: string format: date-time endDate: type: string format: date-time isActive: type: boolean securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: JWT