--- openapi: 3.0.3 info: title: FLECS Console API license: name: Apache 2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html version: 1.0.0 servers: - url: https://console.flecs.tech description: '' tags: - name: Default description: '' - name: Device description: '' - name: Download Tokens description: '' - name: Manifests description: '' - name: Products description: '' - name: User description: '' components: parameters: sessionIdParam: name: X-Session-Id in: header required: true schema: $ref: '#/components/schemas/id' authParam: name: Authorization in: header required: true schema: $ref: '#/components/schemas/auth' schemas: errorDescription: type: object properties: reason: type: string statusCode: type: integer statusText: type: string sessionId: type: object properties: id: $ref: '#/components/schemas/id' timestamp: type: integer minimum: 0 format: int64 auth: type: string pattern: Bearer .+ id: type: string pattern: "^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$" activationData: type: object properties: sessionId: $ref: '#/components/schemas/sessionId' licenseKey: type: string required: - sessionId - licenseKey appManifestSchemaVersion: type: string pattern: "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$" example: "3.0.0-beta.1" description: "https://regex101.com/r/y9GIZD/1" jwt: type: object properties: token: type: string additionalProperties: false address: type: object properties: street_1: type: string street_2: type: string city: type: string zip: type: string country: type: string state: type: string required: - street_1 - street_2 - city - zip - country - state productCategory: type: object properties: id: type: integer name: type: string slug: type: string required: - id - name - slug productAttribute: type: object properties: id: type: integer name: type: string options: type: array items: type: string required: - id - name - options productMetadata: type: object properties: id: type: integer name: type: string value: type: object required: - name - options productStore: type: object properties: id: type: integer name: type: string shop_name: type: string url: type: string address: $ref: "#/components/schemas/address" required: - id - name - shop_name - url - address product: type: object properties: id: type: integer name: type: string status: type: string description: type: string short_description: type: string average_rating: type: string rating_count: type: integer categories: type: array items: $ref: '#/components/schemas/productCategory' attributes: type: array items: $ref: '#/components/schemas/productAttribute' meta_data: type: array items: $ref: '#/components/schemas/productMetadata' stock_status: type: string store: $ref: '#/components/schemas/productStore' permalink: type: string price: type: string purchasable: type: boolean required: - id - name - status - description - short_description - average_rating - rating_count - categories - attributes - meta_data - stock_status - store - permalink - price - purchasable productResponse: type: object properties: page: type: integer totalPages: type: integer products: type: array items: $ref: '#/components/schemas/product' required: - page - totalPages - products appResponse: type: object properties: totalProducts: type: integer products: type: array items: $ref: '#/components/schemas/product' required: - totalProducts - products reviewRequest: type: object properties: data: type: object properties: product_id: type: integer review: type: string reviewer: type: string reviewer_email: type: string rating: type: number required: - product_id - review - reviewer - reviewer_email - rating jwt: type: string required: - totalProducts - products reviewResponse: type: object properties: review: type: object properties: id: type: integer date_created: type: string date_created_gmt: type: string product_id: type: integer product_name: type: string product_permalink: type: string status: type: string reviewer: type: string reviewer_email: type: string review: type: string rating: type: number verified: type: boolean required: - id - date_created - date_created_gmt - product_id - product_name - product_permalink - status - reviewer - reviewer_email - review - rating - verified required: - review orderBilling: type: object properties: first_name: type: string last_name: type: string company: type: string email: type: string orderLineItem: type: object properties: id: type: integer status: type: string product_id: type: integer variation_id: type: integer quantity: type: integer image: type: object required: - id - status - product_id - variation_id - quantity - image order: type: object properties: id: type: integer status: type: string customer_id: type: number line_items: type: array items: $ref: '#/components/schemas/orderLineItem' billing: $ref: '#/components/schemas/orderBilling' required: - id - status - customer_id - line_items - billing subscriptions: type: object properties: totalSubscriptions: type: integer subscriptions: type: array items: $ref: '#/components/schemas/order' required: - totalSubscriptions - subscriptions deviceLicense: type: object required: - manufacturer - model - serial_number - manufacture_date properties: manufacturer: type: object required: - name - id properties: name: type: string example: "Example Manufacturer" id: type: integer example: 791 model: type: string example: "IPC-xyz" serial_number: type: string example: "SN123456789" description: "Unique identifier for the device, must be globally unique across all devices" manufacture_date: type: string format: date example: "2025-01-01" description: "ISO 8601 date format" deviceLicenseResponse: type: object properties: manufacturer: type: object properties: name: type: string example: "Example Manufacturer" id: type: integer example: 791 model: type: string example: "IPC-xyz" serial_number: type: string example: "SN123456789" manufacture_date: type: string format: date example: "2025-01-01" created_at: type: string format: date-time example: "2025-07-28T10:30:00.000Z" description: "ISO 8601 timestamp with timezone" status: type: integer format: int16 example: 0 securitySchemes: { } paths: "/api/v2/auth/login": parameters: [ ] post: description: 'Login to console as user with password' operationId: post-api-v2-auth-login parameters: [ ] requestBody: content: application/json: examples: example-0001: value: issueJWT: true password: password username: user schema: additionalProperties: false properties: issueJWT: type: boolean password: type: string username: type: string title: APIV2AuthLoginPostRequest type: object responses: '200': content: application/json: examples: example-0001: value: data: feature_flags: isVendor: false isWhitelabeled: false jwt: token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI... token_expires: 1704378025 user: ID: 6 display_name: user user_email: user@mail.com user_login: user statusCode: 200 statusText: OK schema: additionalProperties: false properties: data: additionalProperties: false properties: feature_flags: additionalProperties: false properties: isVendor: type: boolean isWhitelabeled: type: boolean title: FeatureFlags type: object jwt: additionalProperties: false properties: token: type: string token_expires: type: integer title: Jwt type: object user: additionalProperties: false properties: ID: type: integer display_name: type: string user_email: type: string user_login: type: string title: User type: object title: Data type: object statusCode: type: integer statusText: type: string title: APIV2AuthLoginPostResponse type: object description: Item created '403': content: application/json: examples: example-0001: value: reason: Sorry, the password you entered is incorrect. Please verify your input or let us help you recover your account. statusCode: 403 statusText: Forbidden schema: $ref: '#/components/schemas/errorDescription' description: 'Password or user incorrect' summary: Log in tags: - Default "/api/v2/auth/validate": parameters: [ ] post: description: 'Validate authentication token' operationId: post-api-v2-auth-validate parameters: [ ] requestBody: content: application/json: examples: example-0001: value: jwt: token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI... schema: additionalProperties: false properties: jwt: additionalProperties: false properties: token: type: string title: Jwt type: object title: APIV2AuthValidatePostRequest type: object responses: '200': content: application/json: examples: example-0001: value: data: feature_flags: ff: isVendor: false isWhitelabeled: false isValid: true statusCode: 200 statusText: OK schema: additionalProperties: false properties: data: additionalProperties: false properties: feature_flags: additionalProperties: false properties: ff: additionalProperties: false properties: isVendor: type: boolean isWhitelabeled: type: boolean title: Ff type: object title: FeatureFlags type: object isValid: type: boolean title: Data type: object statusCode: type: integer statusText: type: string title: APIV2AuthValidatePostResponse type: object description: Item created summary: Create api validate tags: - Default "/api/v2/device/license/activate": post: description: 'Activate device via user license or device serial number' operationId: post-api-v2-device-license-activate parameters: - name: Authorization description: Provide only if activation via user license should be performed in: header required: false schema: $ref: '#/components/schemas/auth' - name: X-Session-Id description: Leave out if no sessionId is known. in: header required: false schema: $ref: '#/components/schemas/id' requestBody: content: application/json: schema: type: object properties: licenseKey: type: string responses: '200': content: application/json: schema: type: object properties: data: $ref: '#/components/schemas/activationData' statusCode: type: integer statusText: type: string required: - data description: Device successfully activated '204': headers: X-Session-Id: required: true schema: $ref: '#/components/schemas/sessionId' description: Device already active '403': content: application/json: examples: example-0001: value: reason: 'Missing Header: Authorization' statusCode: 403 statusText: Forbidden schema: $ref: '#/components/schemas/errorDescription' description: 'Forbidden, e.g. no user license available' '500': content: application/json: examples: example-0001: value: reason: Could not validate device activation statusCode: 500 statusText: Internal Server Error schema: $ref: '#/components/schemas/errorDescription' description: 'Internal Server Error' summary: Activate license tags: - Device "/api/v2/device/license/validate": parameters: [ ] post: description: 'Validate the device license based on the session id' operationId: post-api-v2-device-license-validate parameters: - $ref: '#/components/parameters/sessionIdParam' responses: '200': content: application/json: examples: example-0001: value: data: isValid: true statusCode: 200 statusText: OK schema: type: object properties: data: type: object properties: isValid: type: boolean required: - isValid statusCode: type: integer statusText: type: string required: - data description: Device successfully activated headers: X-Session-Id: required: false schema: $ref: '#/components/schemas/sessionId' '500': content: application/json: examples: example-0001: value: reason: Could not validate device activation statusCode: 500 statusText: Internal Server Error schema: $ref: '#/components/schemas/errorDescription' description: 'Internal Server Error' summary: Validate license tags: - Device "/api/v2/device/license": post: summary: Register device license description: Register a new device license with manufacturer and device details parameters: - $ref: '#/components/parameters/authParam' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/deviceLicense' responses: '201': description: Device license created successfully content: application/json: examples: example-0001: value: data: manufacturer: name: "Example Manufacturer" id: 791 model: "IPC-xyz" serial_number: "SN123456789" manufacture_date: "2025-01-01" created_at: "2025-07-28T10:30:00.000Z" status: 0 statusCode: 201 statusText: "Created" schema: type: object properties: data: $ref: '#/components/schemas/deviceLicenseResponse' statusCode: type: integer statusText: type: string required: - data - statusCode - statusText '400': description: Bad request - Invalid payload content: application/json: examples: example-0001: value: reason: "Invalid payload: missing required field 'serial_number'" statusCode: 400 statusText: "Bad Request" schema: $ref: '#/components/schemas/errorDescription' '401': description: Unauthorized - Invalid or missing bearer token content: application/json: examples: example-0001: value: reason: "Invalid or missing bearer token" statusCode: 401 statusText: "Unauthorized" schema: $ref: '#/components/schemas/errorDescription' '422': description: Unprocessable Entity - Validation errors content: application/json: examples: example-0001: value: reason: "Invalid serial number format" statusCode: 422 statusText: "Unprocessable Entity" schema: $ref: '#/components/schemas/errorDescription' '500': description: Internal server error content: application/json: examples: example-0001: value: reason: "Could not register device license" statusCode: 500 statusText: "Internal Server Error" schema: $ref: '#/components/schemas/errorDescription' tags: - Device "/api/v2/manifests/{app}/{version}": parameters: [ ] get: description: 'Get the app manifest for a given app and version' operationId: get-api-v2-manifests-app-version parameters: - $ref: '#/components/parameters/sessionIdParam' - name: app in: path required: true schema: type: string - name: version in: path required: true schema: type: string - name: max_manifest_version in: query schema: $ref: '#/components/schemas/appManifestSchemaVersion' required: false - name: manifest_version in: query schema: $ref: '#/components/schemas/appManifestSchemaVersion' required: false responses: '200': content: application/json: schema: type: object properties: statusCode: type: integer statusText: type: string data: # See https://raw.githubusercontent.com/FLECS-Technologies/app-sdk/main/manifest.schema.json type: object description: App Manifests for App {app} in version {version} '403': content: application/json: examples: example-0001: value: reason: 'Session not found' statusCode: 403 statusText: Forbidden schema: $ref: '#/components/schemas/errorDescription' description: 'Session id invalid or not found' '400': description: 'Bad Request' content: application/json: examples: example-0001: value: reason: Invalid query parameter manifest_version statusCode: 400 statusText: Bad Request schema: $ref: '#/components/schemas/errorDescription' headers: X-Session-Id: required: true schema: $ref: '#/components/schemas/sessionId' '404': content: application/json: examples: example-0001: value: statusCode: 404 statusText: Not found schema: type: object properties: statusCode: type: integer statusText: type: string description: No such App/version combination headers: X-Session-Id: required: true schema: $ref: '#/components/schemas/sessionId' '500': content: application/json: examples: example-0001: value: reason: Could not validate device activation statusCode: 500 statusText: Internal Server Error schema: $ref: '#/components/schemas/errorDescription' description: 'Internal Server Error' headers: X-Session-Id: required: false schema: $ref: '#/components/schemas/sessionId' summary: Download App manifest "/api/v2/tokens": parameters: [ ] post: description: 'Create a download token for a given app and version' operationId: post-api-v2-tokens parameters: - $ref: '#/components/parameters/sessionIdParam' requestBody: content: application/json: schema: type: object required: - app - version properties: app: type: string version: type: string responses: '200': content: application/json: schema: type: object properties: statusCode: type: integer statusText: type: string data: type: object properties: token: type: object properties: username: type: string password: type: string required: - username - password required: - token required: - statusCode - data description: Download token for App {app} in version {version} headers: X-Session-Id: required: true schema: $ref: '#/components/schemas/sessionId' '204': description: Inofficial App, no download token creation possible headers: X-Session-Id: required: true schema: $ref: '#/components/schemas/sessionId' '403': content: application/json: examples: example-0001: value: reason: 'Session not found' statusCode: 403 statusText: Forbidden schema: $ref: '#/components/schemas/errorDescription' description: 'Session id invalid or not found' '500': content: application/json: examples: example-0001: value: reason: Could not validate device activation statusCode: 500 statusText: Internal Server Error schema: $ref: '#/components/schemas/errorDescription' description: 'Internal Server Error' headers: X-Session-Id: required: false schema: $ref: '#/components/schemas/sessionId' summary: Acquire download token for App "/api/v2/products": parameters: [ ] get: description: 'Get all products' operationId: get-api-v2-products parameters: - name: store_id in: query schema: type: integer required: false responses: '200': content: application/json: schema: type: object properties: statusCode: type: integer statusText: type: string data: $ref: "#/components/schemas/productResponse" required: - statusCode - data description: 'All products of the store referenced by store_id or default store' '500': content: application/json: examples: example-0001: value: reason: Unknown error statusCode: 500 statusText: Internal Server Error schema: $ref: '#/components/schemas/errorDescription' description: 'Internal Server Error' summary: Get all products tags: - Products "/api/v2/products/apps": parameters: [ ] get: description: 'Get all app products' operationId: get-api-v2-products-apps parameters: - name: store_id in: query schema: type: integer required: false responses: '200': content: application/json: schema: type: object properties: statusCode: type: integer statusText: type: string data: $ref: "#/components/schemas/appResponse" required: - statusCode - data description: 'All apps of the store referenced by store_id or default store' '500': content: application/json: examples: example-0001: value: reason: Unknown error statusCode: 500 statusText: Internal Server Error schema: $ref: '#/components/schemas/errorDescription' description: 'Internal Server Error' summary: Get all app products tags: - Products "/api/v2/products/apps/reviews": parameters: [ ] post: description: 'Post a review for an app' operationId: get-api-v2-products-apps-reviews requestBody: content: application/json: schema: $ref: '#/components/schemas/reviewRequest' responses: '201': content: application/json: schema: type: object properties: statusCode: type: integer statusText: type: string data: $ref: "#/components/schemas/reviewResponse" required: - statusCode - data description: 'All apps of the store referenced by store_id or default store' '500': content: application/json: examples: example-0001: value: reason: Unknown error statusCode: 500 statusText: Internal Server Error schema: $ref: '#/components/schemas/errorDescription' description: 'Internal Server Error' summary: Post a review for an app tags: - Products "/api/v2/my/products": parameters: [ ] get: description: 'Get all products for a specific user' operationId: get-api-v2-my-products parameters: - name: store_id in: query schema: type: integer required: false - $ref: '#/components/parameters/authParam' responses: '200': content: application/json: schema: type: object properties: statusCode: type: integer statusText: type: string data: $ref: "#/components/schemas/productResponse" required: - statusCode - data description: 'All products of a user' '500': content: application/json: examples: example-0001: value: reason: Unknown error statusCode: 500 statusText: Internal Server Error schema: $ref: '#/components/schemas/errorDescription' description: 'Internal Server Error' summary: Get all products for a specific user tags: - User "/api/v2/my/products/apps": parameters: [ ] get: description: 'Get all app products for a specific user' operationId: get-api-v2-my-products-apps parameters: - name: store_id in: query schema: type: integer required: false - $ref: '#/components/parameters/authParam' responses: '200': content: application/json: schema: type: object properties: statusCode: type: integer statusText: type: string data: $ref: "#/components/schemas/productResponse" required: - statusCode - data description: 'All app products of a user' '500': content: application/json: examples: example-0001: value: reason: Unknown error statusCode: 500 statusText: Internal Server Error schema: $ref: '#/components/schemas/errorDescription' description: 'Internal Server Error' summary: Get all app products for a specific user tags: - User "/api/v2/my/subscriptions": parameters: [ ] get: description: 'Get all subscriptions of a specific user' operationId: get-api-v2-my-subscriptions parameters: - name: store_id in: query schema: type: integer required: false - $ref: '#/components/parameters/authParam' responses: '200': content: application/json: schema: type: object properties: statusCode: type: integer statusText: type: string data: $ref: "#/components/schemas/subscriptions" required: - statusCode - data description: 'All subscriptions of a user' '500': content: application/json: examples: example-0001: value: reason: Unknown error statusCode: 500 statusText: Internal Server Error schema: $ref: '#/components/schemas/errorDescription' description: 'Internal Server Error' summary: Get all subscriptions of a specific user tags: - User